Multiple improvements for Bootstrapper.#7
Open
AntonDevil wants to merge 1 commit intoStackOverflowExcept1on:masterfrom
Open
Multiple improvements for Bootstrapper.#7AntonDevil wants to merge 1 commit intoStackOverflowExcept1on:masterfrom
AntonDevil wants to merge 1 commit intoStackOverflowExcept1on:masterfrom
Conversation
* Added `DllMain` for `bootstrapper.cpp` for windows. * Added `RUNTIME_CONFIG_PATH`, `ASSEMBLY_PATH`, `TYPE_NAME`, `METHOD_NAME` to call a specific patcher. * Added `wait_for_hostfxr` function to wait for `hostfxr` to load first before proceeding. Not sure it is required, but it is nice to have if the app takes long to initialize. * Extracted `HOSTFXR_TIMEOUT_MS`, `HOSTFXR_POLL_INTERVAL_MS`, `HOSTFXR_LIBRARY_NAME` macros. * Added `InitializeResult::HostFxrFptrLoadError` if function pointers from `hostfxr` were not loaded. * Added `exit_hooks` hooks to prevent the app from closing. * Added `logging` to a file and console for debugging. Added `log_printf` where makes sense to debug bootstrapping. * Added `module_dir` to get the directory of running process to load the patcher from and store logs in its folder. Usefull if runing target app from other directory. * Added `process_args` functions to extract command line, get its arguments and check for specific args. * Added `-LogBootstrapper` and `-HookExitProcess` flags to force enable logging and exit hook. Disabled from CMake side by default. Set `-DDEFAULT_LOGGING_ENABLED=ON`, `-DDEFAULT_EXIT_HOOKS_ENABLED=OFF` in `build.bat`. * Added `VERSION.dll` as injection entry point for windows. Proxies system `version.dll` (`c:\Windows\System32\version.dll`) Calls `Bootstrapper.dll` on `DllMain`.
Owner
|
Thanks, I thought about this. I'll review in my free time.
|
Contributor
Author
|
BTW, I recently discovered |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @StackOverflowExcept1on
I have a number of additions for you bootstrapper.
Mainly I replace frida with VERSION.dll for code injection for windows.
Not sure what can be used on linux though...
Anyways, here is the list of changes.
I'm not saying to merge all of them.
This is just an invitation for discussion.
Do you like some of these new features?
I can separate the PR and keep just some of them.
library.cpprenamed tobootstrapper.cpp.DllMainforbootstrapper.cppfor windows.RUNTIME_CONFIG_PATH,ASSEMBLY_PATH,TYPE_NAME,METHOD_NAMEto call a specific patcher.wait_for_hostfxrfunction to wait forhostfxrto load first before proceeding. Not sure it is required, but it is nice to have if the app takes long to initialize.HOSTFXR_TIMEOUT_MS,HOSTFXR_POLL_INTERVAL_MS,HOSTFXR_LIBRARY_NAMEmacros.InitializeResult::HostFxrFptrLoadErrorif function pointers fromhostfxrwere not loaded.exit_hookshooks to prevent the app from closing.loggingto a file and console for debugging. Addedlog_printfwhere makes sense to debug bootstrapping.module_dirto get the directory of running process to load the patcher from and store logs in its folder. Usefull if runing target app from other directory.process_argsfunctions to extract command line, get its arguments and check for specific args.-LogBootstrapperand-HookExitProcessflags to force enable logging and exit hook. Disabled from CMake side by default. Set-DDEFAULT_LOGGING_ENABLED=ON,-DDEFAULT_EXIT_HOOKS_ENABLED=OFFinbuild.bat.VERSION.dllas injection entry point for windows. Proxies systemversion.dll(c:\Windows\System32\version.dll) CallsBootstrapper.dllonDllMain.