diff options
author | midipix <writeonce@midipix.org> | 2016-11-14 23:02:25 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-11-14 23:02:25 -0500 |
commit | 919d9d87594df2511a4bf81cfb2d6ceccb4ebe33 (patch) | |
tree | 6cfd21ac833be18aca75fee495810b27707bb888 | |
parent | 6aec968c10e0d0c4509cf7d6930e3715175fae67 (diff) | |
download | perk-919d9d87594df2511a4bf81cfb2d6ceccb4ebe33.tar.bz2 perk-919d9d87594df2511a4bf81cfb2d6ceccb4ebe33.tar.xz |
info api: pe_get_image_subtype(): initial integration.
-rw-r--r-- | src/output/pe_output_image_type.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/output/pe_output_image_type.c b/src/output/pe_output_image_type.c index b6324a5..e04d1bb 100644 --- a/src/output/pe_output_image_type.c +++ b/src/output/pe_output_image_type.c @@ -29,19 +29,12 @@ static const char * pretty_abi(const struct pe_unit_ctx * uctx) } } -static const char * pretty_type(const struct pe_unit_ctx * uctx) -{ - if (uctx->meta->coff.characteristics & PE_IMAGE_FILE_DLL) - return "dll"; - else - return "exe"; -} - int pe_output_image_type( const struct pe_driver_ctx * dctx, const struct pe_unit_ctx * uctx, FILE * fout) { + struct pe_info_string subtype; struct pe_info_string subsystem; struct pe_info_string framework; const struct pe_image_meta * meta = uctx->meta; @@ -49,6 +42,7 @@ int pe_output_image_type( if (!fout) fout = stdout; + pe_get_image_subtype (meta,&subtype); pe_get_image_subsystem(meta,&subsystem); pe_get_image_framework(meta,&framework); @@ -56,14 +50,14 @@ int pe_output_image_type( if (fprintf(fout,"%s:\n- %s:\n- %s:\n- %s:\n- %s:\n", *uctx->path, pretty_abi(uctx), - pretty_type(uctx), + subtype.buffer, subsystem.buffer, framework.buffer) < 0) return PERK_FILE_ERROR(dctx); } else { if (fprintf(fout,"%s-%s-%s-%s\n", pretty_abi(uctx), - pretty_type(uctx), + subtype.buffer, subsystem.buffer, framework.buffer) < 0) return PERK_FILE_ERROR(dctx); |