//-------------------------------------------------------------------------- uint32 win32_debmod_t::calc_imagesize(ea_t ea) { if ( _GetModuleInformation ) { HMODULE hMod; if ( ea == 0 ) { hMod = 0; } else { modbase_to_entry_t mbh = {ea, }; int code = for_each_module(pid, &get_module_by_base, &mbh); if ( code == 1 ) hMod = mbh.me.hModule; else hMod = (HMODULE)ea; // last resort } MODULEINFO mi; if ( _GetModuleInformation(process_handle, hMod, &mi, sizeof(mi)) ) return mi.SizeOfImage; } wince_module_t wm; if ( find_module(ea, &wm) ) return get_e32(&wm).vsize; return 0; }
static int do_lsmod(struct command *cmdtp, int argc, char *argv[]) { struct module *mod; for_each_module(mod) printf("%s\n", mod->name); return 0; }