This code is from the picoCTF 2018:
asm3:
push ebp
mov ebp,esp
mov eax,0xbc
xor al,al
mov ah,BYTE PTR [ebp+0x9]
sal ax,0x10
sub al,BYTE PTR [ebp+0xc]
add ah,BYTE PTR [ebp+0xd]
xor ax,WORD PTR [ebp+0x10]
mov esp, ebp
pop ebp
ret
I'm quite new at solving CTF's, but I'm progressing. But one thing frustrates me. At this CTF 3 inputs were given. But by my logic. There's 4 (I don't ask for hints for CTF, because I've already solved it by using this as asm function and supplying inputs) But by my logic this should work like:
Enter 4 inputs: *User Entered 3*
Error. 4th input not found
But in fact... It gives the right answer. Not an error. In my point of view inputs are:
1) BYTE PTR [ebp+0x9]
2) BYTE PTR [ebp+0xc]
3) BYTE PTR [ebp+0xd]
4) WORD PTR [ebp+0x10]
If someone can... Please tell me, how to figure out, which pointer is input and which is not.