Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help] How to change register in vb6?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
maxjojo
Master Cheater
Reputation: 0

Joined: 05 Nov 2007
Posts: 459
Location: Taiwan

PostPosted: Sun May 18, 2008 12:29 am    Post subject: [Help] How to change register in vb6? Reply with quote

after I could readProcessMemory & writeProcessMemory, I try to changeRegister on breakPoint, the call return true but actually didn't work.
here is my Declare :
Code:

Public Declare Function ChangeRegOnBP Lib "IlvMoney.dll" (ByVal Processid As Long, ByVal address As Long, ByVal debugreg As Integer, ByVal changeEAX As Boolean, ByVal changeEBX As Boolean, ByVal changeECX As Boolean, ByVal changeEDX As Boolean, ByVal changeESI As Boolean, ByVal changeEDI As Boolean, ByVal changeEBP As Boolean, ByVal changeESP As Boolean, ByVal changeEIP As Boolean, ByVal changeCF As Boolean, ByVal changePF As Boolean, ByVal changeAF As Boolean, ByVal changeZF As Boolean, ByVal changeSF As Boolean, ByVal changeOF As Boolean, ByVal newEAX As Long, ByVal newEBX As Long, ByVal newECX As Long, ByVal newEDX As Long, ByVal newESI As Long, ByVal newEDI As Long, ByVal newEBP As Long, ByVal newESP As Long, ByVal newEIP As Long, ByVal newCF As Boolean, ByVal newPF As Boolean, ByVal newAF As Boolean, ByVal newZF As Boolean, ByVal newSF As Boolean, ByVal newOF As Boolean) As Boolean

Public Declare Function DebugProcess Lib "IlvMoney.dll" (ByVal Processid As Long, ByVal address As Long, ByVal size As Byte, ByVal debugtype As Byte) As Boolean


here is my code:
Code:

'// try to change register on breakpoint

'// declear in delphi:
'type TDebugProcess=function(processid:dword;address:DWORD;size: byte;debugtype:byte):BOOL; stdcall;
Dim Processid As Long
Dim address As Long
Dim size As Byte
Dim debugtype As Byte
Dim ret As Boolean


'Processid = hProcessHandle
Processid = hProcessID
address = &H00401c77
size = 1
debugtype = 3
ret = DebugProcess(Processid, address, size, debugtype)
MsgBox ret

'// declear in delphi:
'type TRetrieveDebugData=function(Buffer: pointer):integer; stdcall;



'// declear in delphi:
'   type TChangeRegOnBP=function(
'       Processid:dword;
'       address: dword;
'       debugreg: integer;
'       changeEAX,changeEBX,changeECX,changeEDX,changeESI,changeEDI,changeEBP,changeESP,changeEIP,changeCF,changePF,changeAF,changeZF,changeSF,changeOF:BOOLEAN;
'       newEAX,newEBX,newECX,newEDX,newESI,newEDI,newEBP,newESP,newEIP:DWORD;
'       newCF,newPF,newAF,newZF,newSF,newOF:BOOLEAN):BOOLEAN; stdcall;

Dim debugreg As Integer
Dim changeEAX, changeEBX, changeECX, changeEDX, changeESI, changeEDI, changeEBP, changeESP, changeEIP, changeCF, changePF, changeAF, changeZF, changeSF, changeOF As Boolean
Dim newEAX, newEBX, newECX, newEDX, newESI, newEDI, newEBP, newESP, newEIP As Long
Dim newCF, newPF, newAF, newZF, newSF, newOF As Boolean

address = &H00401c77
debugreg = 0
changeEIP = True
newEIP = &H00401c7

ret = ChangeRegOnBP(Processid, address, debugreg, changeEAX, changeEBX, changeECX, changeEDX, changeESI, changeEDI, changeEBP, changeESP, changeEIP, changeCF, changePF, changeAF, changeZF, changeSF, changeOF, newEAX, newEBX, newECX, newEDX, newESI, newEDI, newEBP, newESP, newEIP, newCF, newPF, newAF, newZF, newSF, newOF)
MsgBox ret


I want to set newEIP in address 00401c77, to jmp address 00401c7A.

_________________
Max ^_^)y
Back to top
View user's profile Send private message
lailei009
How do I cheat?
Reputation: 0

Joined: 05 Feb 2009
Posts: 9

PostPosted: Thu Mar 26, 2009 8:08 am    Post subject: Reply with quote

I catch the same error and don't know how to slove it
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites