 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
happyreadygo Advanced Cheater
Reputation: 1
Joined: 14 Sep 2011 Posts: 87
|
Posted: Thu Jan 12, 2012 9:24 pm Post subject: what do this assembly code do.(control flow) |
|
|
I have basic assembly knowleage , only cmp x,y and mov x,y but idon't know that control flow.
here is the whole function.
mov eax,[esp+04]
test eax,eax
jnge 004df49d
cmp eax,09
jnl 004df49d
mov edx,[esp+08]
lea eax,[eax+eax*2] // this line had edited
mov [ecx+eax*4+44],edx
xor eax,eax
ret 0008
mov eax,fffffffd
ret 0008
can anybody explain what the code is doing in term of higher language.
what i want is to force always "mov [ecx+eax*4+44],edx"
are there any tutorial of assembly control flow.
Last edited by happyreadygo on Thu Jan 12, 2012 10:46 pm; edited 1 time in total |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Thu Jan 12, 2012 9:58 pm Post subject: |
|
|
lea eax,[eax+eax+eax*2] , are you sure?
maybe: lea eax,[eax+eax*2]
| Code: |
test eax,eax = cmp eax,0
JNGE (not 'greater or equal') = JL (less)
JNL (not less) = JGE (greater or equal)
lea eax,[eax+eax*2] = multiply eax by 3 |
So it would be (more or less) (pascal pseudo code):
| Code: |
index := arg1; ([esp+04])
value := arg2; ([esp+08])
start := ECX (where array/structure starts)
if index >= 0 and index <= 8 then
begin
index := index * 3;
array(start + index * 4 + 44) := value
// above two lines could be replaced with this:
// array(start + index * 12 + 44) := value
return 0;
end
else return -3; |
_________________
Last edited by mgr.inz.Player on Thu Jan 12, 2012 10:57 pm; edited 1 time in total |
|
| Back to top |
|
 |
happyreadygo Advanced Cheater
Reputation: 1
Joined: 14 Sep 2011 Posts: 87
|
Posted: Thu Jan 12, 2012 10:44 pm Post subject: |
|
|
| mgr.inz.Player wrote: | lea eax,[eax+eax+eax*2] , are you sure?
maybe: lea eax,[eax+eax*2]
|
I made a mistake.
I am really thank you. I ll try to understand and learn from your post.
|
|
| Back to top |
|
 |
|
|
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
|
|