Re: Basic Memory Scanning - Like Cheat Engine
Posted: Mon Jan 10, 2011 5:40 am
Classic, issues with x64
. Glad to hear you were able to fix it though.

http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Global.b stackout ;state to allow clean thread exit
Enumeration
#Window_0
#Button_0
EndEnumeration
Procedure.b patchmem(*valx)
address=$05E4798C
window$="uplink"
value$="100000"
Repeat
Delay(1000)
hwnd=FindWindow_(0,win$)
If hwnd
GetWindowThreadProcessId_(hwnd,@pid.l)
hprocess=OpenProcess_(#PROCESS_ALL_ACCESS,0,pid)
If hProcess
result=WriteProcessMemory_(hProcess,address,@value$, Len(value$)*2,0)
CloseHandle_(hprocess)
EndIf
EndIf
Until hwnd=0 Or stackout=1
EndProcedure
If OpenWindow(#Window_0,0,0,221,73,"Uplink millionaire",#PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
ButtonGadget(#Button_0,6,8,210,60,"Start")
Repeat
Event = WaitWindowEvent()
GadgetID = EventGadget()
If Event = #PB_Event_Gadget
If GadgetID = #Button_0
If IsThread(thread)=0
stackout=0
SetGadgetText(#Button_0,"Stop")
thread=CreateThread(@patchmem(),*value)
Else
stackout=1
SetGadgetText(#Button_0,"Start")
EndIf
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
If IsThread(thread) : KillThread(thread) : EndIf
End