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 


need help in last step in cheat engine tutorial Can Any One

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Invader
Advanced Cheater
Reputation: 0

Joined: 19 Mar 2012
Posts: 78

PostPosted: Wed Jun 06, 2012 6:22 pm    Post subject: need help in last step in cheat engine tutorial Can Any One Reply with quote

in last step "shade code"
Here Is My Code That I found
Quote:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
cmp [ebx+10],1
jne +5
mov eax,1120403456
originalcode:
mov [ebx+04],eax
fldz

exit:
jmp returnhere

"Tutorial-i386.exe"+250C6:
jmp newmem
returnhere:




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"Tutorial-i386.exe"+250C6:
mov [ebx+04],eax
fldz
//Alt: db 89 43 04 D9 EE

and it work but the problem it be come in float or some thing like that
and the number become 1.62803491E-19
Can Any One Help
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Thu Jun 07, 2012 7:09 am    Post subject: Reply with quote

Code:
[ENABLE]
alloc(newmem2,128)
registersymbol(newmem2)
label(noop)

newmem2:
pushfd
cmp [ebx+10],1
je noop
mov [ebx+04],eax
noop:
popfd
fldz
ret

"Tutorial-i386.exe"+250C6:
call newmem2

[DISABLE]
alloc(newmem2,128)
unregistersymbol(newmem2)

"Tutorial-i386.exe"+250C6:
mov [ebx+04],eax
fldz

your code is wrong here :
Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
pushfd// -> save flags!!!!
cmp [ebx+10],1
jne +5 //??? it is better to create a label
+5 means jump 5 instructions NOT 5 auto assembler lines
//what are you doing here ?
mov eax,1120403456 // you are setting 100
to set 100 in float use ...
mov dword ptr eax,42C80000

originalcode:
mov [ebx+04],eax // then decreasing with original code ?
fldz // this way they will never die

/*first check if the unit is yours
save flags
cmp ...bla
if it is do one code
if it is not do another code
before exiting ... pop flags (restore them)*/

exit:
popfd //-> restore flags
jmp returnhere

"Tutorial-i386.exe"+250C6:
jmp newmem
returnhere:




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"Tutorial-i386.exe"+250C6:
mov [ebx+04],eax
fldz
//Alt: db 89 43 04 D9 EE

your biggest mistakes ...
not saving flags and then restoring them
setting wrong values 100 in float
jne +5 means jump if not equal 5 instructions not 5 lines
the AA structure.
it is better to use labels otherwise it's confusing
think humanly:

if unit is mine
jump to ... do nothing
if not
do original code

your code said:
if unit is not mine
jump to do nothing
if it is
set hp 100
then decrease

... think about it ...
cheers

_________________
... Fresco
Back to top
View user's profile Send private message
Invader
Advanced Cheater
Reputation: 0

Joined: 19 Mar 2012
Posts: 78

PostPosted: Thu Jun 07, 2012 10:07 pm    Post subject: Reply with quote

first thanks
second iam new in writ assemble for games so i don't understand most of things you write so can you help me of give me some links
Back to top
View user's profile Send private message
g4m3rxx
Newbie cheater
Reputation: 0

Joined: 13 May 2012
Posts: 19
Location: India

PostPosted: Fri Jun 08, 2012 5:14 am    Post subject: Reply with quote

I think that here +5 represents 5 bytes not instruction.

And floating values can be represented in AA as (float)100
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Fri Jun 08, 2012 8:38 am    Post subject: Reply with quote

anyways it is simpler and faster to write the aa code as i have.

i'll explain it

[ENABLE] ->instructions from here to [DISABLE] are used to enable the cheat ... CE executes this code when you activate the code

alloc(newmem2,128) ->newmem2 is a label used to identify the address of the (in memory) allocated space where your code is stored, you can change newmem2 into whatever you want ... 128 is number of bytes that the whole code requires excluding labeld ... only real instructions ... for example if your code requires only 12 bytes, alloc only 12 not 2kb ...

registersymbol(newmem2) -> the label newmem2 is being recognized by the game (when you write jmp newmem2 the program understands that it has to jump to the specific address of newmem2 otherwise you'll have to write jmp address ... i know when you write jmp newmem2 without registersymbol it work anyway but if you make another script and write jmp newmem2 there it won't work because it is not registered.)

label(noop) to avoid using jmp+x register a label and jmp label not +x

newmem2: -> this indicates and address; the address of newmem2

pushfd -> when you use cmp or any other instruction that uses the flags you have to first save the old flags in order to prevent the changing of an "in game needed flag"
result of cmp is stored in flags

cmp [ebx+10],1 -> compare instruction if the unit is mine then

je noop -> then jump to the address of noop ... that does nothing

mov [ebx+04],eax -> if unit is not mine then store eax (decreased hp) into the value of enemy hp address

noop: no matter if coming from my or enemy unit run this code anyways

popfd -> delete flags that we used and restore the original ones

fldz -> i don't need to explain that you MUST put the original code that was not modifyed by you before exiting the code

ret -> since i have used a call i need to go back

"Tutorial-i386.exe"+250C6:
call newmem2 --> modify the original instruction with call newmem2 (my code)

[DISABLE] from here till the end of aa scrip ce recognises this as a disable code ... a restore to normal
dealloc(newmem2,128) / delete the allocated space in memory
unregistersymbol(newmem2) / unregister any symbol

"Tutorial-i386.exe"+250C6: / restore original code
mov [ebx+04],eax
fldz

sorry for any typing errors ... corrector was off Very Happy

ps: jmp +5 is not recognised as a true assembly instructions ... cheat engine then translates jmp +5 to jmp address ... being address equal to EIP + 5instructions

_________________
... Fresco
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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