RedHook2
RedHook2 copied to clipboard
Crash on load
When launch the loader as administrator, injection being success but game crashing.
What RedHook2 version are you using?
Are you using the Epic Games launcher or the Rockstar Games launcher?
If you're on 1.0.1 could you provide the log located at RedHook2/logs/hook.log
?
Hi, I compiled RedHook2 and the sample project from the source. Got that crash. After that, tried with your Released 1.0.1 version, it's same. Loader is works (injected another dll with your loader successful). It's Rockstar Games Launcher version.
And there is not any RedHook2/logs/hook.log
Since there are no longs, std::filesystem::create_directories("RedHook2/logs");
might be throwing an exception. Would you be able to try wrapping a try catch around it and see if that changes anything?
void CreateLogs()
{
try
{
std::filesystem::create_directories("RedHook2/logs");
logs::g_hLog = logging::LogMgr::CreateLog<logging::GenericFileLogger>(
"hook_log", "RedHook2/logs/hook.log");
}
catch (const std::runtime_error& re)
{
std::cerr << "Runtime error: " << re.what() << std::endl;
}
catch (const std::exception& ex)
{
std::cerr << "Error occurred: " << ex.what() << std::endl;
}
catch (...)
{
std::cerr << "Unknown failure occurred. Possible memory corruption" << std::endl;
}
}
Just tried with that code, still can't run and also I forgot to write that is the error I got.
After realize that, I re-compiled from source and changed the target to Release from Debug, the error was gone but still get crash after injection.
abort() has been called
I was able to fix this by manually creating the dirs RedHook2
and RedHook2/logs
in the RDR2 game dir. This might be related to the elevated filesystem permissions on Program Files
, as I've been unable to create new files or dirs from my own injected code in the game process.
It's odd that the try catch of @irfn-net didn't work then. Maybe something is going wrong in the logging if the directories don't exist. Creating the directories with ShellExecute
might be a good solution.
I tried doing the solution @lmc came up with however I still get the same crash on startup.