准备研究一下vmp 保护,从一个最简单的Windows程序入手似乎是个不错的想法。
如何才最简单呢,仅仅有一个MessageBox 调用好了。
弹出消息。退出,哦也,够简单吧。
祭出法器VC2010。新建win32 项目,
#include "stdafx.h"
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
MessageBox(NULL, L"Smallest", L"smallest", MB_OK);
return 0;
}
Release 模式编译生成。OD调试跟踪之。
矮油,太臃肿了!
寻回失落的法器masm32。哇哦,都v11了。
找个simple example,瘦身。再瘦...
; ������������������������������������?
.486 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
include masm32includewindows.inc
include masm32includekernel32.inc
include masm32includeuser32.inc
includelib masm32libkernel32.lib
includelib masm32libuser32.lib
.const
szTitle db 'Smallest', 0
szMessage db 'smallest', 0
.code
; ������������������������������������?
start:
invoke MessageBox, NULL, addr szMessage, addr szTitle, MB_OK
invoke ExitProcess,eax
; ������������������������������������?
end start
好了,build all,恩。这才是最简单的Windows 程序吧,:-)