Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
HIllya51 committed Nov 30, 2024
1 parent 7812e10 commit 54670ea
Show file tree
Hide file tree
Showing 28 changed files with 143 additions and 348 deletions.
52 changes: 35 additions & 17 deletions .github/scripts/build_lunatranslator.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,21 @@ def downloadlr():
subprocess.run(f"curl -LO {LocaleRe}")
subprocess.run(f"7z x {LocaleRe.split('/')[-1]} -oLR")
os.makedirs(
f"{rootDir}/files/plugins/Locale_Remulator",
rf"{rootDir}\files\plugins\Locale\Locale_Remulator.1.5.4",
exist_ok=True,
)
for _dir, _, _fs in os.walk("LR"):
for f in _fs:
if f in ["LRHookx64.dll", "LRHookx32.dll"]:
if f in [
"LRHookx64.dll",
"LRHookx32.dll",
"LRConfig.xml",
"LRProc.exe",
"LRSubMenus.dll",
]:
shutil.move(
os.path.join(_dir, f),
f"{rootDir}/files/plugins/Locale_Remulator",
rf"{rootDir}\files\plugins\Locale\Locale_Remulator.1.5.4",
)


Expand All @@ -123,12 +129,15 @@ def downloadmecab():
subprocess.run(f"curl -LO {mylinks['mecab.zip']}")
subprocess.run(f"7z x mecab.zip -oALL")
move_directory_contents("ALL/ALL", f"{rootDir}/files/plugins")


def downloadmecabxp():
os.chdir(rootDir + "\\temp")
subprocess.run(f"curl -LO {mylinks['mecab_xp.zip']}")
subprocess.run(f"7z x mecab_xp.zip -oALL")
move_directory_contents("ALL/ALL", f"{rootDir}/files/plugins")


def downloadmapie():
os.chdir(rootDir + "\\temp")
subprocess.run(f"curl -LO {mylinks['magpie.zip']}")
Expand All @@ -140,28 +149,37 @@ def downloadLocaleEmulator():
os.chdir(rootDir + "\\temp")
subprocess.run(f"curl -LO {localeEmulatorFile}")
subprocess.run(f"7z x {localeEmulatorFile.split('/')[-1]} -oLocaleEmulator")
shutil.move(
"LocaleEmulator/LoaderDll.dll",
f"{rootDir}/files/plugins/LoaderDll.dll",
)
shutil.move(
"LocaleEmulator/LocaleEmulator.dll",
f"{rootDir}/files/plugins/LocaleEmulator.dll",

os.makedirs(
rf"{rootDir}\files\plugins\Locale\Locale.Emulator.2.5.0.1",
exist_ok=True,
)
for _dir, _, _fs in os.walk("LocaleEmulator"):
for f in _fs:
if f in [
"LoaderDll.dll",
"LocaleEmulator.dll",
"LEProc.exe",
"LEConfig.xml",
"LECommonLibrary.dll",
]:
shutil.move(
os.path.join(_dir, f),
rf"{rootDir}\files\plugins\Locale\Locale.Emulator.2.5.0.1",
)


def downloadNtlea():
os.chdir(rootDir + "\\temp")
subprocess.run(f"curl -LO {ntleaFile}")
subprocess.run(f"7z x {ntleaFile.split('/')[-1]} -ontlea")
shutil.move(
"ntlea/x86/ntleai.dll",
f"{rootDir}/files/plugins/NTLEAS/ntleai.dll",
)
shutil.move(
"ntlea/x64/ntleak.dll",
f"{rootDir}/files/plugins/NTLEAS/ntleak.dll",

os.makedirs(
rf"{rootDir}\files\plugins\Locale\ntleas046_x64",
exist_ok=True,
)
shutil.copytree("ntlea/x86", rf"{rootDir}\files\plugins\Locale\ntleas046_x64\x86")
shutil.copytree("ntlea/x64", rf"{rootDir}\files\plugins\Locale\ntleas046_x64\x64")


def downloadCurl():
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
[submodule "src/plugins/libs/tinymp3"]
path = cpp/libs/tinymp3
url = https://github.com/HIllya51/tinymp3
[submodule "src/plugins/libs/Detours"]
path = cpp/libs/Detours
url = https://github.com/microsoft/Detours
[submodule "src/plugins/libs/Clipper2"]
path = cpp/libs/Clipper2
url = https://github.com/AngusJohnson/Clipper2
Expand Down
1 change: 0 additions & 1 deletion cpp/libs/Detours
Submodule Detours deleted from e4bfd6
4 changes: 2 additions & 2 deletions cpp/libs/libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ option(IS_LUNAHOOK "IS_LUNAHOOK" OFF)
if(IS_LUNAHOOK)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/minhook ${CMAKE_BINARY_DIR}/minhook)
else()
add_library(Detours ${CMAKE_CURRENT_LIST_DIR}/Detours/src/creatwth.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/detours.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/modules.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/disasm.cpp)
target_include_directories(Detours PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Detours/src)
# add_library(Detours ${CMAKE_CURRENT_LIST_DIR}/Detours/src/creatwth.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/detours.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/modules.cpp ${CMAKE_CURRENT_LIST_DIR}/Detours/src/disasm.cpp)
# target_include_directories(Detours PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Detours/src)

add_library(wil INTERFACE)
target_include_directories(wil INTERFACE ${CMAKE_CURRENT_LIST_DIR}/wil/include)
Expand Down
6 changes: 3 additions & 3 deletions cpp/shareddllproxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ generate_product_version(
VERSION_PATCH ${VERSION_PATCH}
)

set(shareddllproxy_common shareddllproxy.cpp dllinject.cpp ntleas.cpp aspatch.cpp update.cpp ${versioninfo})
set(shareddllproxy_common shareddllproxy.cpp dllinject.cpp aspatch.cpp update.cpp ${versioninfo})

if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
add_executable(shareddllproxy ${shareddllproxy_common})

else()
add_executable(shareddllproxy ${shareddllproxy_common} Atlas.cpp eztrans.cpp dreye.cpp jbj7.cpp kingsoft.cpp le.cpp neospeech.cpp ../implsapi.cpp LR.cpp)
add_executable(shareddllproxy ${shareddllproxy_common} Atlas.cpp eztrans.cpp dreye.cpp jbj7.cpp kingsoft.cpp neospeech.cpp ../implsapi.cpp)
add_subdirectory(voiceroid2)
endif()

Expand All @@ -28,6 +28,6 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy64")
else()
target_precompile_headers(voiceroid2 REUSE_FROM pch)
target_link_libraries(shareddllproxy nlohmann Mfplat mfuuid voiceroid2 Detours)
target_link_libraries(shareddllproxy nlohmann Mfplat mfuuid voiceroid2)
set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy32")
endif()
6 changes: 0 additions & 6 deletions cpp/shareddllproxy/shareddllproxy.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
#pragma comment(linker, "/subsystem:windows /entry:wmainCRTStartup")

int dllinjectwmain(int argc, wchar_t *argv[]);
int ntleaswmain(int argc, wchar_t *wargv[]);
int updatewmain(int argc, wchar_t *wargv[]);
bool checkisapatch();
#ifndef _WIN64
// int mainmp3(int argc, wchar_t *argv[]);
int LRwmain(int argc, wchar_t *argv[]);
int jbjwmain(int argc, wchar_t *argv[]);
int dreyewmain(int argc, wchar_t *argv[]);
int kingsoftwmain(int argc, wchar_t *argv[]);
int voiceroid2wmain(int argc, wchar_t *argv[]);
int lewmain(int argc, wchar_t *argv[]);
int neospeech(int argc, wchar_t *argv[]);
int neospeechlist(int argc, wchar_t *argv[]);
int eztrans(int argc, wchar_t *argv[]);
Expand Down Expand Up @@ -62,13 +59,10 @@ int wmain(int argc, wchar_t *argv[])
typedef int (*wmaint)(int, wchar_t **);
std::map<std::wstring, wmaint> fm = {
{L"dllinject", dllinjectwmain},
{L"ntleas", ntleaswmain},
{L"listpm", listprocessmodule},
{L"update", updatewmain},
#ifndef _WIN64
// {L"mainmp3", mainmp3},
{L"LR", LRwmain},
{L"le", lewmain},
{L"jbj7", jbjwmain},
{L"dreye", dreyewmain},
{L"kingsoft", kingsoftwmain},
Expand Down
Loading

0 comments on commit 54670ea

Please sign in to comment.