aboutsummaryrefslogtreecommitdiff
path: root/bomblab/phase5.asm
diff options
context:
space:
mode:
authorov-4 <hausemasterstream@gmail.com>2026-01-20 14:31:20 +0000
committerov-4 <hausemasterstream@gmail.com>2026-01-20 14:31:20 +0000
commit9d4a7d1c07d3ce894c7ed3454ab73d31a0334d83 (patch)
tree73306c4be8cc5145c9d4f4bba04aced55a881e47 /bomblab/phase5.asm
parentaacbd334c3204f4abc5921a7e6a2bea485b1f371 (diff)
Updated solution
Diffstat (limited to 'bomblab/phase5.asm')
-rw-r--r--bomblab/phase5.asm29
1 files changed, 29 insertions, 0 deletions
diff --git a/bomblab/phase5.asm b/bomblab/phase5.asm
new file mode 100644
index 0000000..a75397e
--- /dev/null
+++ b/bomblab/phase5.asm
@@ -0,0 +1,29 @@
+# OBJDUMP
+
+# phase_5(char* input)
+# %index = %rax
+# %input = %rdi
+
+# FOR loop, index = [0, 6)
+ 40108b: 0f b6 0c 03 movzbl (%rbx,%index,1),%ecx # rcx = *(input + index), get each input char
+ 40108f: 88 0c 24 mov %cl,(%rsp) # stacktop = rcx
+ 401092: 48 8b 14 24 mov (%rsp),%rdx # rdx = stacktop = rcx
+ 401096: 83 e2 0f and $0xf,%edx # rdx = stacktop & 0xF
+ 401099: 0f b6 92 b0 24 40 00 movzbl 0x4024b0(%rdx),%edx # rdx = *(0x4024b0 + rdx), get lower 4 bits
+
+ # rdx = *[*(input+index) & 0xF + 0x4024b0]
+ # find 0x4024b0 + bias
+
+ 4010a0: 88 54 04 10 mov %dl,0x10(%rsp,%index,1) # *(rsp+index+10) = rdx (the correspoding data)
+ 4010a4: 48 83 c0 01 add $0x1,%index # index++
+ 4010a8: 48 83 f8 06 cmp $0x6,%index # if (index == 6) break
+ 4010ac: 75 dd jne 40108b <phase_5+0x29>
+ # rsp+(10 to 15) are where passwords are saved, on stack
+
+
+ 4010ae: c6 44 24 16 00 movb $0x0,0x16(%rsp) # \0
+ 4010b3: be 5e 24 40 00 mov $0x40245e,%esi
+ 4010b8: 48 8d 7c 24 10 lea 0x10(%rsp),%rdi # compare (coded input) against ($0x40245e)
+ 4010bd: e8 76 02 00 00 call 401338 <strings_not_equal>
+ 4010c2: 85 c0 test %index,%index
+ 4010c4: 74 13 je 4010d9 <phase_5+0x77>