Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove exit() from libpe #202

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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