Skip to content

Is that possible to find dynamic adresses or allocate and inject ? #80

Description

@aymericingargiola

I am building a run history tracker Electron app for The Binding of Isaac and actually i am parsing the logs but it miss a lot of informations (coins, damage, speed, bombs...) so i had the idea to read the game memory and then i found your project.

I am able to run memoryjs and it seems to work,

const memoryjs = require('memoryjs') const isaacProcessName = "isaac-ng.exe" const isaacExe = memoryjs.openProcess(isaacProcessName) console.log(isaacExe) const address = memoryjs.virtualAllocEx( isaacExe.handle, null, 0x60, memoryjs.MEM_RESERVE | memoryjs.MEM_COMMIT, memoryjs.PAGE_EXECUTE_READWRITE, ) console.log(Allocated address: 0x${address.toString(16).toUpperCase()})

{ dwSize: 304, th32ProcessID: 46544, cntThreads: 12, th32ParentProcessID: 37352, pcPriClassBase: 8, szExeFile: 'isaac-ng.exe', handle: 2908, modBaseAddr: 11206656 } Allocated address: 0x8A0000

But here is the tricky part... this game doesn't has static way to get information, so i found an cheat engine script that works and does :

`
This script dumps player structure into sPlayer, then show important offsets
like coins, keys, hearts, etc...
[ENABLE]
aobscanmodule(ReadMoney,isaac-ng.exe,FF B0 B0 12 00 00) // should be unique
alloc(newmem,$1000)
globalalloc(sPlayer,4)
label(code)
label(return)

newmem:
mov [sPlayer],eax
code:
push [eax+000012B0]
jmp return

ReadMoney:
jmp newmem
nop
return:
registersymbol(ReadMoney)

[DISABLE]

ReadMoney:
db FF B0 B0 12 00 00

unregistersymbol(ReadMoney)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: isaac-ng.exe+4AB53B

isaac-ng.exe+4AB512: 68 58 44 C3 00 - push isaac-ng.exe+7A4458
isaac-ng.exe+4AB517: 8D 45 98 - lea eax,[ebp-68]
isaac-ng.exe+4AB51A: 8B CE - mov ecx,esi
isaac-ng.exe+4AB51C: 50 - push eax
isaac-ng.exe+4AB51D: E8 DE 96 B5 FF - call isaac-ng.epoxy_handle_external_wglMakeCurrent+2F20
isaac-ng.exe+4AB522: F3 0F 10 45 80 - movss xmm0,[ebp-80]
isaac-ng.exe+4AB527: F3 0F 58 45 98 - addss xmm0,[ebp-68]
isaac-ng.exe+4AB52C: 8B 45 94 - mov eax,[ebp-6C]
isaac-ng.exe+4AB52F: 8B 0D 04 E4 C0 00 - mov ecx,[isaac-ng.exe+77E404]
isaac-ng.exe+4AB535: 81 C1 00 B7 01 00 - add ecx,0001B700
// ---------- INJECTING HERE ----------
isaac-ng.exe+4AB53B: FF B0 B0 12 00 00 - push [eax+000012B0]
// ---------- DONE INJECTING ----------
isaac-ng.exe+4AB541: F3 0F 11 45 A0 - movss [ebp-60],xmm0
isaac-ng.exe+4AB546: F3 0F 10 45 84 - movss xmm0,[ebp-7C]
isaac-ng.exe+4AB54B: F3 0F 58 45 9C - addss xmm0,[ebp-64]
isaac-ng.exe+4AB550: 51 - push ecx
isaac-ng.exe+4AB551: 68 A0 01 00 00 - push 000001A0
isaac-ng.exe+4AB556: F3 0F 11 45 A4 - movss [ebp-5C],xmm0
isaac-ng.exe+4AB55B: E8 70 60 01 00 - call isaac-ng.exe+4C15D0
isaac-ng.exe+4AB560: F7 D8 - neg eax
isaac-ng.exe+4AB562: BA C8 0F BA 00 - mov edx,isaac-ng.exe+710FC8
isaac-ng.exe+4AB567: B9 C0 0F BA 00 - mov ecx,isaac-ng.exe+710FC0
}
`

image

Then sPlayer is the right adresse every time
Is that possible to do this with memoryjs ? I search the whole evening and i'm a bit lost

Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions