兩種方法讀取pe檔案的oep值:一是 直接讀取檔案,二是 通過記憶體對映。
#include "stdafx.h"
#include
//-------------------------------
//read the file of .exe get the oep (original entry point)
//-------------------------------
bool readopebyfile(lpcstr szfilename)
dword dwoep,cbread;
image_dos_header dos_head[sizeof(image_dos_header)];
if (!readfile(hfile,dos_head,sizeof(image_dos_header),&cbread,null))
int nentrypos = dos_head->e_lfanew+40;
setfilepointer(hfile,nentrypos,null,file_begin);
if (!readfile(hfile,&dwoep,sizeof(dwoep),&cbread,null))
bool readoepbymemory(lpcstr szfilename)
*header;
image_dos_header *dos_head = (image_dos_header *)basepointer;
header = (pe_header_map *)((char *)dos_head+dos_head->e_lfanew);
dword dwoep = header->opt_head.addressofentrypoint;
printf("oep by memory :%d/n",dwoep);
return true;
}int main(int argc, char* argv)
獲取iphone的IP位址原始碼
定義了幾個方法,獲取iphone的ip位址。ipadress.h ipaddress.c nsstring localip property nonatomic,retain nsstring localip nsstring deviceipadress end self.localip self...
Ubuntu獲取命令原始碼的方法
首先要知道ls是屬於哪個包的,可以通過下面命令 dpkg s command name 通用格式 dpkg s bin ls得到如下結果 coreutils bin ls注意這裡要把ls的所在路徑全寫出來,直接用ls的話,會輸出很多無關內容的。如果不知道命令所在的目錄,可以用下面命令檢視 which...
servlet api原始碼的獲取以及打包
使用ant打包servlet api原始碼 2010 年 01 月 27 日 本文單主要簡述了獲取編譯打包servlet api源 的過程。所用到的ant指令碼需要根據實際場景做簡單的調整即可。基本步驟 3 ant指令碼,這段指令碼是改的人家原始碼裡的那份build.xml。因為我們只需要取得原始碼...