用于插入代码到可执行文件中需要的字节数
#include <Windows.h>
#include <stdio.h>
#include <iostream>
using std::cout;
using std::endl;
int main()
{
func_begin:
DWORD asm_len = 0;
DWORD func_len = 0;
_asm {
pushad
begin_code:
mov eax,offset end_code
mov esi,offset begin_code
sub eax,esi
mov asm_len,eax
popad
end_code :
}
_asm {
pushad
mov eax,offset func_begin
mov ebx, offset func_end
sub ebx,eax
mov func_len,ebx
popad
}
printf("asm_len:%d, func_len :%d\n", asm_len, func_len);
return 0;
func_end:
_asm{
nop
}
}