Reverse Engineering RET Homepage RET Members Reverse Engineering Projects Reverse Engineering Papers Reversing Challenges Reverser Tools RET Re-Search Engine Reverse Engineering Forum Reverse Engineering Links

Go Back   Reverse Engineering Team Board > Reverse Engineering Board > Reverse Code Engineering
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 11-14-2010, 10:07 AM
maybnxtseasn maybnxtseasn is offline
Member
 
Join Date: Mar 2010
Posts: 11
Default Question about reversing this code

Code:
.text:004010A0 ; =============== S U B R O U T I N E =======================================
.text:004010A0
.text:004010A0
.text:004010A0 sub_4010A0      proc near               ; CODE XREF: _main+1Cp
.text:004010A0                                         ; _main:loc_4014ECp
.text:004010A0                 push    ebx
.text:004010A1                 push    esi
.text:004010A2                 push    edi
.text:004010A3                 push    offset Format   ; "\n\nTo Continue, press INSERT\n"
.text:004010A8                 call    ds:printf
.text:004010AE                 mov     ebx, ds:GetAsyncKeyState
.text:004010B4                 mov     edi, ds:Sleep
.text:004010BA                 add     esp, 4
.text:004010BD                 xor     esi, esi
.text:004010BF                 nop
.text:004010C0
.text:004010C0 loc_4010C0:                             ; CODE XREF: sub_4010A0+36j
.text:004010C0                 push    2Dh             ; vKey
.text:004010C2                 call    ebx ; GetAsyncKeyState
.text:004010C4                 test    al, 1
.text:004010C6                 jz      short loc_4010CD
.text:004010C8                 mov     esi, 1
.text:004010CD
.text:004010CD loc_4010CD:                             ; CODE XREF: sub_4010A0+26j
.text:004010CD                 push    0C8h            ; dwMilliseconds
.text:004010D2                 call    edi ; Sleep
.text:004010D4                 test    esi, esi
Code:
signed int __cdecl sub_4010A0()
{
  signed int v0; // esi@1

  printf("\n\nTo Continue, press INSERT\n");
  v0 = 0;
  do
  {
    if ( GetAsyncKeyState(45) & 1 )
      v0 = 1;
    Sleep(0xC8u);
  }
  while ( !v0 );
  return 1;
}

above is the psuedocode for the assembly code above it! im curious as to WHERE the unsigned int variable v0 is declared and initalized in the above assembly code! for some reason i cant seem to find it!! -thx
Reply With Quote
  #2  
Old 11-15-2010, 06:37 AM
Git Git is offline
Super Moderator
 
Join Date: Oct 2007
Location: Torino
Posts: 1,694
Default

> signed int v0; // esi@1

The comment tells you where the variable is stored. In this case it is a register variable in ESI

Git
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump





Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.