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 


HELLO TO ALL! Please help me.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
LuC-iTA
Newbie cheater
Reputation: 0

Joined: 14 Jul 2014
Posts: 14

PostPosted: Mon Jul 14, 2014 10:01 am    Post subject: HELLO TO ALL! Please help me. Reply with quote

Hello to all users!
I'm not new to this forum because I learned a lot by reading many many posts and tutorials.
But now I'm really stuck on the teleport hack USING base address with offsets instead of opcodes. (correct me if I'm wrong)
I managed to create a script that saves the X position but if I try to restore it...the game crashes.
I've read several posts about it but I'm still stuck.
Could someone please kindly help me?

Sorry for my poor english

Regards

Luciano

Here's the script:
Code:

[ENABLE]
alloc(newmem,256)
alloc(_X,8)
registersymbol(_X)
alloc(saveX,8)
registersymbol(saveX)
alloc(restoreX,8)
registersymbol(restoreX)
label(_save)
registersymbol(_save)
label(returnhere)

_X:
dd 0

_save:
dd 0

newmem:
cmp [_save],#1
je salvaX
cmp [_save],#2
je restoreX

fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
jmp returnhere

saveX:
push ecx
mov ecx,"Bully.exe"+0082AA68
mov ecx,[ecx]
add ecx,34
mov ecx,[ecx]
mov [_X],ecx
pop ecx
mov [_save],#0

fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
jmp returnhere

restoreX:
push ecx
mov ecx,"Bully.exe"+0082AA68
mov ecx,[ecx]
add ecx,34
mov ecx,[ecx]
mov ecx,[_X]
pop ecx
mov [_save],#0

fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
jmp returnhere


"Bully.exe"+7D8D5:
jmp newmem
nop
nop
nop
nop
nop
returnhere:

[DISABLE]
dealloc(newmem)
"Bully.exe"+7D8D5:
fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
//Alt: db D9 58 04 F6 86 BC 01 00 00 02

dealloc(_X)
unregistersymbol(_X)

dealloc(saveX)
unregistersymbol(saveX)

dealloc(restoreX)
unregistersymbol(restoreX)

unregistersymbol(_save)


Edit:
Script rewrote to english language
Back to top
View user's profile Send private message
661089799107
Expert Cheater
Reputation: 3

Joined: 25 Jan 2009
Posts: 186

PostPosted: Mon Jul 14, 2014 1:06 pm    Post subject: Reply with quote

Set a breakpoint on your code and step through it to see what instruction it is crashing on.
Back to top
View user's profile Send private message
LuC-iTA
Newbie cheater
Reputation: 0

Joined: 14 Jul 2014
Posts: 14

PostPosted: Mon Jul 14, 2014 2:04 pm    Post subject: Reply with quote

661089799107 wrote:
Set a breakpoint on your code and step through it to see what instruction it is crashing on.

Thanks for the answer. I'll try and report back the result.
Back to top
View user's profile Send private message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Mon Jul 14, 2014 3:22 pm    Post subject: Reply with quote

Alright,
The problems are with allocations and what are you trying to do with restoring the value..

Also are you trying to store/restore a POINTER value?

Code:
[ENABLE]
alloc(script_mem,2048) //2kb, allocate a region of memory in bytes* (you allocated 8 bytes for actions that take much more..) for all our actions
label(saveX)
label(restoreX)
label(_X)
label(_save)
label(original_function)
label(returnhere)
registersymbol(_X)
registersymbol(_save)

script_mem:
cmp [_save],#1
je salvaX
cmp [_save],#2
je restoreX
jmp original_function

saveX: //stored in script_mem allocated region
push ecx
mov ecx,"Bully.exe"+0082AA68
mov ecx,[ecx]
add ecx,34 // why are you increasing the value by 34? is 34 the offset?
mov ecx,[ecx] // assuming [ecx] holds X
mov [_X],ecx // storing x in _X
pop ecx
mov [_save],#0
jmp original_function // let's just jump to other location instead of placing again the original script..

restoreX: //stored in script_mem allocated region
push ecx
push ebx // store the save value..
mov ebx,[_x]
mov ecx,"Bully.exe"+0082AA68
mov ecx,[ecx]
add ecx,34 // mhmm...
//mov ecx,[ecx] // why are you getting x again here?
//mov ecx,[_X] // storing _X value in ecx and then popping it.. does nothing...
mov [ecx],ebx
pop ebx
pop ecx
mov [_save],#0
jmp original_function

original_function://stored in script_mem allocated region
fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
jmp returnhere

_X: //stored in script_mem allocated region
dd 0

_save: //stored in script_mem allocated region
dd 0


"Bully.exe"+7D8D5:
jmp script_mem
nop
nop
nop
nop
nop
returnhere:

[DISABLE]
dealloc(script_mem)
"Bully.exe"+7D8D5:
fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
//Alt: db D9 58 04 F6 86 BC 01 00 00 02

unregistersymbol(_X)
unregistersymbol(_save)

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
LuC-iTA
Newbie cheater
Reputation: 0

Joined: 14 Jul 2014
Posts: 14

PostPosted: Mon Jul 14, 2014 4:03 pm    Post subject: Reply with quote

Many thanks for your priceless answer DaSpamer.
I'll try to explain better what I would do. I found the coordinates. The X coordinate has the base address "Bully.exe"+0082AA68 and its offset is 34. _X I would like to save the value, and then restore it. I took inspiration from a script already done.
My question is: is it possible to do what I want to do? I'm worried and really need help.

EDIT:
I'm going to try your script and learn.
What i'm adding is the offset to the base address stored in the register. And than put the value into the register.
I'm a right? Embarassed
Hope nobody wants to kill me for what I would do.

EDIT2:
WOW! Your code works flawlessly. However it stores the value in _X but when I try to restore...nothing happens. The value doesn't change.
I'm trying to understand why.
Anyway many thanks for your help. Your code teaches me alot!


Last edited by LuC-iTA on Mon Jul 14, 2014 4:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Mon Jul 14, 2014 4:13 pm    Post subject: Reply with quote

Try this
Code:
[ENABLE]
alloc(script_mem,2048) //2kb, allocate a region of memory in bytes* (you allocated 8 bytes for actions that take much more..) for all our actions
label(saveX)
label(restoreX)
label(_X)
label(_save)
label(original_function)
label(returnhere)
registersymbol(_X)
registersymbol(_save)

script_mem:
cmp [_save],#1
je salvaX
cmp [_save],#2
je restoreX
jmp original_function

saveX: //stored in script_mem allocated region
push ecx
mov ecx,["Bully.exe"+0082AA68]
mov ecx,[ecx+34]
mov [_X],ecx // storing x in _X
pop ecx
mov [_save],#0
jmp original_function // let's just jump to other location instead of placing again the original script..

restoreX: //stored in script_mem allocated region
push ecx
push ebx // store the save value..
mov ebx,[_x]
mov ecx,["Bully.exe"+0082AA68]
mov [ecx+34],ebx // restoring
pop ebx
pop ecx
mov [_save],#0
jmp original_function

original_function://stored in script_mem allocated region
fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
jmp returnhere

_X: //stored in script_mem allocated region
dd 0

_save: //stored in script_mem allocated region
dd 0


"Bully.exe"+7D8D5:
jmp script_mem
nop
nop
nop
nop
nop
returnhere:

[DISABLE]
dealloc(script_mem)
"Bully.exe"+7D8D5:
fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
//Alt: db D9 58 04 F6 86 BC 01 00 00 02

unregistersymbol(_X)
unregistersymbol(_save)

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
LuC-iTA
Newbie cheater
Reputation: 0

Joined: 14 Jul 2014
Posts: 14

PostPosted: Mon Jul 14, 2014 4:25 pm    Post subject: another! thanks! Reply with quote

Another script! Again thanks!
Am trying this!

EDIT:
Same as above. Your code works very well! It stores the value in _X but when I try to restore the value it doesn't change.
I'm thinking whats the problem.
There might be some code that overrides the script?

EDIT2:
Mmm...Theres ALOT OF code that overrides! I wll make the teleport hack in another way, at this point. Laughing

But first I have to learn alot of more from the above script.
(how can I give a reputation point to one or two users?)
Back to top
View user's profile Send private message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Mon Jul 14, 2014 4:55 pm    Post subject: Reply with quote

My bad try this
Code:
[ENABLE]
alloc(script_mem,2048) //2kb, allocate a region of memory in bytes* (you allocated 8 bytes for actions that take much more..) for all our actions
label(saveX)
label(restoreX)
label(_X)
label(_save)
label(original_function)
label(returnhere)
registersymbol(_X)
registersymbol(_save)

script_mem:
cmp [_save],#1
je salvaX
cmp [_save],#2
je restoreX
jmp original_function

saveX: //stored in script_mem allocated region
push ecx
mov ecx,["Bully.exe"+0082AA68]
mov ecx,[ecx+34]
mov [_X],ecx // storing x in _X
pop ecx
mov [_save],#0
jmp original_function // let's just jump to other location instead of placing again the original script..

restoreX: //stored in script_mem allocated region
push ecx
push ebx // store the save value..
mov ebx,[_X]
mov ecx,["Bully.exe"+0082AA68]
mov [ecx+34],ebx // restoring
pop ebx
pop ecx
mov [_save],#0
jmp original_function

original_function://stored in script_mem allocated region
fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
jmp returnhere

_X: //stored in script_mem allocated region
dd 0

_save: //stored in script_mem allocated region
dd 0


"Bully.exe"+7D8D5:
jmp script_mem
nop
nop
nop
nop
nop
returnhere:

[DISABLE]
dealloc(script_mem)
"Bully.exe"+7D8D5:
fstp dword ptr [eax+04]
test byte ptr [esi+000001BC],02
//Alt: db D9 58 04 F6 86 BC 01 00 00 02

unregistersymbol(_X)
unregistersymbol(_save)

Didn't used Captial X in the restore script.

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
LuC-iTA
Newbie cheater
Reputation: 0

Joined: 14 Jul 2014
Posts: 14

PostPosted: Mon Jul 14, 2014 5:40 pm    Post subject: No problem Reply with quote

No problem for the capital X. I've fixed by myself and didn't tell you because you're helping me too much Smile

However it doesn't restore because of many many other opcodes wich controls the X position. And the other coordinates.
The game, Bully, as the same engine of the GTA SA, VC and 3. Renderware.
And this method doen't work with all the GTA.
However this method you created is useful for other hacks.

So again many thanks for your great help! Surprised

Edit:
Your sign with my nickname is so funny! Very Happy I'll try your generator! Wink
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 Gamehacking 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