http://code.google.com/p/pework/
pe header를 파싱할 때 편하게 사용할 수 있습니다.
만든지는 오래 됐는데 이제야 공개하네요
themida api redirection 복구툴을 공개하려고 코드를 정리하다가 이걸 먼저 해야 할 것 같아서.. ㅎㅎ
lib 형태로 두시고 static linking 하며 쓰면 편합니다.
내일은 api redirection 복구툴을 공개할 예정...
pework pe;
pe.Open( "c:\\windows\\system32\\calc.exe" );
printf( "entry point : 0x%08x\n", pe.GetNH()->OptionalHeader.AddressOfEntryPoint );
for( int i = 0; i < pe.GetNumberOfSections(); i ++ )
{
printf( "section %d [%s] : %08x ~ %08x\n",
i + 1,
pe.GetSH(i)->Name,
pe.GetImageBase() + pe.GetSH(i)->VirtualAddress,
pe.GetImageBase() + pe.GetSH(i)->VirtualAddress + pe.GetSH(i)->Misc.VirtualSize );
}
----
section 1 [.text] : 01001000 ~ 010136b0
section 2 [.data] : 01014000 ~ 0101501c
section 3 [.rsrc] : 01016000 ~ 0101e960