Question
Can someone explain what the following assembly code does? There are 2 numbers that should make the code work, and the goal is to find
Can someone explain what the following assembly code does?
There are 2 numbers that should make the code work, and the goal is to find the numbers.
I am completely lost and at this point desperate.
=> 0x00005555555551d8 <+0>: sub $0x18,%rsp 0x00005555555551dc <+4>: lea 0x7(%rsp),%rcx 0x00005555555551e1 <+9>: lea 0xc(%rsp),%rdx 0x00005555555551e6 <+14>: lea 0x8(%rsp),%r8 0x00005555555551eb <+19>: lea 0x170c(%rip),%rsi # 0x5555555568fe 0x00005555555551f2 <+26>: mov $0x0,%eax 0x00005555555551f7 <+31>: callq 0x555555554e60 <__isoc99_sscanf@plt> 0x00005555555551fc <+36>: cmp $0x2,%eax 0x00005555555551ff <+39>: jle 0x555555555220 0x0000555555555201 <+41>: cmpl $0x7,0xc(%rsp) 0x0000555555555206 <+46>: ja 0x555555555311 0x000055555555520c <+52>: mov 0xc(%rsp),%eax 0x0000555555555210 <+56>: lea 0x1709(%rip),%rdx # 0x555555556920 0x0000555555555217 <+63>: movslq (%rdx,%rax,4),%rax 0x000055555555521b <+67>: add %rdx,%rax 0x000055555555521e <+70>: jmpq *%rax 0x0000555555555220 <+72>: callq 0x5555555558b7 0x0000555555555225 <+77>: jmp 0x555555555201 0x0000555555555227 <+79>: mov $0x70,%eax 0x000055555555522c <+84>: cmpl $0x1ee,0x8(%rsp) 0x0000555555555234 <+92>: je 0x55555555531b 0x000055555555523a <+98>: callq 0x5555555558b7 0x000055555555523f <+103>: mov $0x70,%eax 0x0000555555555244 <+108>: jmpq 0x55555555531b 0x0000555555555249 <+113>: mov $0x63,%eax 0x000055555555524e <+118>: cmpl $0x18c,0x8(%rsp) 0x0000555555555256 <+126>: je 0x55555555531b 0x000055555555525c <+132>: callq 0x5555555558b7 0x0000555555555261 <+137>: mov $0x63,%eax 0x0000555555555266 <+142>: jmpq 0x55555555531b 0x000055555555526b <+147>: mov $0x77,%eax 0x0000555555555270 <+152>: cmpl $0x2f0,0x8(%rsp) 0x0000555555555278 <+160>: je 0x55555555531b 0x000055555555527e <+166>: callq 0x5555555558b7 0x0000555555555283 <+171>: mov $0x77,%eax 0x0000555555555288 <+176>: jmpq 0x55555555531b 0x000055555555528d <+181>: mov $0x76,%eax 0x0000555555555292 <+186>: cmpl $0x26a,0x8(%rsp) 0x000055555555529a <+194>: je 0x55555555531b 0x000055555555529c <+196>: callq 0x5555555558b7 0x00005555555552a1 <+201>: mov $0x76,%eax --Type for more, q to quit, c to continue without paging--C 0x00005555555552a6 <+206>: jmp 0x55555555531b 0x00005555555552a8 <+208>: mov $0x62,%eax 0x00005555555552ad <+213>: cmpl $0x15b,0x8(%rsp) 0x00005555555552b5 <+221>: je 0x55555555531b 0x00005555555552b7 <+223>: callq 0x5555555558b7 0x00005555555552bc <+228>: mov $0x62,%eax 0x00005555555552c1 <+233>: jmp 0x55555555531b 0x00005555555552c3 <+235>: mov $0x72,%eax 0x00005555555552c8 <+240>: cmpl $0x42,0x8(%rsp) 0x00005555555552cd <+245>: je 0x55555555531b 0x00005555555552cf <+247>: callq 0x5555555558b7 0x00005555555552d4 <+252>: mov $0x72,%eax 0x00005555555552d9 <+257>: jmp 0x55555555531b 0x00005555555552db <+259>: mov $0x79,%eax 0x00005555555552e0 <+264>: cmpl $0x313,0x8(%rsp) 0x00005555555552e8 <+272>: je 0x55555555531b 0x00005555555552ea <+274>: callq 0x5555555558b7 0x00005555555552ef <+279>: mov $0x79,%eax 0x00005555555552f4 <+284>: jmp 0x55555555531b 0x00005555555552f6 <+286>: mov $0x71,%eax 0x00005555555552fb <+291>: cmpl $0x2cb,0x8(%rsp) 0x0000555555555303 <+299>: je 0x55555555531b 0x0000555555555305 <+301>: callq 0x5555555558b7 0x000055555555530a <+306>: mov $0x71,%eax 0x000055555555530f <+311>: jmp 0x55555555531b 0x0000555555555311 <+313>: callq 0x5555555558b7 0x0000555555555316 <+318>: mov $0x72,%eax 0x000055555555531b <+323>: cmp %al,0x7(%rsp) 0x000055555555531f <+327>: je 0x555555555326 0x0000555555555321 <+329>: callq 0x5555555558b7 0x0000555555555326 <+334>: add $0x18,%rsp 0x000055555555532a <+338>: retq
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started