summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-14 03:09:30 +0000
committermidipix <writeonce@midipix.org>2016-11-13 22:20:59 -0500
commit8de972a241a38696697a0a0aedd2a3c44c059335 (patch)
tree75d0e58c3f533bbd52500a182baa273c4d795d0c
parentcf4adcd6a9a857eb9d33c6f0235eed071be7e434 (diff)
downloadperk-8de972a241a38696697a0a0aedd2a3c44c059335.tar.bz2
perk-8de972a241a38696697a0a0aedd2a3c44c059335.tar.xz
output: pretty_framework(): expand the framework gallery.
-rw-r--r--src/output/pe_output_image_type.c54
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(