Assembly HW help, Assembly Language

I was wondering if you guys could offer me some advice and help on how to proceed - not answers- for a homework problem I am attempting. I am currently working on a "bomb" project in which I progress through stages by discovering passwords or phrases using the gdb debugger to analyze assembly code. I was able to easily complete stages 1-3, but am having a bit of trouble with stage 4. Here is the assembly for this stage:

0x08048d6d <+0>: sub $0x2c,%esp
0x08048d70 <+3>: lea 0x1c(%esp),%eax
0x08048d74 <+7>: mov %eax,0xc(%esp)
0x08048d78 <+11>: lea 0x18(%esp),%eax
0x08048d7c <+15>: mov %eax,0x8(%esp)
0x08048d80 <+19>: movl $0x804a5d1,0x4(%esp) ;%d, %d
0x08048d88 <+27>: mov 0x30(%esp),%eax
0x08048d8c <+31>: mov %eax,(%esp)
0x08048d8f <+34>: call 0x8048850 <__isoc99_sscanf@plt>
0x08048d94 <+39>: cmp $0x2,%eax
0x08048d97 <+42>: jne 0x8048da5
0x08048d99 <+44>: mov 0x1c(%esp),%eax
0x08048d9d <+48>: sub $0x2,%eax
0x08048da0 <+51>: cmp $0x2,%eax
0x08048da3 <+54>: jbe 0x8048daa
0x08048da5 <+56>: call 0x80492f5
0x08048daa <+61>: mov 0x1c(%esp),%eax
0x08048dae <+65>: mov %eax,0x4(%esp)
0x08048db2 <+69>: movl $0x8,(%esp)
0x08048db9 <+76>: call 0x8048d23
0x08048dbe <+81>: cmp 0x18(%esp),%eax
0x08048dc2 <+85>: je 0x8048dc9
0x08048dc4 <+87>: call 0x80492f5
0x08048dc9 <+92>: add $0x2c,%esp
0x08048dcc <+95>: ret
From what I have looked at so far, it looks like this phase accepts two decimals (line 19), the second one must be less than or equal to 4, but greater than 1 (lines 48, 51, 54). Another important aspect to this problem is the inclusion of a recursive "func4" which is as follows:

0x08048d23 <+0>: push %edi
0x08048d24 <+1>: push %esi
0x08048d25 <+2>: push %ebx
0x08048d26 <+3>: sub $0x10,%esp
0x08048d29 <+6>: mov 0x20(%esp),%ebx
0x08048d2d <+10>: mov 0x24(%esp),%esi
0x08048d31 <+14>: test %ebx,%ebx
0x08048d33 <+16>: jle 0x8048d61
0x08048d35 <+18>: mov %esi,%eax
0x08048d37 <+20>: cmp $0x1,%ebx
0x08048d3a <+23>: je 0x8048d66
0x08048d3c <+25>: mov %esi,0x4(%esp)
0x08048d40 <+29>: lea -0x1(%ebx),%eax
0x08048d43 <+32>: mov %eax,(%esp)
0x08048d46 <+35>: call 0x8048d23
0x08048d4b <+40>: lea (%eax,%esi,1),%edi
0x08048d4e <+43>: mov %esi,0x4(%esp)
0x08048d52 <+47>: sub $0x2,%ebx
0x08048d55 <+50>: mov %ebx,(%esp)
0x08048d58 <+53>: call 0x8048d23
0x08048d5d <+58>: add %edi,%eax
0x08048d5f <+60>: jmp 0x8048d66
0x08048d61 <+62>: mov $0x0,%eax
0x08048d66 <+67>: add $0x10,%esp
0x08048d69 <+70>: pop %ebx
0x08048d6a <+71>: pop %esi
0x08048d6b <+72>: pop %edi
0x08048d6c <+73>: ret
This function is where I am having the most trouble...I am totally clueless as to what it does. All I think I know is that it accepts my second input value as an argument, alters in some way and finally compares it to the value 0x18(%esp) (line 81 in the first section)

The project is not due until later this week, but I would really rather have a better understanding of this material asap as right now I am a little lost.Thank you guys for your time.
Posted Date: 2/10/2014 10:14:20 PM | Location : United States

Related Discussions:- Assembly HW help, Assignment Help, Ask Question on Assembly HW help, Get Answer, Expert's Help, Assembly HW help Discussions

Write discussion on Assembly HW help
Your posts are moderated
Related Questions
Write a MIPS/SPIM assembly language program that prints the smallest and largest values found in a non-empty table of N word-sized integers. The address of the first entry in your

what is the hex value in ax after executing the instructions ax= 1E8A bx=4080 add al,bl sub ah,bh

The definitions of the bits in ICWI are following: Always set to the value 1. It directs the received byte to ICWI as oppose to OCW2 or OCW3. Which also utilize the even addr

Write a program on the assembly language to do the following: 1- Allocate array with 32bit 100 element 2- Prompt the user to enter the maximum or the upper bound of the rando

As an instance of the normal priority mode, imagine that initially AEOI is equal to 0 and all the ISR and IMR bits are clear. Also consider that, as shown in given figure, requests

Why is the capability to relocate processes desirable?

Could I get an estimate on how much it would cost to write a program in assembly language?

How is bob different from johnny in the outsiders

Assume that the registers are initialized to EAX=12345h,EBX =9528h ECX=1275h,EDX=3001h sub AH,AH sub DH,DH mov DL,AL mov CL,3 shl DX,CL shl AX,1 add DX,AX