English 中文(简体)
地址的Dword 在可起诉的入境点中,储存
原标题:How to find offset of Dword where Address Of entry point of an executable is stored

There are disassemblers like CFF explorer which display the AddressOfEntryPoint of any executable along with the offset where it is stored. I know how to find that ( IMAGE_OPTIONAL_HEADER::AddressOfEntryPoint ), but I want to be able to find the offset in the PE exe file where the AddressOfEntryPoint is stored, programmatically.

页: 1

But still can t figure it out. Help needed

最佳回答

<<<><<><>>>>>>>>>>>>>>>>>>>>>>> 预设部分的大小:sizeof (IMAGE_DOS_HEADER)+sizeof(IMAGE_FILE_HEADER>+>sizeof(WORD)+/codesize(BY)>

问题回答

参看“JosephH”写道:更正>/em> 回答,但回答根本不正确,根本不正确。

要求出口加工公司将档案作为双亲文件(并非都需要所有档案)。

因此,假定你有<代码>未签名的果园*数据;,其中注明了双亲信息。

IMAGE_DOS_HEADER* dosHeader = (IMAGE_DOS_HEADER *)data;                       //cast it to DOS header (some calls it MZ header)
IMAGE_NT_HEADERS* peHeader = (IMAGE_NT_HEADERS *)&data[dosHeader->e_lfanew];  //find NT header (PE header)
DWORD ep = 0;
if (peHeader->Magic == 0x10b)  //32-bit executable
    ep = ((IMAGE_NT_HEADERS32 *)peHeader)->OptionalHeader.AddressOfEntryPoint;  //Get EP
else  //64-bit executable
    ep = ((IMAGE_NT_HEADERS64 *)peHeader)->OptionalHeader.AddressOfEntryPoint;  //Get EP

我认为,我的答案较好,因为作更自我解释,你也不能相信会抵消,因为结构会改变时间。 如你看见IMAGE_NT_HEADERS,我使用的是x86和x64机器的不同定义。





相关问题
马达加斯加 NET COM Interop至ATL EXE服务器

我想知道,如何在2008年视觉演播室“ATL EXE”服务器上添加(使用COM Interop设施(www.net)C# COM物体。 基本上,我试图摆脱进程......。

Creating portable (non-installing) windows applications in C#

I have a .net 3.5 application and i d like to make it portable. It s simple and runs perfectly, i ve sent the .EXE + .DLL s to some friends and it works as intended when running the exe with the .DLL ...

how to use java jar in c/c++?

i am a new developer of java swing. i want to pack the GUI program. With the help of neatbeans, i get a file of java jar. But i want to convert the jar to exe file, although i know exe4j, but i need ...

Run EXE from client side

I need run an exe file from client side. The Exe file exist in my C: Directory. I need run this exe file from my WEB site. How can I co this?

need help writing hexadecimals to an exe file

can somone tell me how to write these hexadecimals to an exe file while still having it exec 4D 5A 50 00 02 00 00 00 04 00 0F 00 FF FF 00 00 B8 00 00 00 00 00 00 00 40 00 1A 00 00 00 00 00 00 00 00 ...

Use SSL with Delphi yet still having a single exe

We use Indy and we need SSL eMail support in our app., however we need to have our application in a single .Exe. We know that the default Indy handler requires to have the dlls in the path. ...

热门标签