How is the stack altered with PUSH WORD bx?

155 Views Asked by At

EAX is 102 = socketcall in x86 assembly.

Here's my question. How does the stack look after this code:

xor ebx, ebx
mov al, 102d
push ebx
mov bl, 1d
push ebx
push BYTE 2d ;right here specifically
mov ecx, esp
int 80h
mov edi eax

Like this:

+-~-~-~+ <--- ESP (Pointer - points to Arg Array)
| 0000 | === Protocol: TCP
+-~-~-~+
| 0001 | === Type: SOCKET
+-~-~-~+
| 0002 | === Connection: AF_INET
+-~-~-~+

Or like this:

+-~-~-~+ <--- ESP (Pointer - points to Arg Array)
| 0000 | === Protocol: TCP
+-~-~-~+
| 0001 | === Type: SOCKET
+-~-~-~+
|  2   | === Connection: AF_INET
+-~-~-~+

Basically, does it assumbe 4 bytes or does it just push one byte? Also, if I were to push another single byte, would it be pushed to a new 'box' or into the same 'box'?

0

There are 0 best solutions below