diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-02 00:29:12 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-02 00:29:12 +0000 |
commit | f33bab4fb3586fd06896a7730bce8913c2616b78 (patch) | |
tree | 484bc51055c9ad810fa4bfd1c0b1b0e35ae03096 /NorthstarDedicatedTest/dedicatedmaterialsystem.cpp | |
parent | ac0c658516d8eaef2c788624f94e974ef47acbb8 (diff) | |
download | NorthstarLauncher-f33bab4fb3586fd06896a7730bce8913c2616b78.tar.gz NorthstarLauncher-f33bab4fb3586fd06896a7730bce8913c2616b78.zip |
tier0 code cleanup and loadlibrary hook fix
Diffstat (limited to 'NorthstarDedicatedTest/dedicatedmaterialsystem.cpp')
-rw-r--r-- | NorthstarDedicatedTest/dedicatedmaterialsystem.cpp | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp b/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp index 3c96ef22..29ccf6f7 100644 --- a/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp +++ b/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp @@ -11,7 +11,7 @@ void InitialiseDedicatedMaterialSystem(HMODULE baseAddress) //while (!IsDebuggerPresent()) // Sleep(100); - + // not using these for now since they're related to nopping renderthread/gamewindow i.e. very hard // we use -noshaderapi instead now //{ @@ -64,59 +64,43 @@ void InitialiseDedicatedMaterialSystem(HMODULE baseAddress) *(ptr + 4) = (char)0x90; } - // these don't fully work, they cause game to hang on rpak init, needs reworking { - // materialsystem rpak type: texture - char* ptr = (char*)baseAddress + 0x2B3A; + // some renderthread stuff + char* ptr = (char*)baseAddress + 0x8C10; TempReadWrite rw(ptr); - // je=>jmp - *ptr = (char)0xE9; - *(ptr + 1) = (char)0x48; - *(ptr + 2) = (char)0x02; - *(ptr + 3) = (char)0x00; - *(ptr + 4) = (char)0x00; + // call => nop + *ptr = (char)0x90; + *(ptr + 1) = (char)0x90; } + // rpak type callbacks + // these need to be nopped for dedi { - // materialsystem rpak type: material - char* ptr = (char*)baseAddress + 0x50AD4; + // materialsystem rpak type: shader + char* ptr = (char*)baseAddress + 0x2850; TempReadWrite rw(ptr); - // je=>jmp - *ptr = (char)0xEB; + // ret + *ptr = (char)0xC3; } { - // materialsystem rpak type: shader - char* ptr = (char*)baseAddress + 0x2850; + // materialsystem rpak type: texture + char* ptr = (char*)baseAddress + 0x2B00; TempReadWrite rw(ptr); - // make it return 0 - // mov rax,0 - *ptr = 0x48; - *(ptr + 1) = (char)0xB8; - *(ptr + 2) = (char)0x00; - *(ptr + 3) = (char)0x00; - *(ptr + 4) = (char)0x00; - *(ptr + 5) = (char)0x00; - *(ptr + 6) = (char)0x00; - *(ptr + 7) = (char)0x00; - *(ptr + 8) = (char)0x00; - *(ptr + 9) = (char)0x00; - // ret - *(ptr + 10) = (char)0xC3; + *ptr = (char)0xC3; } { - // some renderthread stuff - char* ptr = (char*)baseAddress + 0x8C10; + // materialsystem rpak type: material + char* ptr = (char*)baseAddress + 0x50AA0; TempReadWrite rw(ptr); - // call => nop - *ptr = (char)0x90; - *(ptr + 1) = (char)0x90; + // ret + *ptr = (char)0xC3; } } } |