This commit is contained in:
恍兮惚兮 2024-05-06 22:56:24 +08:00
parent eb50325e76
commit 5067397fc4
30 changed files with 45 additions and 76 deletions

View File

@ -4,8 +4,6 @@
#include"main.h" #include"main.h"
#include"detours.h" #include"detours.h"
#include"hijackfuns.h" #include"hijackfuns.h"
#include"winevent.hpp"
#include"defs.h"
#include"stringfilters.h" #include"stringfilters.h"
#include"util.h" #include"util.h"
DynamicShiftJISCodec *dynamiccodec=new DynamicShiftJISCodec(932); DynamicShiftJISCodec *dynamiccodec=new DynamicShiftJISCodec(932);

View File

@ -1,7 +1,5 @@
#ifndef __LUNA_EMBED_ENGINE_H #ifndef __LUNA_EMBED_ENGINE_H
#define __LUNA_EMBED_ENGINE_H #define __LUNA_EMBED_ENGINE_H
#include"types.h"
#include "texthook.h"
#include"dyncodec/dynsjiscodec.h" #include"dyncodec/dynsjiscodec.h"
extern EmbedSharedMem *embedsharedmem; extern EmbedSharedMem *embedsharedmem;

View File

@ -9,7 +9,6 @@
#include"pchooks/pchooks.h" #include"pchooks/pchooks.h"
#include "disasm/disasm.h" #include "disasm/disasm.h"
#include"main.h" #include"main.h"
#include"const.h"
extern WCHAR* processName, processPath[MAX_PATH],processName_lower[MAX_PATH]; // cached extern WCHAR* processName, processPath[MAX_PATH],processName_lower[MAX_PATH]; // cached
extern uintptr_t processStartAddress, processStopAddress; extern uintptr_t processStartAddress, processStopAddress;

View File

@ -2,8 +2,6 @@
#include"embed_util.h" #include"embed_util.h"
#include"main.h" #include"main.h"
#include"stackoffset.hpp" #include"stackoffset.hpp"
#include"types.h"
#include"defs.h"
#include <windows.h> #include <windows.h>
#include <shlobj.h> #include <shlobj.h>
#include <dwrite.h> #include <dwrite.h>

View File

@ -1,4 +1,3 @@
#include"types.h"
#include"python.h" #include"python.h"
#include"main.h" #include"main.h"
#include"stackoffset.hpp" #include"stackoffset.hpp"

View File

@ -1,7 +1,5 @@
#include"python.h" #include"python.h"
#include"types.h"
#include"main.h" #include"main.h"
#include"defs.h"
namespace { namespace {
#define PyUnicode_IS_READY(op) 1 #define PyUnicode_IS_READY(op) 1
#define PyUnicode_Check(op) 1 #define PyUnicode_Check(op) 1

View File

@ -1,7 +1,3 @@
#include"common.h"
#include"defs.h"
#include"types.h"
#include"main.h" #include"main.h"
#include"v8.h" #include"v8.h"
#include"embed_util.h" #include"embed_util.h"

View File

@ -1,5 +1,4 @@
#include "hookfinder.h" #include "hookfinder.h"
#include "defs.h"
#include "main.h" #include "main.h"
#include "util.h" #include "util.h"
#include "MinHook.h" #include "MinHook.h"

View File

@ -1,6 +1,4 @@
#pragma once #pragma once
#include "types.h"
void SearchForText(wchar_t* text, UINT codepage); void SearchForText(wchar_t* text, UINT codepage);
void SearchForHooks(SearchParam sp); void SearchForHooks(SearchParam sp);

View File

@ -4,12 +4,9 @@
// 8/24/2013 TODO: Clean up this file // 8/24/2013 TODO: Clean up this file
#include "main.h" #include "main.h"
#include "defs.h"
#include "texthook.h"
#include "hookfinder.h" #include "hookfinder.h"
#include "util.h" #include "util.h"
#include "MinHook.h" #include "MinHook.h"
#include"hookcode.h"
#include"Lang/Lang.h" #include"Lang/Lang.h"
void Hijack(); void Hijack();
void detachall(); void detachall();

View File

@ -4,7 +4,6 @@
// 8/23/2013 jichi // 8/23/2013 jichi
// Branch: ITH/IHF_DLL.h, rev 66 // Branch: ITH/IHF_DLL.h, rev 66
#include "types.h"
void TextOutput(ThreadParam tp, TextOutput_T (*buffer), int len); void TextOutput(ThreadParam tp, TextOutput_T (*buffer), int len);
void ConsoleOutput(LPCSTR text, ...); void ConsoleOutput(LPCSTR text, ...);

View File

@ -1,4 +1,3 @@
#include"texthook.h"
enum class regs enum class regs
{ {
_flags, _flags,

View File

@ -3,7 +3,6 @@
// Branch: LUNA_HOOK_DLL/texthook.cpp, rev 128 // Branch: LUNA_HOOK_DLL/texthook.cpp, rev 128
// 8/24/2013 TODO: Clean up this file // 8/24/2013 TODO: Clean up this file
#include"embed_util.h" #include"embed_util.h"
#include "texthook.h"
#include "main.h" #include "main.h"
#include "ithsys/ithsys.h" #include "ithsys/ithsys.h"
#include "MinHook.h" #include "MinHook.h"

View File

@ -7,7 +7,6 @@
// - Move my old create remote thread for ITH2 here // - Move my old create remote thread for ITH2 here
#include "ithsys/ithsys.h" #include "ithsys/ithsys.h"
#include "const.h"
/** /**
* Return the address of the first matched pattern. * Return the address of the first matched pattern.

View File

@ -1,4 +1,3 @@
#include "texthook.h"
#include "cpputil/cppcstring.h" #include "cpputil/cppcstring.h"
void CharReplacer(char *str, size_t *size, char fr, char to); void CharReplacer(char *str, size_t *size, char fr, char to);
void CharReplacer(wchar_t *str, size_t *size, wchar_t fr, wchar_t to); void CharReplacer(wchar_t *str, size_t *size, wchar_t fr, wchar_t to);

View File

@ -5,7 +5,6 @@
#include<thread> #include<thread>
#include<fstream> #include<fstream>
#include"host.h" #include"host.h"
#include"hookcode.h"
#include"textthread.h" #include"textthread.h"
#include"LunaHost.h" #include"LunaHost.h"
#include"Lang/Lang.h" #include"Lang/Lang.h"

View File

@ -1,5 +1,4 @@
#include "host.h" #include "host.h"
#include "hookcode.h"
#include <io.h> #include <io.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,7 +1,4 @@
#include "host.h" #include "host.h"
#include "hookcode.h"
#include "defs.h"
#include "winevent.hpp"
#define C_LUNA_API extern "C" __declspec(dllexport) #define C_LUNA_API extern "C" __declspec(dllexport)
BOOL APIENTRY DllMain(HMODULE hModule, BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call, DWORD ul_reason_for_call,

View File

@ -1,7 +1,4 @@
#include "host.h" #include "host.h"
#include "defs.h"
#include "hookcode.h"
#include "texthook.h"
typedef LONG NTSTATUS; typedef LONG NTSTATUS;
#include"yapi.hpp" #include"yapi.hpp"
#include"Lang/Lang.h" #include"Lang/Lang.h"

View File

@ -1,7 +1,6 @@
#pragma once #pragma once
#include "textthread.h" #include "textthread.h"
#include"texthook.h"
namespace Host namespace Host
{ {
using ConsoleHandler =std::function<void(std::wstring&)>; using ConsoleHandler =std::function<void(std::wstring&)>;

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "types.h"
class TextThread class TextThread
{ {

View File

@ -1,4 +1,4 @@
add_library(pch hookcode.cpp common.cpp stringutils.cpp) add_library(pch hookcode.cpp pch.cpp stringutils.cpp)
target_precompile_headers(pch PUBLIC common.h) target_precompile_headers(pch PUBLIC pch.h)

View File

@ -1,5 +1,4 @@
#include "hookcode.h" 
namespace namespace
{ {
std::optional<HookParam> ParseRCode(std::wstring RCode) std::optional<HookParam> ParseRCode(std::wstring RCode)

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include "types.h"
namespace HookCode namespace HookCode
{ {
std::optional<HookParam> Parse(std::wstring code); std::optional<HookParam> Parse(std::wstring code);

41
include/pch.h Normal file
View File

@ -0,0 +1,41 @@
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <concrt.h>
#include <string>
#include <vector>
#include <deque>
#include <array>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <Psapi.h>
#include <functional>
#include <algorithm>
#include <regex>
#include <memory>
#include <optional>
#include <thread>
#include <mutex>
#include <atomic>
#include <filesystem>
#include <iostream>
#include <sstream>
#include <locale>
#include <cstdint>
#include <list>
#include <utility>
#include <cassert>
#include <variant>
#include"stringutils.h"
#include"utils.h"
#include"defs.h"
#include"const.h"
#include"types.h"
#include"hookcode.h"
#include"texthook.h"
#include"winevent.hpp"

View File

@ -203,8 +203,6 @@ std::wstring acastw(const std::string x){
xx+=c; xx+=c;
return xx; return xx;
} }
#include"const.h"
#include"types.h"
std::optional<std::wstring> commonparsestring(void* data,size_t length,void* php,DWORD df){ std::optional<std::wstring> commonparsestring(void* data,size_t length,void* php,DWORD df){
auto hp=(HookParam*)php; auto hp=(HookParam*)php;
if (hp->type & CODEC_UTF16) return std::wstring((wchar_t*)data, length / sizeof(wchar_t)); if (hp->type & CODEC_UTF16) return std::wstring((wchar_t*)data, length / sizeof(wchar_t));

View File

@ -7,7 +7,7 @@
// 8/24/2013 TODO: // 8/24/2013 TODO:
// - Clean up this file // - Clean up this file
// - Reduce global variables. Use namespaces or singleton classes instead. // - Reduce global variables. Use namespaces or singleton classes instead.
#include "types.h"
// Artikash 6/17/2019 TODO: These have the wrong values on x64 // Artikash 6/17/2019 TODO: These have the wrong values on x64
/** jichi 12/24/2014 /** jichi 12/24/2014

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "const.h"
class WinMutex // Like CMutex but works with scoped_lock class WinMutex // Like CMutex but works with scoped_lock
{ {

View File

@ -1,35 +1,5 @@
#pragma once #pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <concrt.h>
#include <string>
#include <vector>
#include <deque>
#include <array>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <Psapi.h>
#include <functional>
#include <algorithm>
#include <regex>
#include <memory>
#include <optional>
#include <thread>
#include <mutex>
#include <atomic>
#include <filesystem>
#include <iostream>
#include <sstream>
#include <locale>
#include <cstdint>
#include <list>
#include <utility>
#include <cassert>
#include <variant>
#include"stringutils.h"
#ifdef _WIN64 #ifdef _WIN64
constexpr bool x64 = true; constexpr bool x64 = true;
#else #else
@ -123,4 +93,3 @@ inline std::optional<std::wstring> GetModuleFilename(HMODULE module = NULL)
if (GetModuleFileNameW(module, buffer.data(), MAX_PATH)) return buffer.data(); if (GetModuleFileNameW(module, buffer.data(), MAX_PATH)) return buffer.data();
return {}; return {};
} }