mirror of
https://git.xeondev.com/LR/C.git
synced 2026-02-04 15:15:05 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b36ef02e6b |
@@ -9,4 +9,4 @@ First of all, it redirects all of the game requests to a local server. Second of
|
||||
## Setup
|
||||
You can get a prebuilt DLL for your game version in [releases](https://git.xeondev.com/LR/C/releases). If you don't want to use prebuilt binaries, you can compile it with `Zig 0.16.0-dev.2368`, running `zig build` will do the trick.
|
||||
|
||||
Next, you have to go to the game's directory and find the `gfsdk.dll` file. You have to RENAME it to `gfsdk_original.dll`. Afterwards, you should place `gfsdk.dll` that you've got from this repository in the game's directory. That should be it, just run Endfield.exe. If a console with an ASCII art spawns, it works.
|
||||
Next, you have to go to the game's directory and replace the `gfsdk.dll` file with the one you've got from this repository. That should be it, just run Endfield.exe. If a console with an ASCII art spawns, it works.
|
||||
|
||||
@@ -1,173 +1,79 @@
|
||||
const std = @import("std");
|
||||
const windows = std.os.windows;
|
||||
|
||||
pub var ptrGFSdkGetProtocolStatus: usize = undefined;
|
||||
pub var ptrGFSdkInit: usize = undefined;
|
||||
pub var ptrGFSdkInitLibrary: usize = undefined;
|
||||
pub var ptrGFSdkLogOut: usize = undefined;
|
||||
pub var ptrGFSdkLogin: usize = undefined;
|
||||
pub var ptrGFSdkOpenCustomerServiceCenter: usize = undefined;
|
||||
pub var ptrGFSdkOpenProfile: usize = undefined;
|
||||
pub var ptrGFSdkPayByPayment: usize = undefined;
|
||||
pub var ptrGFSdkQueryProductList: usize = undefined;
|
||||
pub var ptrGFSdkSetExtraConfig: usize = undefined;
|
||||
pub var ptrGFSdkSetLanguage: usize = undefined;
|
||||
pub var ptrGFSdkSetServerId: usize = undefined;
|
||||
pub var ptrGFSdkSetServerType: usize = undefined;
|
||||
pub var ptrGFSdkSetUserDataPath: usize = undefined;
|
||||
pub var ptrGFSdkShowAccountCenter: usize = undefined;
|
||||
pub var ptrGFSdkShowProtocolView: usize = undefined;
|
||||
pub var ptrGFSdkUnInit: usize = undefined;
|
||||
pub var ptrGFSdkUnInitLibrary: usize = undefined;
|
||||
|
||||
pub fn link(against: windows.HMODULE) void {
|
||||
inline for (@typeInfo(@This()).@"struct".decls) |decl| {
|
||||
if (@TypeOf(@field(@This(), decl.name)) != usize) continue;
|
||||
|
||||
@field(@This(), decl.name) = @intFromPtr(windows.kernel32.GetProcAddress(against, decl.name[3..]) orelse null);
|
||||
}
|
||||
pub export fn GFSdkGetProtocolStatus() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkGetProtocolStatus() callconv(.naked) void {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkGetProtocolStatus),
|
||||
);
|
||||
pub export fn GFSdkInit(
|
||||
_: usize,
|
||||
initCallback: *const fn (usize, usize) callconv(.c) void,
|
||||
_: usize,
|
||||
_: usize,
|
||||
) callconv(.c) u32 {
|
||||
initCallback(0, 0);
|
||||
return 3;
|
||||
}
|
||||
|
||||
pub export fn GFSdkInit() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkInit),
|
||||
);
|
||||
pub export fn GFSdkInitLibrary() callconv(.c) u32 {
|
||||
return 1;
|
||||
}
|
||||
|
||||
pub export fn GFSdkInitLibrary() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkInitLibrary),
|
||||
);
|
||||
pub export fn GFSdkLogOut() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkLogOut() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkLogOut),
|
||||
);
|
||||
pub export fn GFSdkLogin() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkLogin() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkLogin),
|
||||
);
|
||||
pub export fn GFSdkOpenCustomerServiceCenter() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkOpenCustomerServiceCenter() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkOpenCustomerServiceCenter),
|
||||
);
|
||||
pub export fn GFSdkOpenProfile() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkOpenProfile() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkOpenProfile),
|
||||
);
|
||||
pub export fn GFSdkPayByPayment() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkPayByPayment() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkPayByPayment),
|
||||
);
|
||||
pub export fn GFSdkQueryProductList() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkQueryProductList() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkQueryProductList),
|
||||
);
|
||||
pub export fn GFSdkSetLanguage() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkSetLanguage() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkSetLanguage),
|
||||
);
|
||||
pub export fn GFSdkSetServerId() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkSetServerId() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkSetServerId),
|
||||
);
|
||||
pub export fn GFSdkSetServerType() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkSetServerType() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkSetServerType),
|
||||
);
|
||||
pub export fn GFSdkSetUserDataPath() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkSetUserDataPath() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkSetUserDataPath),
|
||||
);
|
||||
pub export fn GFSdkShowAccountCenter() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkShowAccountCenter() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkShowAccountCenter),
|
||||
);
|
||||
pub export fn GFSdkShowProtocolView() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkShowProtocolView() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkShowProtocolView),
|
||||
);
|
||||
pub export fn GFSdkUnInit() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkUnInit() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkUnInit),
|
||||
);
|
||||
pub export fn GFSdkUnInitLibrary() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub export fn GFSdkUnInitLibrary() callconv(.naked) u32 {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkUnInitLibrary),
|
||||
);
|
||||
}
|
||||
|
||||
pub export fn GFSdkSetExtraConfig() callconv(.naked) void {
|
||||
asm volatile (
|
||||
\\ jmp *%[addr]
|
||||
:
|
||||
: [addr] "r" (ptrGFSdkSetExtraConfig),
|
||||
);
|
||||
pub export fn GFSdkSetExtraConfig() callconv(.c) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
const std = @import("std");
|
||||
const interceptor = @import("interceptor.zig");
|
||||
const Il2cpp = @import("Il2cpp.zig");
|
||||
const proxy_exports = @import("proxy_exports.zig");
|
||||
|
||||
comptime {
|
||||
_ = @import("proxy_exports.zig");
|
||||
}
|
||||
|
||||
const windows = std.os.windows;
|
||||
const unicode = std.unicode;
|
||||
@@ -157,10 +160,6 @@ const WebRequestPatch = struct {
|
||||
|
||||
pub export fn DllMain(_: windows.HINSTANCE, reason: windows.DWORD, _: windows.LPVOID) callconv(.winapi) windows.BOOL {
|
||||
if (reason == DLL_PROCESS_ATTACH) {
|
||||
if (windows.kernel32.LoadLibraryW(unicode.utf8ToUtf16LeStringLiteral("gfsdk_original.dll"))) |lib| {
|
||||
proxy_exports.link(lib);
|
||||
}
|
||||
|
||||
const thread = std.Thread.spawn(.{}, onAttach, .{}) catch unreachable;
|
||||
thread.detach();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user