Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
HIllya51 committed Dec 3, 2024
1 parent ea2a650 commit 987a4eb
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions cpp/LunaHook/LunaHook/engine64/vita3k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace
auto idxDescriptor = isVirtual == true ? 2 : 1;
auto idxEntrypoint = idxDescriptor + 1;
std::string Vita3KGameID;
std::atomic<uintptr_t> unindexablehooks_near = 0;
uintptr_t getDoJitAddress()
{
// Vita3K\external\dynarmic\src\dynarmic\backend\x64\emit_x64.h
Expand Down Expand Up @@ -38,7 +37,6 @@ namespace
const char *_id;
};
std::unordered_map<uintptr_t, emfuncinfo> emfunctionhooks;
std::unordered_map<std::string, std::function<bool(uintptr_t)>> unindexablehooks;
}

namespace
Expand Down Expand Up @@ -79,28 +77,7 @@ namespace
return;
Vita3KGameID = wcasta(curr);
last = curr;
HostInfo(HOSTINFO::EmuGameName, WideStringToString(game).c_str());
for (auto &&[id, ptr] : unindexablehooks)
{
if (id == Vita3KGameID)
{
HookParam hp;
static int __fake = 0x10;
hp.address = __fake++;
hp.type = DIRECT_READ;
hp.user_value = (uintptr_t)&ptr;
hp.text_fun = [](hook_stack *stack, HookParam *hp, TextBuffer *buffer, uintptr_t *split)
{
auto __ = unindexablehooks_near.load();
if (!__)
return;
if ((*((decltype(ptr) *)hp->user_value))(__))
hp->type |= HOOK_EMPTY;
};
NewHook(hp, (id + " Loader").c_str());
}
}
return;
return HostInfo(HOSTINFO::EmuGameName, WideStringToString(game).c_str());
}
};
hp.type = DIRECT_READ;
Expand All @@ -123,7 +100,6 @@ bool vita3k::attach_function()
{
auto descriptor = *argidx(stack, idxDescriptor + 1); // r8
auto entrypoint = *argidx(stack, idxEntrypoint + 1); // r9
unindexablehooks_near.store(entrypoint);
auto em_address = *(uint32_t *)descriptor;
if (em_address < 0x80000000)
em_address += 0x80000000; // 0.1.9 3339
Expand Down Expand Up @@ -522,7 +498,6 @@ namespace

auto _ = []()
{
unindexablehooks = {};
emfunctionhooks = {
// 追放選挙
{0x8002e176, {0, 0, 0, 0, FPCSG01023, "PCSG01023"}}, // dialogue+name,sjis
Expand Down

0 comments on commit 987a4eb

Please sign in to comment.