1
0
Fork 0

DBG: allow accessing the entry point of a module with "<module>:entry"

This commit is contained in:
Mr. eXoDia 2014-12-29 00:41:22 +01:00
parent ce2f140537
commit ed5fbad687
2 changed files with 10 additions and 2 deletions

View File

@ -64,6 +64,12 @@ you can write "[module]:$[rva]". If you want
to convert a file offset to a VA you can use "[module]:#[offset]". When "[module]" is
an empty string (":0" for example), the module that is currently selected in the CPU will
be used.</P>
<P class=rvps3><U>Module Entry Points</U>
: To
access a module entry point you can write "[module]:entry", "[module]:oep" or "[module]:ep". Notice that when
there are exports with the names "entry", "oep" or "ep" the address of these will be
returned instead.</P>
<P class=rvps3><U>labels/symbols</U>:
user-defined labels and symbols&nbsp;are a valid expressions.</P>
<P class=rvps3><STRONG>Input for arguments can always be done in any of

View File

@ -1213,8 +1213,10 @@ bool valapifromstring(const char* name, uint* value, int* value_size, bool print
uint addr = (uint)GetProcAddress(mod, apiname);
if(!addr) //not found
{
if(!_stricmp(apiname, "base") or !_stricmp(apiname, "imagebase") or !_stricmp(apiname, "header"))
if(scmp(apiname, "base") or scmp(apiname, "imagebase") or scmp(apiname, "header")) //get loaded base
addr = modbase;
else if(scmp(apiname, "entry") or scmp(apiname, "oep") or scmp(apiname, "ep")) //get entry point
addr = modbase + GetPE32DataW(szModName, 0, UE_OEP);
else if(*apiname == '$') //RVA
{
uint rva;
@ -1233,7 +1235,7 @@ bool valapifromstring(const char* name, uint* value, int* value_size, bool print
if(valfromstring(apiname, &ordinal))
{
addr = (uint)GetProcAddress(mod, (LPCSTR)(ordinal & 0xFFFF));
if(!addr and !ordinal)
if(!addr and !ordinal) //support for getting the image base using <modname>:0
addr = modbase;
}
}