I have a trouble solving this bomb (assembler code). I want to know what func6 d
ID: 3732592 • Letter: I
Question
I have a trouble solving this bomb (assembler code).
I want to know what func6 does (0x08048efe <+70>). I tried typing calling func6, and gdb returns text variable, no debug info. What does this mean?
Is there any way of figuring out what func6 does?
I know return value is generally stored in eax after calling function, but in this case, a bomb will be exploded if I set breakpoint right after calling func6, so I cannot figure out any.
Also, it would be much more helpful If you explain what this assembler code does.
0x08048eb8 <+0>: sub $0x1c,%esp
0x08048ebb <+3>: mov %gs:0x14,%eax
0x08048ec1 <+9>: mov %eax,0xc(%esp)
0x08048ec5 <+13>: xor %eax,%eax
0x08048ec7 <+15>: lea 0x8(%esp),%eax
0x08048ecb <+19>: push %eax
0x08048ecc <+20>: lea 0x8(%esp),%eax
0x08048ed0 <+24>: push %eax
0x08048ed1 <+25>: push $0x804a601
0x08048ed6 <+30>: pushl 0x2c(%esp)
0x08048eda <+34>: call 0x80488b0 <__isoc99_sscanf@plt>
0x08048edf <+39>: add $0x10,%esp
0x08048ee2 <+42>: cmp $0x2,%eax
0x08048ee5 <+45>: jne 0x8048eee <phase_6+54>
0x08048ee7 <+47>: cmpl $0xe,0x4(%esp)
0x08048eec <+52>: jbe 0x8048ef3 <phase_6+59>
0x08048eee <+54>: call 0x8049495 <explode_bomb>
0x08048ef3 <+59>: sub $0x4,%esp
0x08048ef6 <+62>: push $0xe
0x08048ef8 <+64>: push $0x0
0x08048efa <+66>: pushl 0x10(%esp)
0x08048efe <+70>: call 0x8048e5f <func6>
0x08048f03 <+75>: add $0x10,%esp
0x08048f06 <+78>: cmp $0xd,%eax
0x08048f09 <+81>: jne 0x8048f12 <phase_6+90>
0x08048f0b <+83>: cmpl $0xd,0x8(%esp)
0x08048f10 <+88>: je 0x8048f17 <phase_6+95>
0x08048f12 <+90>: call 0x8049495 <explode_bomb>
0x08048f17 <+95>: mov 0xc(%esp),%eax
0x08048f1b <+99>: xor %gs:0x14,%eax
0x08048f22 <+106>: je 0x8048f29 <phase_6+113>
0x08048f24 <+108>: call 0x8048800 <__stack_chk_fail@plt>
0x08048f29 <+113>: add $0x1c,%esp
0x08048f2c <+116>: ret
Explanation / Answer
No, we can't say from the given code about what func6 does. Because func6 is called whose address is 0x8048e5f.And,in the given question ; the code in this 0x8048e5f address is not given.
So,in order to know the code i.e what happening in the func6 you need to research code at 0x8048e5f address.There is no debug information and only printing text variable i.e all the debug information is going into stack and print function is executing due to which you are getting such output
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.