summaryrefslogtreecommitdiffhomepage
path: root/src/output
diff options
context:
space:
mode:
Diffstat (limited to 'src/output')
-rw-r--r--src/output/pe_output_error.c15
-rw-r--r--src/output/pe_output_image_category.c8
-rw-r--r--src/output/pe_output_mdso_libraries.c16
3 files changed, 26 insertions, 13 deletions
diff --git a/src/output/pe_output_error.c b/src/output/pe_output_error.c
index 84a867b..50c7357 100644
--- a/src/output/pe_output_error.c
+++ b/src/output/pe_output_error.c
@@ -27,13 +27,26 @@ static const char * const pe_error_strings[PERK_ERR_CAP] = {
[PERK_ERR_NULL_CONTEXT] = "null driver or unit context",
[PERK_ERR_NULL_IMAGE] = "null image base pointer",
[PERK_ERR_INVALID_CONTEXT] = "invalid driver or unit context",
- [PERK_ERR_INVALID_IMAGE] = "invalid PE image",
+ [PERK_ERR_INVALID_IMAGE] = "invalid PE image, object, or common archive",
[PERK_ERR_IMAGE_SIZE_ZERO] = "PE image size cannot be zero",
[PERK_ERR_IMAGE_MALFORMED] = "malformed PE image detected",
[PERK_ERR_BAD_DOS_HEADER] = "bad DOS header",
[PERK_ERR_BAD_COFF_HEADER] = "bad COFF header",
[PERK_ERR_BAD_IMAGE_TYPE] = "bad PE image type",
[PERK_ERR_UNSUPPORTED_ABI] = "unsupported image abi",
+
+ [PERK_ERR_AR_NON_ARCHIVE_IMAGE]= "the parsed PE/COFF object or image is not an archive",
+ [PERK_ERR_AR_NON_PE_MEMBERS] = "format of current archive member is not PE/COFF",
+ [PERK_ERR_AR_MIXED_PE_MEMBERS] = "archive mixes objects of different architectures",
+ [PERK_ERR_AR_NESTED_ARCHIVE] = "nested archives are currently not supported",
+
+ [PERK_ERR_AR_MISSING_ACTION] = "missing action, which should be exactly one of [dqmrxpt]",
+ [PERK_ERR_AR_MULTIPLE_ACTIONS] = "exactly one action permitted, multiple actions specified",
+ [PERK_ERR_AR_MULTIPLE_ANCHORS] = "multiple anchors: may specify _before_ or _after_, but not both",
+ [PERK_ERR_AR_INVALID_ANCHORS] = "mismatched arguments: anchors are incompatible with the selected action",
+ [PERK_ERR_AR_MISSING_ANCHOR] = "missing anchor: <posname> provided, but no anchor specified",
+ [PERK_ERR_AR_NULL_POSNAME] = "null <posname> argument with [-a], [-b], or [-i]",
+ [PERK_ERR_AR_NULL_ARNAME] = "null <arname> argument",
};
static const char * pe_output_error_header(const struct pe_error_info * erri)
diff --git a/src/output/pe_output_image_category.c b/src/output/pe_output_image_category.c
index 863c84f..b3d72df 100644
--- a/src/output/pe_output_image_category.c
+++ b/src/output/pe_output_image_category.c
@@ -24,10 +24,10 @@ int pe_output_image_category(
fdout = pe_driver_fdout(dctx);
- pe_get_image_abi (meta,&abi);
- pe_get_image_subtype (meta,&subtype);
- pe_get_image_subsystem(meta,&subsystem);
- pe_get_image_framework(meta,&framework);
+ 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(
diff --git a/src/output/pe_output_mdso_libraries.c b/src/output/pe_output_mdso_libraries.c
index c5ee1b4..049cd4e 100644
--- a/src/output/pe_output_mdso_libraries.c
+++ b/src/output/pe_output_mdso_libraries.c
@@ -92,7 +92,7 @@ static char * dsolib_name(const struct pe_image_meta * m, int i)
rva = va - m->m_opt.oh_mem.coh_image_base;
}
- if (pe_get_roffset_from_rva(m,(uint32_t)rva,&roffset) < 0)
+ if (pe_meta_get_roffset_from_rva(m,(uint32_t)rva,&roffset) < 0)
return 0;
return (addr = m->r_image.map_addr) + roffset;
@@ -117,14 +117,14 @@ static unsigned char * dsosym_meta(const struct pe_image_meta * m, int j)
rva = va;
}
- if ((idx = pe_get_named_section_index(m,MDSO_META_SECTION)) >= 0)
- if (idx != pe_get_block_section_index(m,&(struct pe_block){rva,0}))
+ if ((idx = pe_meta_get_named_section_index(m,MDSO_META_SECTION)) >= 0)
+ if (idx != pe_meta_get_block_section_index(m,&(struct pe_block){rva,0}))
return (unsigned char *)(-1);
if (va > rva)
return 0;
- if (pe_get_roffset_from_rva(m,rva,&roffset) < 0)
+ if (pe_meta_get_roffset_from_rva(m,rva,&roffset) < 0)
return 0;
return (unsigned char *)m->r_image.map_addr + roffset;
@@ -150,14 +150,14 @@ static char * dsosym_string(const struct pe_image_meta * m, int j)
rva = va;
}
- if ((idx = pe_get_named_section_index(m,MDSO_STRS_SECTION)) >= 0)
- if (idx != pe_get_block_section_index(m,&(struct pe_block){rva,0}))
+ if ((idx = pe_meta_get_named_section_index(m,MDSO_STRS_SECTION)) >= 0)
+ if (idx != pe_meta_get_block_section_index(m,&(struct pe_block){rva,0}))
return (char *)(-2);
if (va > rva)
return 0;
- if (pe_get_roffset_from_rva(m,rva,&roffset) < 0)
+ if (pe_meta_get_roffset_from_rva(m,rva,&roffset) < 0)
return 0;
return (addr = m->r_image.map_addr) + roffset;
@@ -180,7 +180,7 @@ int pe_output_mdso_libraries(
if (!m->m_stats.t_ndsolibs)
return 0;
- if (pe_get_image_abi(m,0) == PE_ABI_UNSUPPORTED)
+ if (pe_info_get_image_abi(m,0) == PE_ABI_UNSUPPORTED)
return PERK_CUSTOM_ERROR(
dctx,PERK_ERR_UNSUPPORTED_ABI);