#include <ida.hpp>
#include <idp.hpp>
#include <expr.hpp>
#include <bytes.hpp>
#include <loader.hpp>
#include <kernwin.hpp>
#include <funcs.hpp>
#include <name.hpp>
#include <typeinf.hpp>
/*
print_fti prints the function name and argument type info
*/
intprint_fti()
{
intnfuncs=get_func_qty();
msg("Number of functions: %i\n",nfuncs);
for(inti=0;i<nfuncs;i++)
{
func_t*pfn=getn_func(i);
ea_tea=pfn->startEA;
type_ttype[MAXSTR];
p_listfields[MAXSTR];
if(!get_ti(ea,type,sizeof(type),fields,sizeof(fields)))
continue;
uint32arglocs[MAX_FUNC_ARGS];
type_t*types[MAX_FUNC_ARGS];
char*names[MAX_FUNC_ARGS];
charfname[MAXNAMELEN];
intn=build_funcarg_arrays(type,fields,arglocs,types,names,MAX_FUNC_ARGS,false);
get_func_name(ea,fname,sizeof(fname));
msg("%a %s",ea,fname);
for(intj=0;j<n;j++){
chartext[MAXSTR];
intcode=print_type_to_one_line(text,sizeof(text),idati,types[j],names[j],NULL,NULL);
if(code!=T_NORMAL)continue;
msg(" | %i: %s",j,text);
}
msg("\n");
free_funcarg_arrays(types,names,n);}
}
intidaapiinit(void)
{
returnPLUGIN_OK;
}
voididaapirun(intarg)
{
print_fti();
}
plugin_tPLUGIN=
{
IDP_INTERFACE_VERSION,
PLUGIN_UNL,// plugin flags
init,// initialize
NULL,// terminate. this pointer may be NULL.
run,// invoke plugin
NULL,// long comment about the plugin
// it could appear in the status line
// or as a hint
NULL,// multiline help about the plugin
"TYPES Plugin",// the preferred short name of the plugin
"ALT-F8"// the preferred hotkey to run the plugin
};