Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8. Reconstructing a Program with... > Reconstructing C/C++ Code: Part 2

8.3. Reconstructing C/C++ Code: Part 2

Now we group pseudo-code together with possible mixed C/C++ and assembly language equivalents:

[pa]  := address of a          ;  int a, b; int *pa, *pb;

[pb]  := address of b          ;  pa = &a; pb = &b;

eax   := [pa]                  ;  *pa = 1;
[eax] := 1

eax   := [pb]                  ;  *pb = 1;
[eax] := 1

eax   := [pb]                  ;  ecx = *pb;
ecx   := [eax]

edx   := [pa]                  ;  ecx = ecx + *pa;
ecx   := ecx + [edx]

eax   := [pb]                  ;  *pb = ecx;
[eax] := ecx

eax   := [pb]                  ;  ecx = *pb;
ecx   := [eax]

ecx   := ecx * 2               ;  ecx = ecx * 2;

edx   := [pb]                  ;  *pb = ecx;
[edx] := ecx


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial