Exemple #1
0
static void targetinfo(struct cli_target_info *info, unsigned int target, fmap_t *map)
{
    cli_infomsg(NULL,"DEBUG: in targetinfo with target=%d\n",target);//CHR
	int (*einfo)(fmap_t *, struct cli_exe_info *) = NULL;


    memset(info, 0, sizeof(struct cli_target_info));
    info->fsize = map->len;
    cli_hashset_init_noalloc(&info->exeinfo.vinfo);

    if(target == 1)
	einfo = cli_peheader;
    else if(target == 6)
	einfo = cli_elfheader;
    else if(target == 9)
	einfo = cli_machoheader;
    else {
    cli_infomsg(NULL,"DEBUG: target!=(1,6,9), do nothing and return\n");//CHR
    return;
    }

    if(einfo(map, &info->exeinfo))
	info->status = -1;
    else
	info->status = 1;
}
Exemple #2
0
void cli_targetinfo(struct cli_target_info *info, unsigned int target, fmap_t *map)
{
	int (*einfo)(fmap_t *, struct cli_exe_info *) = NULL;


    memset(info, 0, sizeof(struct cli_target_info));
    info->fsize = map->len;
    cli_hashset_init_noalloc(&info->exeinfo.vinfo);

    if(target == 1)
	einfo = cli_peheader;
    else if(target == 6)
	einfo = cli_elfheader;
    else if(target == 9)
	einfo = cli_machoheader;
    else return;

    if(einfo(map, &info->exeinfo))
	info->status = -1;
    else
	info->status = 1;
}