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

Add arbitrary library loading #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
20 changes: 15 additions & 5 deletions blobrunner.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ void print_help() {
printf(" [!] Error: No file!\n\n");
printf(" Required args: <inputfile>\n\n");
printf(" Optional Args:\n");
printf(" --offset <offset> The offset to jump into.\n");
printf(" --nopause Don't pause before jumping to shellcode. Danger!!! \n");
printf(" --jit Forces an exception by removing the EXECUTE permission from the alloacted memory.\n");
printf(" --debug Verbose logging.\n");
printf(" --version Print version and exit.\n\n");
printf(" --offset <offset> The offset to jump into.\n");
printf(" --library <library> A library to load into memory.\n");
printf(" --nopause Don't pause before jumping to shellcode. Danger!!! \n");
printf(" --jit Forces an exception by removing the EXECUTE permission from the alloacted memory.\n");
printf(" --debug Verbose logging.\n");
printf(" --version Print version and exit.\n\n");
}

int main(int argc, char* argv[])
Expand Down Expand Up @@ -170,6 +171,15 @@ int main(int argc, char* argv[])
offset = strtol(argv[i], &nptr, 10);
}
}
if (strcmp(argv[i], "--library") == 0) {
i = i + 1;
printf(" [*] Loading library %s...\n", argv[i]);
if (!LoadLibrary(argv[i])) {
printf(" [!] Warning: Failed to load: %s\n", argv[i]);
printf(" [!] Exiting...");
return -1;
}
}
else if (strcmp(argv[i], "--nopause") == 0) {
nopause = true;
}
Expand Down