find base address of a process
Posted: 28 Mar 2017, 09:01
hello
when i use cheatengine for find the address i get "game.exe"+1234
if i add the address manually "game.exe" i get the address: 00a50000
how i can find that address?
i tried with this code:
but i get a different address 0x7ffbfdaf0000
so i can't use the offset ... how i can solve? tnx
when i use cheatengine for find the address i get "game.exe"+1234
if i add the address manually "game.exe" i get the address: 00a50000
how i can find that address?
i tried with this code:
Code: Select all
getProcessBaseAddress(WindowTitle, windowMatchMode := "3") ;WindowTitle can be anything ahk_exe ahk_class etc
{
WinGet, hWnd, ID, %WindowTitle%
return DllCall(A_PtrSize = 4 ; If DLL call fails, returned value will = 0
? "GetWindowLong"
: "GetWindowLongPtr"
, "Ptr", hWnd, "Int", -6, A_Is64bitOS ? "Int64" : "UInt")
; For the returned value when the OS is 64 bit use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
; however if the OS is 32 bit, must use UInt, otherwise the number will be huge (however it will still work as the lower 4 bytes are correct)
; Note - it's the OS bitness which matters here, not the scripts/AHKs
}
but i get a different address 0x7ffbfdaf0000
so i can't use the offset ... how i can solve? tnx