More quick fixes

This commit is contained in:
Jeremy 2023-09-19 19:13:50 -04:00
parent 08e5b021de
commit 55941eaf7e
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ namespace detail {
} }
Segment_Command segment = load_bytes<Segment_Command>(obj_file, actual_offset); Segment_Command segment = load_bytes<Segment_Command>(obj_file, actual_offset);
if(should_swap) { if(should_swap) {
swap_segment_command(&segment, NX_UnknownByteOrder); swap_segment_command(segment);
} }
if(strcmp(segment.segname, "__TEXT") == 0) { if(strcmp(segment.segname, "__TEXT") == 0) {
return segment.vmaddr; return segment.vmaddr;

View File

@ -32,7 +32,7 @@ namespace detail {
// Endianness should always be little for dos and pe headers // Endianness should always be little for dos and pe headers
FILE* file_ptr; FILE* file_ptr;
errno_t ret = fopen_s(&file_ptr, obj_path.c_str(), "rb"); errno_t ret = fopen_s(&file_ptr, obj_path.c_str(), "rb");
auto file = raii_wrap(file_ptr, file_deleter); auto file = raii_wrap(std::move(file_ptr), file_deleter);
if(ret != 0 || file == nullptr) { if(ret != 0 || file == nullptr) {
throw file_error("Unable to read object file " + obj_path); throw file_error("Unable to read object file " + obj_path);
} }