Skip to content

Instantly share code, notes, and snippets.

@bdw
Created May 20, 2018 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdw/897e70ad4b95ef00d61c9b237f27519d to your computer and use it in GitHub Desktop.
Save bdw/897e70ad4b95ef00d61c9b237f27519d to your computer and use it in GitHub Desktop.
broken-label.asm
;; we jump inbetween this and the next, and so corrupt our stack and our frame
505a: 4c 8b 5b 58 mov r11,QWORD PTR [rbx+0x58]
505e: 48 8b 53 60 mov rdx,QWORD PTR [rbx+0x60]
5062: 48 89 93 e8 02 00 00 mov QWORD PTR [rbx+0x2e8],rdx
5069: 48 c7 c2 04 00 00 00 mov rdx,0x4
5070: 48 8b 8b d8 02 00 00 mov rcx,QWORD PTR [rbx+0x2d8]
5077: 4c 89 5c 24 20 mov QWORD PTR [rsp+0x20],r11
507c: 48 89 54 24 30 mov QWORD PTR [rsp+0x30],rdx
5081: 4c 89 c0 mov rax,r8
5084: 4c 89 ca mov rdx,r9
5087: 49 89 c8 mov r8,rcx
508a: 4d 89 d1 mov r9,r10
508d: 4c 89 f1 mov rcx,r14
5090: 4c 8b 93 e8 02 00 00 mov r10,QWORD PTR [rbx+0x2e8]
5097: 4c 89 54 24 28 mov QWORD PTR [rsp+0x28],r10
;; rax is 1, at this point; compes from r8
509c: ff 90 98 00 00 00 call QWORD PTR [rax+0x98]
50a2: 4c 89 f1 mov rcx,r14
50a5: 48 8b 93 d8 02 00 00 mov rdx,QWORD PTR [rbx+0x2d8]
50ac: ff 15 ff 41 00 00 call QWORD PTR [rip+0x41ff] # 0x92b1
50b2: 48 c7 c1 01 00 00 00 mov rcx,0x1
50b9: 4c 0f bf c1 movsx r8,cx
50bd: 4c 8b 8b e8 02 00 00 mov r9,QWORD PTR [rbx+0x2e8]
50c4: 4d 89 ca mov r10,r9
50c7: 4d 01 c2 add r10,r8
50ca: 4c 89 93 80 01 00 00 mov QWORD PTR [rbx+0x180],r10
50d1: 4c 89 53 60 mov QWORD PTR [rbx+0x60],r10
50d5: eb 81 jmp 0x5058
;; this isn't actually a label, maybe make jit-comparify-asm.pl warn? (it can't :-()
;; broken according to the
50d7: 48 c7 c1 00 00 00 00 mov rcx,0x0
50de: 48 89 8b 80 01 00 00 mov QWORD PTR [rbx+0x180],rcx
50e5: 48 8b 53 10 mov rdx,QWORD PTR [rbx+0x10]
50e9: 48 89 93 d8 02 00 00 mov QWORD PTR [rbx+0x2d8],rdx
50f0: 48 8b 93 d8 02 00 00 mov rdx,QWORD PTR [rbx+0x2d8]
50f7: 4c 8b 42 10 mov r8,QWORD PTR [rdx+0x10]
50fb: 4d 8b 48 10 mov r9,QWORD PTR [r8+0x10]
50ff: 48 8b 93 d8 02 00 00 mov rdx,QWORD PTR [rbx+0x2d8]
5106: 4c 8b 52 10 mov r10,QWORD PTR [rdx+0x10]
510a: 48 8b 93 d8 02 00 00 mov rdx,QWORD PTR [rbx+0x2d8]
5111: 4c 8d 5a 18 lea r11,[rdx+0x18]
5115: 4c 8b 43 58 mov r8,QWORD PTR [rbx+0x58]
5119: 48 c7 c2 04 00 00 00 mov rdx,0x4
5120: 4c 89 44 24 20 mov QWORD PTR [rsp+0x20],r8
5125: 48 89 4c 24 28 mov QWORD PTR [rsp+0x28],rcx
512a: 48 89 54 24 30 mov QWORD PTR [rsp+0x30],rdx
512f: 4c 89 c8 mov rax,r9
5132: 4c 89 f1 mov rcx,r14
5135: 4c 89 d2 mov rdx,r10
5138: 4d 89 d9 mov r9,r11
513b: 4c 8b 83 d8 02 00 00 mov r8,QWORD PTR [rbx+0x2d8]
5142: ff 90 98 00 00 00 call QWORD PTR [rax+0x98]
5148: 4c 89 f1 mov rcx,r14
514b: 48 8b 93 d8 02 00 00 mov rdx,QWORD PTR [rbx+0x2d8]
5152: ff 15 61 41 00 00 call QWORD PTR [rip+0x4161] # 0x92b9
;; here is where we should go
5158: 48 c7 83 98 01 00 00 mov QWORD PTR [rbx+0x198],0x1
515f: 01 00 00 00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment