Skip to content

Commit

Permalink
refactor: refactoring fakeSymbol
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Apr 24, 2024
1 parent 416acd6 commit 516de51
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 43 deletions.
15 changes: 0 additions & 15 deletions repository/packages/l/llvm-prebuilt/xmake.lua

This file was deleted.

25 changes: 11 additions & 14 deletions src/pe_editor/PeEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,20 @@ int generateLibFile() {
std::vector<llvm::object::COFFShortExport> VarExports;
std::ranges::for_each(filteredSymbols, [&](const PdbSymbol& symbol) {
llvm::object::COFFShortExport record;
record.Name = symbol.name;
if (!symbol.isFunction) {
VarExports.push_back(record);
return;
}
ApiExports.push_back(record);

auto fakeSymbol = pe_editor::FakeSymbol::getFakeSymbol(symbol.name);
if (fakeSymbol.has_value()) {
record.Name = fakeSymbol.value();
ApiExports.push_back(record);
if (auto fakeSymbol = pe_editor::FakeSymbol::getFakeSymbol(symbol.name); fakeSymbol) {
record.Name = *fakeSymbol;
} else {
record.Name = symbol.name;
}

fakeSymbol = pe_editor::FakeSymbol::getFakeSymbol(symbol.name, true);
if (fakeSymbol.has_value()) {
record.Name = fakeSymbol.value();
if (!symbol.isFunction) {
VarExports.push_back(record);
} else {
ApiExports.push_back(record);
if (auto removeVirtual = pe_editor::FakeSymbol::getFakeSymbol(symbol.name, true); removeVirtual) {
record.Name = *removeVirtual;
ApiExports.push_back(record);
}
}
});

Expand Down
21 changes: 11 additions & 10 deletions xmake-requires.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
["cmake#31fecfc4"] = {
repo = {
branch = "master",
commit = "fa285a31269c7a407167ff2942d1e1da5b4bbd81",
commit = "ce583d1736cf4ea43cc0c137e0d45671a446dc4a",
url = "https://github.com/xmake-io/xmake-repo.git"
},
version = "3.27.2-msvc1"
version = "3.23.1"
},
["ctre#31fecfc4"] = {
repo = {
branch = "master",
commit = "fde5c56447574e8a439233b846c6bf70177f99d4",
commit = "fa285a31269c7a407167ff2942d1e1da5b4bbd81",
url = "https://github.com/xmake-io/xmake-repo.git"
},
version = "3.4.1"
},
["cxxopts#31fecfc4"] = {
repo = {
branch = "master",
commit = "fde5c56447574e8a439233b846c6bf70177f99d4",
commit = "ce583d1736cf4ea43cc0c137e0d45671a446dc4a",
url = "https://github.com/xmake-io/xmake-repo.git"
},
version = "v3.0.0"
Expand All @@ -42,31 +42,32 @@
},
version = "9.1.0"
},
["llvm-prebuilt#31fecfc4"] = {
["llvm-prebuilt 18.1.1#31fecfc4"] = {
repo = {
url = "repository"
commit = "aebe837394493aceb38adc0858e59bbdf21d9ff0",
url = "https://github.com/LiteLDev/xmake-repo.git"
},
version = "14.0.6"
version = "18.1.1"
},
["pe_bliss#31fecfc4"] = {
repo = {
commit = "056b609c01e7e36436c4029f600cf8131b9c6954",
commit = "aebe837394493aceb38adc0858e59bbdf21d9ff0",
url = "https://github.com/LiteLDev/xmake-repo.git"
},
version = "v1.0.0"
},
["raw_pdb#31fecfc4"] = {
repo = {
branch = "master",
commit = "fa285a31269c7a407167ff2942d1e1da5b4bbd81",
commit = "ce583d1736cf4ea43cc0c137e0d45671a446dc4a",
url = "https://github.com/xmake-io/xmake-repo.git"
},
version = "2022.10.17"
},
["spdlog#31fecfc4"] = {
repo = {
branch = "master",
commit = "fde5c56447574e8a439233b846c6bf70177f99d4",
commit = "ce583d1736cf4ea43cc0c137e0d45671a446dc4a",
url = "https://github.com/xmake-io/xmake-repo.git"
},
version = "v1.11.0"
Expand Down
7 changes: 3 additions & 4 deletions xmake.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
add_rules("mode.debug", "mode.release")

set_policy("package.requires_lock", true)
add_repositories("local-repo repository")
add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")

add_requires("llvm-prebuilt")
add_requires("llvm-prebuilt 18.1.1")
add_requires("raw_pdb")
add_requires("cxxopts")
add_requires("fmt")
Expand All @@ -22,7 +21,7 @@ target("PeEditor")
set_symbols("debug")
add_files("src/**.cpp")
add_includedirs("src")
add_cxflags("/utf-8")
add_cxflags("/utf-8", "/EHa")
add_defines("UNICODE", "PE_EDITOR_VERSION=\"v3.4.1\"")
add_syslinks("user32", "comdlg32")
add_syslinks("wsock32", "comdlg32")
add_packages("llvm-prebuilt", "raw_pdb", "pe_bliss", "cxxopts", "fmt", "spdlog", "ctre", "demangler")

0 comments on commit 516de51

Please sign in to comment.