Skip to content

Commit

Permalink
update luajit
Browse files Browse the repository at this point in the history
  • Loading branch information
fesily committed Jul 18, 2024
1 parent 8aa0a43 commit 1da2cb2
Show file tree
Hide file tree
Showing 10 changed files with 1,594 additions and 1,413 deletions.
2 changes: 1 addition & 1 deletion Mod/bin64/windows/signatures_client.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Mod/bin64/windows/signatures_server.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion luajit
701 changes: 0 additions & 701 deletions src/Signatures_client.txt

This file was deleted.

701 changes: 0 additions & 701 deletions src/Signatures_server.txt

This file was deleted.

177 changes: 177 additions & 0 deletions tests/bug1.lua

Large diffs are not rendered by default.

701 changes: 701 additions & 0 deletions tests/windows_x64/Signatures_client.txt

Large diffs are not rendered by default.

701 changes: 701 additions & 0 deletions tests/windows_x64/Signatures_server.txt

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions tools/Checker/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define NOMINMAX

#include "frida-gum.h"
#include "SignatureJson.hpp"
#include "frida-gum.h"

#include "LuaModule.hpp"
#include "platform.hpp"
Expand Down Expand Up @@ -44,15 +44,17 @@ int check(const char *path, bool isClient) {
fprintf(stderr, "%s", "can find lua module base addr\n");
return 1;
}

using namespace std::literals;
SignatureJson sjCopy{isClient};
sjCopy.file_path = "F:\\dontstarveluajit2\\ida.json";
auto p = std::filesystem::path{PROJECT_DIR} / "tests" / "windows_x64" / (("Signatures_"s + (isClient ? "client" : "server")) + ".txt.json");
sjCopy.file_path = p.string();
auto sCopy = sjCopy.read_from_signatures().value();

auto count = 0;
for (auto [func, info]: signatures.funcs) {
if (sCopy.funcs.at(func).offset != info.offset) {
fprintf(stderr, "[%s]%s", func.c_str(), "can't match the address");
const auto ida_offset = sCopy.funcs.at(func).offset;
if (ida_offset != info.offset) {
fprintf(stderr, "[%s]%s [%d]-[%d]\n", func.c_str(), "can't match the address", (int) ida_offset, (int) info.offset);
count++;
}
}
Expand All @@ -70,5 +72,5 @@ int main() {
return 1;
set_worker_directory(worker_dir);
SignatureJson::version_path = GAMEDIR "/version.txt";
return check(game_server_path, false);
return check(game_path, true) + check(game_server_path, false);
}
6 changes: 4 additions & 2 deletions tools/Signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
current_game_version = util.read_version()
argparser = argparse.ArgumentParser()
argparser.add_argument("input")
argparser.add_argument("output")
argparser.add_argument("--output", required=False)
missfuncs = set()
with open("src/missfunc.txt", "r") as f:
for line in f:
Expand Down Expand Up @@ -55,6 +55,8 @@ def generator(input, output):

with open(output, mode='w+') as f:
f.write(json.dumps({'version': int(current_game_version), 'funcs':outputs}))

myargs = argparser.parse_args()
if myargs.output is None:
myargs.output = myargs.input + ".json"
generator(myargs.input, myargs.output)

0 comments on commit 1da2cb2

Please sign in to comment.