AnswerBun.com

Need help to understand this assembly for fibonacci seq

Reverse Engineering Asked by Neon_lights on December 11, 2020

I understand the assembly properly. I am just confused about variable ‘b’ and ‘c’. It looks like b is stored at 12(%ebp). I conclude this from cmp 12(%ebp), %eax. If you look at func_8048516, it is adding -0x4(%ebp) which is ‘i’ and 12(%ebp) which is b. It should translate into a=b+i in the source code but it’s a=c+i. Can anyone explain this?

Assembly code

Source code

One Answer

compiling this code in godbolt.org the c code assembles to mov 16(%ebp),%edx

which is variable c not b as in your screenshot

enter image description here

Correct answer by blabb on December 11, 2020

Add your own answers!

Related Questions

Reverse Engineering an 8 bit CRC

0  Asked on February 18, 2021 by user33842

         

Reverse engineering a checksum algorithm

2  Asked on February 14, 2021 by user2390115

     

how to change app name and package name of an apk?

0  Asked on February 12, 2021 by bahaddou-mohammed

   

What are my options to add instructions to a binary?

3  Asked on February 10, 2021 by jjmcc

 

What is physical address on a pe reader?

1  Asked on February 10, 2021 by loliconaoquadrado

         

.NET – What kind of obfuscation is this?

0  Asked on February 10, 2021 by diogo-machado

       

Edit unknown binary file

1  Asked on February 9, 2021

   

Ollydbg skippingover breakpoint

0  Asked on February 6, 2021 by user35207

     

BRANCH OCCURS in IDApro

2  Asked on February 6, 2021

     

Catch connection string between exe and mdb

1  Asked on February 4, 2021 by keystone

       

Hex-Ray Decompiler: inline function not recognized

1  Asked on January 31, 2021 by mentulatus

     

Is this executable packed, encrypted or what?

0  Asked on January 31, 2021 by dadi590

     

Debug dll file used in python script IDA

0  Asked on January 29, 2021 by dl11

     

Analyze stack with IDAPython

1  Asked on January 27, 2021 by func

       

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir