diff options
-rw-r--r-- | src/output/pe_output_image_type.c | 54 |
1 files changed, 53 insertions, 1 deletions
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; i<uctx->meta->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; i<uctx->meta->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( |