diff options
author | midipix <writeonce@midipix.org> | 2025-06-13 12:16:12 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2025-06-13 12:16:12 +0000 |
commit | a7c3172ce413b87f5d179e0396d719dbe4c54028 (patch) | |
tree | bbf6b8a227a530e66b1c71e535b8bb639b8de60b /src/output/pe_output_pecoff_category.c | |
parent | a484c9ca09c569aeeb239f78e9c3191c39f4d6f9 (diff) | |
download | perk-a7c3172ce413b87f5d179e0396d719dbe4c54028.tar.bz2 perk-a7c3172ce413b87f5d179e0396d719dbe4c54028.tar.xz |
api: renamed pe_output_image_category() as pe_output_pecoff_category().
Diffstat (limited to 'src/output/pe_output_pecoff_category.c')
-rw-r--r-- | src/output/pe_output_pecoff_category.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/output/pe_output_pecoff_category.c b/src/output/pe_output_pecoff_category.c new file mode 100644 index 0000000..3d4e5d4 --- /dev/null +++ b/src/output/pe_output_pecoff_category.c @@ -0,0 +1,53 @@ +/***************************************************************/ +/* perk: PE Resource Kit */ +/* Copyright (C) 2015--2025 SysDeer Technologies, LLC */ +/* Released under GPLv2 and GPLv3; see COPYING.PERK. */ +/***************************************************************/ + +#include <stdio.h> + +#include <perk/perk.h> +#include <perk/perk_output.h> +#include "perk_driver_impl.h" +#include "perk_dprintf_impl.h" +#include "perk_errinfo_impl.h" + +int pe_output_pecoff_category( + const struct pe_driver_ctx * dctx, + const struct pe_image_meta * meta) +{ + int fdout; + struct pe_info_string abi; + struct pe_info_string subtype; + struct pe_info_string subsystem; + struct pe_info_string framework; + + fdout = pe_driver_fdout(dctx); + + pe_info_get_image_abi (meta,&abi); + pe_info_get_image_subtype (meta,&subtype); + pe_info_get_image_subsystem(meta,&subsystem); + pe_info_get_image_framework(meta,&framework); + + if (dctx->cctx->fmtflags & PERK_PRETTY_YAML) { + if (pe_dprintf( + fdout, + "category:\n- %s:\n- %s:\n- %s:\n- %s:\n", + abi.buffer, + subtype.buffer, + subsystem.buffer, + framework.buffer) < 0) + return PERK_FILE_ERROR(dctx); + } else { + if (pe_dprintf( + fdout, + "%s-%s-%s-%s\n", + abi.buffer, + subtype.buffer, + subsystem.buffer, + framework.buffer) < 0) + return PERK_FILE_ERROR(dctx); + } + + return 0; +} |