This is a multi part program where a 'challenge token' is generated and I have to provide a response that I believe needs to be in token form as well because when I enter it the parts in without spaces or a delimiter it fails. But I've also noticed that when even though strtok
is called, the registers that hold my response include the delimiter which is what I think is throwing this off when my string is compared with the code's strings. Am I supposed to find or use a certain delimiter?
Another question, In this portion rbp-0x50
is the counter as it cycles through this part 4 times. I'm not sure what sprintf
does, (Any insight?) Overall it seems to be generating the string which my response should mirror into rbp-0x30
. After this segment, the code goes on to show that whatever sprintf
puts into RAX
which ultimately ends up in qword [rbp-0x48]
should be the same as what was generated in [rbp-0x30]
.
Disassembly :
400cd4: mov eax, dword [rbp-0x50]
400cd7: movzx eax, byte [rbp+rax-0x40]
400cdc: movsx eax, al
400cdf: mov edx, dword [rbp-0x50]
400ce2: lea ecx, [rdx+rdx]
400ce5: lea rdx, [rbp-0x30]
400ce9: mov ecx, ecx
400ceb: add rcx, rdx
400cee: mov edx, eax
400cf0: mov esi, 0x40101a "%02X"
400cf5: mov rdi, rcx
400cf8: mov eax, 0x0
400cfd: call sprintf
400d02: add dword [rbp-0x50], 0x1
400d06: cmp dword [rbp-0x50], 0x4
400d0a: jbe 0x400cd4
400d0c: mov esi, 0x401018
400d11: mov edi, 0x0
400d16: call strtok
400d1b: mov qword [rbp-0x48], rax
400d1f: cmp qword [rbp-0x48], 0x0
400d24: jne 0x400d2d
sprintf
formats a string asprintf
would, but it does so silently and stores the result in the first argument, which in your case looks to be[rbp-0x30]
.