DeathPum
July 7th, 2011, 10:19
Hey guys, I'm creating a plugin and I wonder if there is any function/structure that returns the name of the current module which the user is working with in the disassembler window?
View Full Version : Getting the current module name from the disassembler window?
t_module* GetModuleBeingDisassembled()
{
t_dump *pCPUDASM = (t_dump*)Plugingetvalue(VAL_CPUDASM);
t_table *pModTable = (t_table*)Plugingetvalue(VAL_MODULES);
t_module *pModule = 0;
int i = 0;
while (i < pModTable->data.n)
{
if(!pModule)
pModule = (t_module*)pModTable->data.data;
else
{
// if module being currently debugged is found then returns it
if(pModule->codebase == pCPUDASM->base)
{
return pModule;
}
pModule++;
}
i++;
}
return NULL;
}