From what i understand this means:
Code: Select all
BaseOffset := 0x00B8C83C
offset0 := 0x0
offset1 := 0xA8
offset2 := 0x3FC
If those values are always the same then what changes the result? I think that it's the BaseAddress that i still don't know how to find (yes used google but can't find something that i understand)
Then if the BaseAddress changes how do i get that address everytime i launch the exe?
Also tried the following (obtained this while searching on the forum before posting)
Code: Select all
winget, pid, PID, asd
global ProcessHandle:= DllCall("OpenProcess","Int",16,"Int",0,"UInt",pid)
ReadMemory(MADDRESS)
{
VarSetCapacity(MVALUE,4,0)
DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
return *(&MVALUE+3)<<24 | *(&MVALUE+2)<<16 | *(&MVALUE+1)<<8 | *(&MVALUE)
}
f1::
;//Read from current Dynamic address
addr := 0x03D6F8FC
DynAddr := ReadMemory(addr)
;//Read from Static Pointer
addr0 := 0x00B8C83C
offset0 := 0x0
offset1 := 0xA8
offset2 := 0x3FC
value0 := ReadMemory(addr0)
addr1 := value0 + offset0
msgbox %value0% and %addr1%
value1 := ReadMemory(addr1)
addr2 := value1 + offset1
msgbox %value1% and %addr2%
value2 := ReadMemory(addr2)
addr3 := value2 + offset2
msgbox %value2% and %addr3%
StaticAddr := ReadMemory(addr3)
msgbox %staticaddr%
MsgBox, Dynamic Address,`n Player = %DynAddr% `n`nStatic Pointer,`n Player = %StaticAddr% `n
return
Thank you for your time.
@edit:
Okay i found this and it worked BUT i still have a question about this:
Code: Select all
GetImageBase(filename)
{
static IMAGE_DOS_SIGNATURE := 0x5A4D
static IMAGE_NT_SIGNATURE := 0x4550
static IMAGE_SIZEOF_FILE_HEADER := 20
static MAGIC_PE32 := 0x10B
static MAGIC_PE32PLUS := 0x20B
file := FileOpen(filename, "r")
if !file
return
if (file.ReadUShort() != IMAGE_DOS_SIGNATURE)
|| !file.Seek(60) ; Seek to e_lfanew.
|| !file.Seek(file.ReadInt()) ; Seek to NT header.
|| (file.ReadUInt() != IMAGE_NT_SIGNATURE)
return
file.Seek(IMAGE_SIZEOF_FILE_HEADER, 1) ; Seek to optional header.
magic := file.ReadUShort()
if (magic = MAGIC_PE32)
{
file.Seek(26, 1)
return file.ReadUInt()
}
else if (magic = MAGIC_PE32PLUS) ; x64
{
file.Seek(22, 1)
return file.ReadInt64()
}
}
Does this means that if i share my exe then this base address won't change?. Then i don't have to check this address everytime unless exe changes?EXE files typically have a fixed base, determined when the file is compiled. You can read it from the file's header
Again thank you for your time