From cf7cf8839747fc8cbdef44d04f7c557be1551bb3 Mon Sep 17 00:00:00 2001 From: Rasta Mouse Date: Sun, 23 Mar 2025 12:20:11 +0000 Subject: [PATCH 1/2] Update main.cpp minimum arg count should be 2 because a bof can be called without arguments --- loader/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/main.cpp b/loader/main.cpp index 848551e..6a73f2e 100644 --- a/loader/main.cpp +++ b/loader/main.cpp @@ -433,7 +433,7 @@ int GetPackedArguments(int argc, const char* argv[], const char* bof_args_def, s int main(int argc, char** argv){ - if(argc < 3){ + if(argc < 2){ puts("Not enough arguments to load BOF PE file.\nloader pefile [fmt [arg1] [arg2] ...]"); return -1; } From c8891f1eaca5954a74ea51c32a67199983fddae6 Mon Sep 17 00:00:00 2001 From: Rasta Mouse Date: Sun, 23 Mar 2025 12:23:52 +0000 Subject: [PATCH 2/2] Update main.cpp go may not be the first exported function --- loader/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/main.cpp b/loader/main.cpp index 6a73f2e..e3083f6 100644 --- a/loader/main.cpp +++ b/loader/main.cpp @@ -443,8 +443,8 @@ int main(int argc, char** argv){ if(pe.exports().count() > 0){ - //Find the first exported function - auto entry = bof_entry_ptr(pe.exports().begin()->address()); + //Find the 'go' exported function + auto entry = bof_entry_ptr(pe.exports().find("go").address()); if (argc - 2 <= 0) { //If we have less than 2 arguments, then no BOF arguments were provided