Page 1 of 1
Posted: Sat Mar 30, 2002 10:36 pm
by BackupUser
Restored from previous forum. Originally posted by skypa.
Hi again
is there a possibillity overwrite values (bytes) in the memory with PureBasic? For example writing new bytes on a adress like this one: 00401022 (memory of another process)
Posted: Sun Mar 31, 2002 12:20 pm
by BackupUser
Restored from previous forum. Originally posted by Rings.
PokeB(Adress,Value)
or if you want to write into a Programms Codememory see Topic 'Selfmodified Codeexample' under Tips & Tricks.
Its a long way to the top if you wanna .....CodeGuru
Posted: Sun Mar 31, 2002 12:52 pm
by BackupUser
Restored from previous forum. Originally posted by skypa.
Hm, i only get a warning that no writing on adress xxx possible is. Any way to overwrite memory which is still in use?
Posted: Sun Mar 31, 2002 8:17 pm
by BackupUser
Restored from previous forum. Originally posted by fred.
Hopefully not !
Fred - AlphaSND
Posted: Sun Mar 31, 2002 8:40 pm
by BackupUser
Restored from previous forum. Originally posted by skypa.
Hopefully not !
Fred - AlphaSND
Hm.. seems that there is no way to code kinda game trainer with PB, isn't it?
Posted: Sun Mar 31, 2002 8:47 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
> seems that there is no way to code kinda game trainer with PB
Sure you can! Here's a Visual Basic example, which you should easily be able
to convert to PureBasic:
http://www.gamehacking.com/data/tutorials/prgvb2.shtml
PB - Registered PureBasic Coder
Posted: Sun Mar 31, 2002 8:58 pm
by BackupUser
Restored from previous forum. Originally posted by skypa.
> Sure you can! Here's a Visual Basic example, which you should easily be able
> to convert to PureBasic:
>
http://www.gamehacking.com/data/tutorials/prgvb2.shtml
Big thanks PB

)
Posted: Sun Mar 31, 2002 9:33 pm
by BackupUser
Restored from previous forum. Originally posted by skypa.
hwnd.l = FindWindow_(Nullstring,"Rechner") ;Rechner = Calculator
If hwnd = 0
MessageRequester("","Window not found",0)
EndIf
proid.l=GetWindowThreadProcessID_(hwnd,pid)
pHandle.l = OpenProcess_(PROCESS_ALL_ACCESS, False, pid)
The pHandle is every time i run this code zero ?! Any ideas why or how to translate the API funtions to PureBasic in an other way?
Posted: Sun Mar 31, 2002 10:12 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.
Ummm.... you aren't using any constants for starters.
I could be wrong but win API declares PROCESS_ALL_ACCESS as something like:
#STANDARD_RIGHTS_REQUIRED=$F0000
#SYNCHRONIZE=$100000
#PROCESS_ALL_ACCESS=#STANDARD_RIGHTS_REQUIRED|#SYNCHRONIZE|$FFF
and GetWindowThreadProcessId as:
Code: Select all
DWORD GetWindowThreadProcessId(
HWND hWnd, // handle of window
LPDWORD lpdwProcessId // address of variable for process identifier
);
so maybe...??
hWnd=FindWindow_(0,"Calculator")
proid=GetWindowThreadProcessID_(hWnd,@pid)
and maybe...
pHandle.l = OpenProcess_(#PROCESS_ALL_ACCESS, 0, pid)
I'm not saying this will work, but it's probably closer than what you have there.
Fred would probably know best
Edited by - paul on 31 March 2002 23:13:21
Posted: Mon Apr 01, 2002 3:05 am
by BackupUser
Restored from previous forum. Originally posted by PB.
> pHandle.l = OpenProcess_(PROCESS_ALL_ACCESS, False, pid)
Stick a # in front of the PROCESS... constant, and it should work.
If not, you'll need to declare the constant, as Paul said in his post.
Oh, and wherever Visual Basic has vbNullString, that just means "" in
PureBasic (ie. an empty string). And 0 for vbNull.
PB - Registered PureBasic Coder
Edited by - PB on 01 April 2002 04:07:56