Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-27-2009, 05:57
Shub-Nigurrath's Avatar
Shub-Nigurrath Shub-Nigurrath is offline
VIP
 
Join Date: Mar 2004
Location: Obscure Kadath
Posts: 971
Rept. Given: 70
Rept. Rcvd 431 Times in 101 Posts
Thanks Given: 83
Thanks Rcvd at 405 Times in 127 Posts
Shub-Nigurrath Reputation: 400-499 Shub-Nigurrath Reputation: 400-499 Shub-Nigurrath Reputation: 400-499 Shub-Nigurrath Reputation: 400-499 Shub-Nigurrath Reputation: 400-499
nice hexrays thing

Hi all,
I was testing the newest leaked hexrays with this example:

Code:
int main(int argc, char* argv[])
{
  int firstvalue = 5;
  int *p1;
  p1 = &firstvalue;
  *p1 = 10;
  return 0;
}
which produces this simple assembler:

Code:
push    ebp
mov     ebp, esp
sub     esp, 8
mov     [ebp+var_4], 5
lea     eax, [ebp+var_4]
mov     [ebp+var_8], eax
mov     ecx, [ebp+var_8]
mov     dword ptr [ecx], 0Ah
xor     eax, eax
mov     esp, ebp
pop     ebp
retn
the strange is that if you try to decompile it with hexrays you get only this:

Code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
  return 0;
}
Even if it doesn't seem at first sight, the code is, by the logical point of view, exactly the same because the variables are local therefore lost, the stack is restored. This is imho a nice view of how powerful is this plugin even for this simple case.
__________________
Ŝħůb-Ňìĝùŕřaŧħ ₪)
There are only 10 types of people in the world: Those who understand binary, and those who don't
http://www.accessroot.com
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A nice challenge.... hobgoblin General Discussion 1 01-28-2006 11:00
What's this thing on the FTP? theCaller General Discussion 5 10-27-2005 21:10
Patching a morphed thing... KaGra General Discussion 4 07-03-2005 00:38
Nice! ManSun General Discussion 2 04-22-2004 16:12


All times are GMT +8. The time now is 02:02.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )