Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Working on a binary bomb lab. I'm new to assembly language, so I'm having some trouble understanding. I diffused phase 1 and I'm now on

Working on a binary bomb lab. I'm new to assembly language, so I'm having some trouble understanding. I diffused phase 1 and I'm now on phase 2. I understand that the answer is 6 numbers in the format: a b c d e f. I think the first number is 0 because the first compare statement compares (%rsp) to 0x0. I don't understand what to do next. image text in transcribed

Here's what read_six_numbers does

image text in transcribed

(gdb) disas Dump of assembler code for function phase_2: -> 0x0000000000400efc : push %rbp push %rbx sub $0x28,%rsp mov callq 0x40156a $0x0,(Xrsp) ne cmpl $0x1,0x4(%rsp) 0x0000000000400efd 0x0000000000400efe : 0x0000000000400f02 : 0x0000000000400f05 : 0x0000000000400f0a : 0x0000000000400f0e : 0x0000000000400f10 : 0x0000000000400f15 : 0x0000000000400f17 : 0x0000000000400f1c 0x0000000000400f1e : 0x0000000000400f21 : 0x8000000000400f24 : 0x0000000000400f26 : 0x0000000000400f28 : 0x0000000000400f2d : 0x0000000000400f31 : 0x0000000000400f34 : 0x0000000000400f36 : 0x0000000000400f38 : 0x0000000000400f3d : 0x0000000000400f42 : 0x0000000000400f44 : 0x0000000000400f48 : 0x0000000000400f49 : 0x0000000000400f4a : 0x400f17 0x400f38 0x401534 0x400f38 callq j mp mov add 0x8(XrDX ) ,%eax -0x4(Xrbs ) ,%eax %eax,(XrDX ) 0x400f2d callq 0x401534 add $0x4,%rbx cmp %rbp , %rbx ne 0x400f1e 0x400f44 lea add pop 0x18 (%rsp ) ,%rbp 0x400f1e $0x28,%rsp %rbp retq End of assembler dump 000000000040156a : 48 83 ec 18 48 89 f2 48 8d 4e 04 48 8d 46 14 48 89 44 24 08 48 8d 46 10 48 89 04 24 4c 8d 4e 0c 4C 8d 46 08 be 71 27 40 00 b8 00 00 00 00 e8 73 f6 ff ff 83 f8 05 7f 05 e8 8d ff ff ff 48 83 c4 18 sub $0x18,%rsp mov lea0x4(%rsi),%rc>x Tea 0x14 ( %rsi),%rax mov %rax,0x8(%rsp) Tea 0x10 ( %rsi),%rax mov %rax,(%rsp) 40156a 40156e 401571: 401575: 401579: 40157e 401582: 401586: 40158a: 40158e: 401593: 401598: 40159d: 4015a0: 4015a2: 4015a7: 4015ab: lea0x8(%rsi),%r8 mov $0x402771,%esi mov $0x0,%eax callq 400c10 <__isoc99 sscanfoplt> cmp $0x5,%eax callq add retq 4015a7 401534 $0x18,%rsp (gdb) disas Dump of assembler code for function phase_2: -> 0x0000000000400efc : push %rbp push %rbx sub $0x28,%rsp mov callq 0x40156a $0x0,(Xrsp) ne cmpl $0x1,0x4(%rsp) 0x0000000000400efd 0x0000000000400efe : 0x0000000000400f02 : 0x0000000000400f05 : 0x0000000000400f0a : 0x0000000000400f0e : 0x0000000000400f10 : 0x0000000000400f15 : 0x0000000000400f17 : 0x0000000000400f1c 0x0000000000400f1e : 0x0000000000400f21 : 0x8000000000400f24 : 0x0000000000400f26 : 0x0000000000400f28 : 0x0000000000400f2d : 0x0000000000400f31 : 0x0000000000400f34 : 0x0000000000400f36 : 0x0000000000400f38 : 0x0000000000400f3d : 0x0000000000400f42 : 0x0000000000400f44 : 0x0000000000400f48 : 0x0000000000400f49 : 0x0000000000400f4a : 0x400f17 0x400f38 0x401534 0x400f38 callq j mp mov add 0x8(XrDX ) ,%eax -0x4(Xrbs ) ,%eax %eax,(XrDX ) 0x400f2d callq 0x401534 add $0x4,%rbx cmp %rbp , %rbx ne 0x400f1e 0x400f44 lea add pop 0x18 (%rsp ) ,%rbp 0x400f1e $0x28,%rsp %rbp retq End of assembler dump 000000000040156a : 48 83 ec 18 48 89 f2 48 8d 4e 04 48 8d 46 14 48 89 44 24 08 48 8d 46 10 48 89 04 24 4c 8d 4e 0c 4C 8d 46 08 be 71 27 40 00 b8 00 00 00 00 e8 73 f6 ff ff 83 f8 05 7f 05 e8 8d ff ff ff 48 83 c4 18 sub $0x18,%rsp mov lea0x4(%rsi),%rc>x Tea 0x14 ( %rsi),%rax mov %rax,0x8(%rsp) Tea 0x10 ( %rsi),%rax mov %rax,(%rsp) 40156a 40156e 401571: 401575: 401579: 40157e 401582: 401586: 40158a: 40158e: 401593: 401598: 40159d: 4015a0: 4015a2: 4015a7: 4015ab: lea0x8(%rsi),%r8 mov $0x402771,%esi mov $0x0,%eax callq 400c10 <__isoc99 sscanfoplt> cmp $0x5,%eax callq add retq 4015a7 401534 $0x18,%rsp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

b. Where did they come from?

Answered: 1 week ago