summaryrefslogtreecommitdiffhomepage
path: root/src/output
diff options
context:
space:
mode:
Diffstat (limited to 'src/output')
-rw-r--r--src/output/pe_output_error.c9
-rw-r--r--src/output/pe_output_image_symbols.c14
2 files changed, 14 insertions, 9 deletions
diff --git a/src/output/pe_output_error.c b/src/output/pe_output_error.c
index 1d818d1..50c7357 100644
--- a/src/output/pe_output_error.c
+++ b/src/output/pe_output_error.c
@@ -35,9 +35,18 @@ static const char * const pe_error_strings[PERK_ERR_CAP] = {
[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_symbols.c b/src/output/pe_output_image_symbols.c
index 73e712c..ca4445c 100644
--- a/src/output/pe_output_image_symbols.c
+++ b/src/output/pe_output_image_symbols.c
@@ -20,6 +20,7 @@ int pe_output_image_symbols(
const struct pe_image_meta * meta)
{
unsigned i;
+ unsigned nrecs;
int fdout;
char * mark;
struct pe_raw_coff_symbol * symtbl;
@@ -27,6 +28,7 @@ int pe_output_image_symbols(
const char * dash = "";
fdout = pe_driver_fdout(dctx);
+ nrecs = meta->m_coff.cfh_size_of_sym_tbl / sizeof(struct pe_raw_coff_symbol);
if (dctx->cctx->fmtflags & PERK_PRETTY_YAML) {
if (pe_dprintf(fdout,"symbols:\n") < 0)
@@ -38,21 +40,15 @@ int pe_output_image_symbols(
mark = (char *)meta->r_image.map_addr;
symtbl = (struct pe_raw_coff_symbol *)(mark + meta->m_coff.cfh_ptr_to_sym_tbl);
- for (i=0; i<meta->m_coff.cfh_num_of_syms; i++) {
+ for (i=0; i<nrecs; i++) {
pe_read_coff_symbol(
&symtbl[i],&symrec,
&meta->m_coff,meta->r_image.map_addr);
- if (pe_dprintf(
- fdout,
- "%s%s\n",
- dash,
- symrec.cs_long_name
- ? symrec.cs_long_name
- : symrec.cs_name) < 0)
+ if (pe_dprintf(fdout,"%s%s\n",dash,symrec.cs_name) < 0)
return PERK_FILE_ERROR(dctx);
- i += symtbl[i].cs_num_of_aux_symbols[0];
+ i += symtbl[i].cs_num_of_aux_recs[0];
}
return 0;