well you made me finish an unfinished project that's been breathing dust for 6 years now
i started this when someone asked a similar question somewhere else but never got to finish this
tested on ollyflow.dll only may have bugs use with caution and report back if you find this plugin erased your ollydbg directory 
use ctrl+n again to view modified import names
Code:
#include <windows.h>
#include <stdio.h>
#include "plugin.h"
HINSTANCE hinst;
HWND hwmain;
void ord2name(void) {
char buffer[0x10],label[TEXTLEN];
ulong importpointer,thunkpointer,address,seladdr;
t_module *dllwithord = NULL;
t_dump *dump = (t_dump *)Plugingetvalue(VAL_CPUDASM);
seladdr = dump->sel0;
dllwithord = Findmodule(seladdr);
for(address = dllwithord->codebase; address < dllwithord->codebase+dllwithord->codesize; address++)
{
Readmemory(buffer,address, 16, MM_SILENT|MM_RESTORE);
if ((*buffer == 0xFF) && (*(buffer+1) == 0x25))
{
memset(label,0,256);
importpointer = 0;
thunkpointer = 0;
Readmemory((void *)&importpointer, address+2, 4, MM_SILENT|MM_RESTORE);
if ((importpointer > dllwithord->codebase) && (importpointer < dllwithord->base+dllwithord->size))
{
Readmemory((void *)&thunkpointer, importpointer, 4, MM_SILENT|MM_RESTORE);
if (Findname(thunkpointer, NM_EXPORT, label) != 0)
{
Insertname(importpointer,NM_IMPORT,label);
}
}
}
}
Redrawdisassembler();
};
BOOL WINAPI DllMain( HINSTANCE hi, DWORD reason, LPVOID reserved )
{
UNREFERENCED_PARAMETER( reserved );
if (reason==DLL_PROCESS_ATTACH)
hinst=hi;
return 1;
};
extc int _export _cdecl ODBG_Plugininit( int ollydbgversion, HWND hw, ulong *features )
{
UNREFERENCED_PARAMETER( features );
if (ollydbgversion<PLUGIN_VERSION)
{
return -1;
}
Addtolist(0,0,"ollydbg 1.10 import ordinal to import name Plugin ord2name by blabberer");
hwmain=hw;
return 0;
};
extc int _export _cdecl ODBG_Plugindata( char shortname[32] )
{
strcpy_s( shortname, 30, "ord2name" );
return PLUGIN_VERSION;
};
extc int _export _cdecl ODBG_Pluginmenu( int origin, char data[4096], void *item )
{
UNREFERENCED_PARAMETER( item );
switch (origin)
{
case PM_MAIN:
strcpy_s( data, 4000, "0 &ord2name" );
return 1;
default:
break;
};
return 0;
};
extc void _export cdecl ODBG_Pluginaction(int origin,int action,void *item)
{
UNREFERENCED_PARAMETER( item );
if (origin==PM_MAIN)
{
switch (action)
{
case 0:
ord2name();
break;
default:
break;
};
};
};
attachement modified with latest correction
Code:
F:\plug110\test\ord2name>fc ord2name.cpp old_ord2name_odbg_plugin\ord2name.cpp
Comparing files ord2name.cpp and OLD_ORD2NAME_ODBG_PLUGIN\ORD2NAME.CPP
***** ord2name.cpp
void ord2name(void) {
char buffer[0x10],label[TEXTLEN],decode[TEXTLEN],comment[TEXTLEN];
ulong importpointer,thunkpointer,address,seladdr;
***** OLD_ORD2NAME_ODBG_PLUGIN\ORD2NAME.CPP
void ord2name(void) {
char buffer[0x10],label[TEXTLEN];
ulong importpointer,thunkpointer,address,seladdr;
*****
***** ord2name.cpp
{
Decodeaddress(thunkpointer,seladdr,ADC_DIFFMOD,decode,
TEXTLEN,comment);
Insertname(importpointer,NM_IMPORT,decode);
}
***** OLD_ORD2NAME_ODBG_PLUGIN\ORD2NAME.CPP
{
Insertname(importpointer,NM_IMPORT,label);
}
*****
F:\plug110\test\ord2name>
modifed code and attachment posted in a later thread
Bookmarks