Skip to content

Commit

Permalink
Merge pull request #202 from mentebinaria/i197
Browse files Browse the repository at this point in the history
Remove exit() from libpe
  • Loading branch information
GoGoOtaku authored Oct 19, 2023
2 parents 40e423c + fdd5671 commit fce2890
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/libpe/hashes.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "libpe/hashes.h"

#include "libpe/error.h"
#include "libpe/pe.h"
#include "libfuzzy/fuzzy.h"
#include "libpe/ordlookup.h"
Expand Down Expand Up @@ -139,9 +140,6 @@ static pe_err_e get_headers_optional_hash(pe_ctx_t *ctx, pe_hash_t *output) {
const IMAGE_OPTIONAL_HEADER *sample = pe_optional(ctx);

switch (sample->type) {
default:
// TODO(jweyrich): handle unknown type.
exit(1);
case MAGIC_ROM:
{
const unsigned char *data = (const unsigned char *)sample->_rom;
Expand All @@ -160,6 +158,8 @@ static pe_err_e get_headers_optional_hash(pe_ctx_t *ctx, pe_hash_t *output) {
const uint64_t data_size = sizeof(IMAGE_OPTIONAL_HEADER_64);
return get_hashes(output, "IMAGE_OPTIONAL_HEADER_64", data, data_size);
}
default:
return LIBPE_E_UNSUPPORTED_IMAGE;
}
}

Expand Down

0 comments on commit fce2890

Please sign in to comment.