From 5e7c7ff277efb46542ac1c7815a5961ee7e26313 Mon Sep 17 00:00:00 2001 From: bfu4 Date: Tue, 22 Mar 2022 17:59:47 -0400 Subject: [PATCH] (update): dockerfile, cheatsheet --- Dockerfile | 1 - docs/commands.txt | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 32bb38d..525b007 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,6 @@ RUN mkdir /lab RUN bash -c "chmod +rwx /lab" COPY bof.elf /lab/bof.elf -COPY bof.s /lab/bof.s RUN apt update RUN DEBIAN_FRONTEND=noninteractive apt upgrade -y diff --git a/docs/commands.txt b/docs/commands.txt index 2d2d46f..b60a9ae 100644 --- a/docs/commands.txt +++ b/docs/commands.txt @@ -40,3 +40,51 @@ | | | from the current working | | | | directory) file. | +-------------------------------------------------------------------------------+ + += DEBUGGER COMMANDS (LLDB) + ++-------------------------------------------------------------------------------+ +| command | subcommand | modifier | argument | description | ++---------------|---------------|---------------|---------------|---------------+ +| break | set | -a |
| set a break- | +| | | | | point at an | +| | | | | address | ++---------------|---------------|---------------|---------------|---------------| +| run | | | | run the | +| | | | | program | ++---------------|---------------|---------------|---------------|---------------+ +| step | | | | step forward | ++---------------|---------------|---------------|---------------|---------------| +| disas | | | | disassemble | ++---------------|---------------|---------------|---------------|---------------| +| x/40xw | | | $ | display memory| +| | | | | of 40 "words" | +| | | | | in hex of a | +| | | | | register | ++-------------------------------------------------------------------------------+ + += X64 REGISTERS + ++-------------------------------------------------------------------------------+ +| name | description | subs | ++---------------|-----------------------------------------------|---------------+ +| rax | general purpose, typically return values here | eax,ax,al,ah | ++---------------|-----------------------------------------------|---------------+ +| rbx | base register | ebx,bx,bl,bh | ++---------------|-----------------------------------------------|---------------+ +| rcx | counter register, used in loops to count, etc | ecx,cx,cl,ch | ++---------------|-----------------------------------------------|---------------+ +| rdx | general purpose / data register | edx,dx,dl,dh | ++---------------|-----------------------------------------------|---------------+ +| rsi | source for data copies | esi,si,sl | ++---------------|-----------------------------------------------|---------------+ +| rdi | destination register | edi,di,dl | ++---------------|-----------------------------------------------|---------------+ +| rbp | base pointer, typically resets at frame | ebp,bp,bpl | ++---------------|-----------------------------------------------|---------------+ +| rsp | stack pointer (think: the stack) | esp,sp,spl | ++---------------|-----------------------------------------------|---------------+ +| r8-r15 | general purpose | r8d-r15d, | +| | | r8w-r15w, | +| | | r8b, r15b | ++-------------------------------------------------------------------------------+