Skip to content

Bypass Json #44

Description

@KyuuSama

Hi John,

First off, amazing work on the pangbox/rugburn fork, it's incredibly clean and well-structured.

I'm trying to compile it myself to hardcode my configuration directly into the DLL and get rid of the external rugburn.json file. I'm running into two issues I was hoping you might have some insight on.

Context:

I'm using Visual Studio 2022. I've retargeted the solution from the original VS2019 toolset.

I'm compiling for Release / Win32.

Issue 1: msvcr71.dll Dependency
My compiled ijl15.dll ends up having a dependency on the very old msvcr71.dll, which the original pre-compiled Rugburn DLLs don't seem to have. This causes a "Could not load module" error on clean systems. I've set the Runtime Library to Multi-threaded (/MT) in the project properties, but the dependency still gets linked in.
Do you have any idea what project setting I might be missing to build a fully static/standalone DLL like the original?

Issue 2: Hardcoded rewrites are not working
My main goal is to bypass the JSON file. I've created a LoadHardcodedConfig() function that populates the Config struct directly, and I've replaced the body of LoadJsonRugburnConfig() to call my new function.

Here is a simplified version of my code in config.c:

code C++

// Added declaration in config.h inside an extern "C" block
// void LoadHardcodedConfig();

// My new function to populate the config struct
void LoadHardcodedConfig() {
memset(&Config, 0, sizeof(RUGBURNCONFIG));

// --- PortRewrites Example ---
Config.PortRewriteRules[0].fromport = 10803;
Config.PortRewriteRules[0].toport = 10101;
Config.PortRewriteRules[0].toaddr = "1.2.3.4"; // Example IP
Config.NumPortRewriteRules = 1;

// --- UrlRewrites Example ---
int ruleIndex = 0;
Config.UrlRewriteRules[ruleIndex].from = ReParse("http://game\\.original\\.server/(.*)");
Config.UrlRewriteRules[ruleIndex].to = "https://my\\.new\\.server/game/$1";
ruleIndex++;

Config.UrlRewriteRules[ruleIndex].from = ReParse("http://patch\\.original\\.server/files/patchlist");
Config.UrlRewriteRules[ruleIndex].to = "https://my\\.new\\.server/files/patchlist";
ruleIndex++;

Config.NumUrlRewriteRules = ruleIndex;
Config.NumPatchAddress = 0;

}

// Replaced the original function body
void LoadJsonRugburnConfig() {
LoadHardcodedConfig();
}

When I use the compiled DLL, the game launches, but the URL and port rewrites don't seem to happen (logs show // (no rewrite rules matched)). It seems like my hardcoded config is not being loaded or used correctly. Is there another initialization function or step I might have missed?

Any advice you could offer would be hugely appreciated. Thanks for your time and for the great project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions