From a7c3172ce413b87f5d179e0396d719dbe4c54028 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 13 Jun 2025 12:16:12 +0000 Subject: api: renamed pe_output_image_category() as pe_output_pecoff_category(). --- src/cmds/pe_cmd_perk.c | 2 +- src/output/pe_output_image_category.c | 53 ---------------------------------- src/output/pe_output_pecoff_category.c | 53 ++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 src/output/pe_output_image_category.c create mode 100644 src/output/pe_output_pecoff_category.c (limited to 'src') diff --git a/src/cmds/pe_cmd_perk.c b/src/cmds/pe_cmd_perk.c index 6fe6112..6a881d4 100644 --- a/src/cmds/pe_cmd_perk.c +++ b/src/cmds/pe_cmd_perk.c @@ -44,7 +44,7 @@ static void pe_perform_unit_actions_impl( uint64_t flags = dctx->cctx->fmtflags; if (flags & PERK_OUTPUT_IMAGE_CATEGORY) - pe_output_image_category(dctx,meta); + pe_output_pecoff_category(dctx,meta); if (flags & PERK_OUTPUT_IMAGE_SECTIONS) pe_output_image_sections(dctx,meta); diff --git a/src/output/pe_output_image_category.c b/src/output/pe_output_image_category.c deleted file mode 100644 index bd80687..0000000 --- a/src/output/pe_output_image_category.c +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************/ -/* perk: PE Resource Kit */ -/* Copyright (C) 2015--2025 SysDeer Technologies, LLC */ -/* Released under GPLv2 and GPLv3; see COPYING.PERK. */ -/***************************************************************/ - -#include - -#include -#include -#include "perk_driver_impl.h" -#include "perk_dprintf_impl.h" -#include "perk_errinfo_impl.h" - -int pe_output_image_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; -} 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 + +#include +#include +#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; +} -- cgit v1.2.3