diff --git a/src/pe_editor/PeEditor.cpp b/src/pe_editor/PeEditor.cpp index 526a5a7..b2ab4bf 100644 --- a/src/pe_editor/PeEditor.cpp +++ b/src/pe_editor/PeEditor.cpp @@ -155,12 +155,7 @@ int generateLibFile() { std::vector VarExports; std::ranges::for_each(filteredSymbols, [&](const PdbSymbol& symbol) { llvm::object::COFFShortExport record; - - if (auto fakeSymbol = pe_editor::FakeSymbol::getFakeSymbol(symbol.name); fakeSymbol) { - record.Name = *fakeSymbol; - } else { - record.Name = symbol.name; - } + record.Name = pe_editor::FakeSymbol::getFakeSymbol(symbol.name).value_or(symbol.name); if (!symbol.isFunction) { VarExports.push_back(record); } else { @@ -274,14 +269,18 @@ int generateModdedBds() { | std::views::transform([](const exported_function& fn) { return fn.get_name(); }); std::ranges::copy(names, std::inserter(exportedFunctionsNames, exportedFunctionsNames.end())); - auto filtered = data::filteredSymbols | std::views::filter([&](const PdbSymbol& symbol) { - return !symbol.isFunction && !exportedFunctionsNames.contains(symbol.name); - }); + auto filtered = + data::filteredSymbols | std::views::filter([&](const PdbSymbol& symbol) { return !symbol.isFunction; }); for (const auto& symbol : filtered) { - exportedFunctionsNames.insert(symbol.name); + auto fakeSymbol = pe_editor::FakeSymbol::getFakeSymbol(symbol.name).value_or(symbol.name); + if (exportedFunctionsNames.contains(fakeSymbol)) { + continue; + } + exportedFunctionsNames.insert(fakeSymbol); exported_function func; - func.set_name(symbol.name); + + func.set_name(fakeSymbol); func.set_rva(symbol.rva); func.set_ordinal(exportOrdinal++); if (exportOrdinal > 65535) { @@ -322,7 +321,7 @@ int generateModdedBds() { moddedBds.close(); originBds.file.close(); - logger->info("Generated modified BDS executable file successfully."); + logger->info("Generated modified BDS executable file successfully. Exported {} symbols.", exportOrdinal); if (!config::backupBds) { return 0; diff --git a/tooth.json b/tooth.json index ad6bd74..5424247 100644 --- a/tooth.json +++ b/tooth.json @@ -1,14 +1,14 @@ { "format_version": 2, "tooth": "github.com/LiteLDev/PeEditor", - "version": "3.6.1", + "version": "3.7.0", "info": { "name": "PeEditor", "description": "A tool to inject PreLoader to Minecraft Bedrock Dedicated Server", "author": "LiteLDev", "tags": [] }, - "asset_url": "https://github.com/LiteLDev/PeEditor/releases/download/v3.6.1/peeditor-v3.6.1-windows-amd64.zip", + "asset_url": "https://github.com/LiteLDev/PeEditor/releases/download/v3.7.0/peeditor-v3.7.0-windows-amd64.zip", "files": { "place": [ { @@ -17,4 +17,4 @@ } ] } -} +} \ No newline at end of file diff --git a/xmake-requires.lock b/xmake-requires.lock index 0191439..3a94994 100644 --- a/xmake-requires.lock +++ b/xmake-requires.lock @@ -9,7 +9,7 @@ commit = "ce583d1736cf4ea43cc0c137e0d45671a446dc4a", url = "https://github.com/xmake-io/xmake-repo.git" }, - version = "3.23.1" + version = "3.29.2" }, ["ctre#31fecfc4"] = { repo = {