Thanks for reading blackhat.
it should be done throug Autohotkey memory reading. I want to use it to give players wanted by aiming at them and pressing a button. keybinder. the only thing i want is to read out the playername and then give it to the script, for example:
i am aiming at a player, pressing 1 for give wanteds, it automatically writes /wanted playername 10 reason.
I only need the memory adress to read out the info.
I can use these functions:
ReadMemoryFirst(MADDRESS,PROGRAM)
{
winget, pid, PID, %PROGRAM%
VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
return, result
}
ReadMemoryFirstFloat(MADDRESS=0,PROGRAM="")
{
Static OLDPROC, ProcessHandle
VarSetCapacity(MVALUE,4,0)
If PROGRAM != %OLDPROC%
{
WinGet, pid, pid, % OLDPROC := PROGRAM
ProcessHandle := ( ProcessHandle ? 0*(closed:=DllCall("CloseHandle"
,"UInt",ProcessHandle)) : 0 )+(pid ? DllCall("OpenProcess"
,"Int",2035711,"Int",0,"UInt",pid) : 0)
}
If (ProcessHandle) && DllCall("ReadProcessMemory","UInt"
,ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
{
MVALUE := *(&MVALUE+3)<<24 | *(&MVALUE+2)<<16 | *(&MVALUE+1)<<8 | *(&MVALUE)
return (1-2*(MVALUE>>31)) * (2**((MVALUE>>23 & 255)-127)) * (1+(MVALUE & 8388607)/8388608)
}
return !ProcessHandle ? "Handle Closed: " closed : "Fail"
}
ReadMemorySecond(hwnd,address,datatype="int",length=4,offset=0)
{
VarSetCapacity(readvalue,length, 0)
DllCall("ReadProcessMemory","Uint",hwnd,"Uint",address+offset,"Str",readvalue,"Uint",length,"Uint *",0)
finalvalue := NumGet(readvalue,0,datatype)
return finalvalue
}
OpenMemoryfromTitle(title,right=0x1F0FFF)
{
WinGet,PID,PID,%title%
HWND := DllCall("OpenProcess","Uint",right,"int",0,"int",PID)
return HWND
}
CloseMemory(hwnd)
{
return DllCall("CloseHandle", "int", hwnd)
}