From 8de972a241a38696697a0a0aedd2a3c44c059335 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 14 Nov 2016 03:09:30 +0000 Subject: output: pretty_framework(): expand the framework gallery. --- src/output/pe_output_image_type.c | 54 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'src/output') diff --git a/src/output/pe_output_image_type.c b/src/output/pe_output_image_type.c index 21ae925..15bcabc 100644 --- a/src/output/pe_output_image_type.c +++ b/src/output/pe_output_image_type.c @@ -69,6 +69,37 @@ static bool pe_image_is_psxscl(const struct pe_unit_ctx * uctx) && !pe_get_expsym_by_name(uctx->meta,"__psx_init",0)); } +static bool pe_image_is_cygwin(const struct pe_unit_ctx * uctx) +{ + int i; + const struct pe_image_meta * meta = uctx->meta; + + for (i=0; imeta->summary.nimplibs; i++) + if (!(strcmp(meta->idata[i].name,"cygwin1.dll"))) + return true; + + return false; +} + +static bool pe_image_is_msys(const struct pe_unit_ctx * uctx) +{ + int i; + const struct pe_image_meta * meta = uctx->meta; + + for (i=0; imeta->summary.nimplibs; i++) + if (!(strcmp(meta->idata[i].name,"msys-2.0.dll"))) + return true; + + return false; +} + +static bool pe_image_is_mingw(const struct pe_unit_ctx * uctx) +{ + return ((pe_get_named_section_index(uctx->meta,".CRT") >= 0) + && (pe_get_named_section_index(uctx->meta,".bss") >= 0) + && (pe_get_named_section_index(uctx->meta,".tls") >= 0)); +} + static const char * pretty_framework(const struct pe_unit_ctx * uctx) { if (pe_get_named_section_index(uctx->meta,".midipix") >= 0) @@ -77,11 +108,32 @@ static const char * pretty_framework(const struct pe_unit_ctx * uctx) else if (pe_get_named_section_index(uctx->meta,".freestd") >= 0) return "freestd"; + else if (pe_get_named_section_index(uctx->meta,".cygheap") >= 0) + return "cygone"; + else if (pe_image_is_psxscl(uctx)) return "psxscl"; - else + else if (pe_image_is_cygwin(uctx)) + return "cygwin"; + + else if (pe_image_is_msys(uctx)) + return "msys"; + + else if (pe_image_is_mingw(uctx)) + return "mingw"; + + else if (uctx->meta->opt.img.subsystem == PE_IMAGE_SUBSYSTEM_POSIX_CUI) + return "suacon"; + + else if (uctx->meta->opt.img.subsystem == PE_IMAGE_SUBSYSTEM_WINDOWS_CUI) + return "wincon"; + + else if (uctx->meta->opt.img.subsystem == PE_IMAGE_SUBSYSTEM_WINDOWS_GUI) return "win32"; + + else + return "unknown"; } int pe_output_image_type( -- cgit v1.2.3