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/DISCUSSION] Tips on improving AA jump hack code

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

Joined: 31 May 2012
Posts: 21
Location: United States

PostPosted: Wed Dec 20, 2017 5:04 am    Post subject: [HELP/DISCUSSION] Tips on improving AA jump hack code Reply with quote

Hey guys, back again. This time I don't really need help but would like brutally honest opinions from people who have more experience than me.

For starters, the game of the day is darksiders 2.

I finally finished my jump hack (actual jump hack not just changing coords), however, I feel as though my code is sloppy and could be improved as it does use a lot of repetition(still proud of it though as it's my first actual jump hack)

------Register TOC---------
[ebx+08] == Z coord
[ebx-9c] == StaticVelocity
[ebx+110] == The best jump indicator I could find(like %95 perfect -- slight issue when at the top of a climb but not serious)
------------------------------
Truthfully the code works nearly flawless and I am happy with the effect. Now I am just wondering if my code is about as clean as it gets or if it could use some housekeeping


(side note, the reason for the check in height instead of just a jump check is because I want gravity to return to normal at the top of the jump. It feels kind of weird with low velocity throughout the whole jump as the velocity changes everything eg. X/Y movespeed, and even character model rotation)

As usual, crack the whip if necessary haha.

***BAH! EDIT-----
I meant to also mention that the code I chose to inject a also modifies like 10 other addresses that would crash the game if modified however the Z-Axis address is the only one with a float value of 1.0 or 0.35 at -9c. Also, seeing as the game uses velocity, I imagine that upon jumping, your are launched into the air using a static value for "force". the value increases by roughly 55 before descending on a normal jump but I simply could not find that value. Am I wrong in my thinking? It would be a lot simpler to just modify the launch force in my opinion ... if possible...

Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(yax)
label(jmpchk)
label(velmod)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:
cmp [ebx-9c],(float)1.0
je yax
cmp [ebx-9c],(float)0.35
je yax
fstp dword ptr [ebx+08]
mov eax,[edi]

exit:
jmp returnhere

yax:
push ecx
mov ecx,[ebx+08]
fstp dword ptr [ebx+08]
cmp ecx,[ebx+08]
pop ecx
jl jmpchk
mov [ebx-9c],(float)1.0
mov eax,[edi]
jmp returnhere

jmpchk:
cmp [ebx+110],(float)1.0
jg velmod
mov [ebx-9c],(float)1.0
mov eax,[edi]
jmp returnhere

velmod:
mov [ebx-9c],(float)0.35
mov eax,[edi]
jmp returnhere

"Darksiders2.exe"+48B7EB:
jmp newmem
returnhere:


 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"Darksiders2.exe"+48B7EB:
fstp dword ptr [ebx+08]
mov eax,[edi]
//Alt: db D9 5B 08 8B 07
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