Some string locations for pulling out the names of mobs, gathering nodes, and missions:
Mobs: [[[[[swtor.exe + 00F03AB0] + 148] + 3C8] + 128] + 0]
Objects (Gathering nodes, other interactables..): [[[[[swtor.exe + 00F03AB0] + 148] + 3E8] + 688] + 0]
Missions: [[[[[swtor.exe + 00F03AB0] + 148] + 3E8] + 7E0] + 0]
Once you're at that base location (SB), the in32 at SB+3 contains the number of strings.
Then to cycle through the index it's:
SB + x0B + (x1A * (String# - 1)) + 0A = String Length (int32)
SB + x0B + (x1A * (String# - 1)) + 0E = Offset of string from base (int32)
SB + x0B + (x1A * (String# - 1)) + 12 = String Length (int32) -- same as +0A
So to retrieve the string you grab "String Length" characters from the location: "Offset" + SB...
So to find the SBs:
Code:
Dim intObjectStringBase As Integer
ReadProcessMemory(readHandle, (intMemBaseSWTOR + &HF03AB0), intObjectStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intObjectStringBase + &H148, intObjectStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intObjectStringBase + &H3E8, intObjectStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intObjectStringBase + &H688, intObjectStringBase, 4, Nothing)
GetStrings("Objects", intObjectStringBase)
Dim intMobMissionsStringBase As Integer
ReadProcessMemory(readHandle, (intMemBaseSWTOR + &HF03AB0), intMobMissionsStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intMobMissionsStringBase + &H148, intMobMissionsStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intMobMissionsStringBase + &H3E8, intMobMissionsStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intMobMissionsStringBase + &H7E0, intMobMissionsStringBase, 4, Nothing)
GetStrings("Missions", intMobMissionsStringBase)
Dim intMobStringBase As Integer
ReadProcessMemory(readHandle, (intMemBaseSWTOR + &HF03AB0), intMobStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intMobStringBase + &H148, intMobStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intMobStringBase + &H3C8, intMobStringBase, 4, Nothing)
ReadProcessMemory(readHandle, intMobStringBase + &H128, intMobStringBase, 4, Nothing)
GetStrings("Mobs", intMobStringBase)
And to parse the strings:
Code:
Sub GetStrings(ByVal strType As String, ByVal intBaseAddress As Integer)
Dim datRunTime As String = Now.ToString
Dim intRead As Integer = 1
Dim outMobNames As New System.IO.StreamWriter("c:\SWTORStrings.csv", True)
outMobNames.WriteLine("RunTime,Type,#,Address,int1int32,int2int16,int3int16,int4int32,StringLength,OffsetFromBase,int8int32,StringAddress,String")
Dim intStringsToRead As Integer
ReadProcessMemory(readHandle, intBaseAddress + 3, intStringsToRead, 4, Nothing)
Dim int1int32 As Integer
Dim int2int16 As Integer
Dim int3int16 As Integer
Dim int4int32 As Integer
Dim int5StringLength As Integer
Dim int6OffsetFromBase As Integer
Dim int7StringLength As Integer
Dim int8int32 As Integer = 0
Dim intString As Integer
Dim strString As String
For intRead = 1 To intStringsToRead
ReadProcessMemory(readHandle, &HB + (&H1A * (intRead - 1)) + intBaseAddress, int1int32, 4, Nothing)
ReadProcessMemory(readHandle, &HB + (&H1A * (intRead - 1)) + intBaseAddress + 4, int2int16, 1, Nothing)
ReadProcessMemory(readHandle, &HB + (&H1A * (intRead - 1)) + intBaseAddress + 5, int3int16, 1, Nothing)
ReadProcessMemory(readHandle, &HB + (&H1A * (intRead - 1)) + intBaseAddress + 6, int4int32, 4, Nothing)
ReadProcessMemory(readHandle, &HB + (&H1A * (intRead - 1)) + intBaseAddress + 10, int5StringLength, 4, Nothing)
ReadProcessMemory(readHandle, &HB + (&H1A * (intRead - 1)) + intBaseAddress + 14, int6OffsetFromBase, 4, Nothing)
ReadProcessMemory(readHandle, &HB + (&H1A * (intRead - 1)) + intBaseAddress + 18, int7StringLength, 4, Nothing)
ReadProcessMemory(readHandle, &HB + (&H1A * (intRead - 1)) + intBaseAddress + 22, int8int32, 4, Nothing)
Dim intNameLoop As Integer
strString = ""
For intNameLoop = 0 To int5StringLength - 1
ReadProcessMemory(readHandle, intBaseAddress + int6OffsetFromBase + intNameLoop, intString, 1, Nothing)
strString &= Chr(intString)
Next
strString = Replace(strString, ",", " ")
strString = Replace(strString, vbCr, " ")
strString = Replace(strString, vbLf, " ")
Dim strOutLog As String = datRunTime & "," & strType & "," & intRead & "," & (&HB + (&H1A * (intRead - 1)) + intBaseAddress).ToString("X") & "," & int1int32.ToString("X").PadLeft(4, "0") & "," & int2int16.ToString("X").PadLeft(2, "0") & "," & int3int16.ToString("X").PadLeft(2, "0") & "," & int4int32.ToString("X").PadLeft(4, "0") & "," & int5StringLength & "," & int6OffsetFromBase.ToString("X").PadLeft(4, "0") & "," & int7StringLength & "," & int4int32.ToString("X").PadLeft(4, "0") & "," & (intBaseAddress + int6OffsetFromBase).ToString("X").PadLeft(4, "0") & "," & strString
Debug.WriteLine(strOutLog)
outMobNames.WriteLine(strOutLog)
Next
outMobNames.Close()
End Sub
I'm hoping the other values in the index are some sort of ID that references back to the actual mob, node, mission... So I've dumped them all to CSV (using that code) to see if I can figure out what they are.
And thanks for posting the pointer array, luthien, that's awesome!