mirror of
https://github.com/decompals/wibo.git
synced 2025-12-16 08:27:07 +00:00
Readme changes, github actions ci, test (#1)
* Readme changes, github actions ci, test * Std flag change for older GCC versions" * Install gcc multilib * test fix and formatting * Don't segfault on nonexistant file and show error instead * Update ci.yml * PR comments * remove silly bit
This commit is contained in:
10
main.cpp
10
main.cpp
@@ -1,5 +1,6 @@
|
||||
#include "common.h"
|
||||
#include <asm/ldt.h>
|
||||
#include <filesystem>
|
||||
#include <errno.h>
|
||||
#include <memory>
|
||||
#include <sys/mman.h>
|
||||
@@ -176,7 +177,14 @@ int main(int argc, char **argv) {
|
||||
wibo::Executable exec;
|
||||
wibo::mainModule = &exec;
|
||||
|
||||
FILE *f = fopen(argv[1], "rb");
|
||||
char* pe_path = argv[1];
|
||||
FILE *f = fopen(pe_path, "rb");
|
||||
if (!f) {
|
||||
std::string mesg = std::string("Failed to open file ") + pe_path;
|
||||
perror(mesg.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
exec.loadPE(f);
|
||||
fclose(f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user