RedHook2 icon indicating copy to clipboard operation
RedHook2 copied to clipboard

Crash on load

Open irfnNet opened this issue 5 years ago • 8 comments

When launch the loader as administrator, injection being success but game crashing.

irfnNet avatar Nov 17 '19 20:11 irfnNet

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?

DottieDot avatar Nov 18 '19 11:11 DottieDot

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

irfnNet avatar Nov 18 '19 17:11 irfnNet

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?

DottieDot avatar Nov 19 '19 12:11 DottieDot

    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. image

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.

irfnNet avatar Nov 19 '19 15:11 irfnNet

abort() has been called

scx1125 avatar Nov 26 '19 17:11 scx1125

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.

lmc avatar Nov 30 '19 23:11 lmc

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.

DottieDot avatar Dec 02 '19 08:12 DottieDot

I tried doing the solution @lmc came up with however I still get the same crash on startup.

thetestgame avatar Mar 07 '20 17:03 thetestgame