Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pointers 如何使用推字bx更改堆栈?_Pointers_Assembly_Stack_Byte_Dword - Fatal编程技术网

Pointers 如何使用推字bx更改堆栈?

Pointers 如何使用推字bx更改堆栈?,pointers,assembly,stack,byte,dword,Pointers,Assembly,Stack,Byte,Dword,在x86程序集中,EAX是102=socketcall 这是我的问题。堆栈如何处理此代码: 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 像这样: +-~-~-~+ <--- ESP (Pointer - points to Arg Array) | 0000 | === Protoc

在x86程序集中,EAX是102=socketcall

这是我的问题。堆栈如何处理此代码:

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
像这样:

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

+-~-~-~~+任何调试器都可以告诉您,您不需要我们的帮助。我觉得这只是一个“A”或“B”的答案。在32位模式下,所有堆栈项都是32位宽的,所以当一个字节大小的寄存器被推送时,它会被零扩展到32位。@500 InternalServerError,这是错误的。字节寄存器不能是push/pop指令的操作数。如果使用16寄存器,则按原样推送它,而不进行任何扩展。不会自动转换为32位。但是,如果堆栈位于不均匀的地址上,可能会产生奇怪的副作用。@Devolus:
+-~-~-~+ <--- ESP (Pointer - points to Arg Array)
| 0000 | === Protocol: TCP
+-~-~-~+
| 0001 | === Type: SOCKET
+-~-~-~+
|  2   | === Connection: AF_INET
+-~-~-~+