Skip to content

Commit

Permalink
Another go at fixing shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
muhopensores committed Feb 16, 2020
1 parent d1b6c8b commit 792c67a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ hacklibd.lib
hacklibd.pdb
MFReadWrite.exp
MFReadWrite.lib
MFReadWrite.pdb
MFReadWrite.pdb
MFReadWrited.exp
MFReadWrited.lib
MFReadWrited.pdb
15 changes: 11 additions & 4 deletions src/dmc5/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ class MyMain : public hl::Main
auto m_lodHook = m_hooker.hookJMP(lodLoc, 7, &lod_detour);
lod_jmpback = lodLoc + 7;

//m_shadowLoc = hl::FindPattern("84 C0 74 07 C6 83 ?? ?? ?? ?? ?? 80 BB ?? ?? ?? ?? ?? 74 1A 80 BB ?? ?? ?? ?? ??");
m_shadowLoc = hl::FindPattern("41 80 BE 79 01 00 00 00 ?? ?? ?? ?? ?? 94 00 00 00");
m_shadowLoc = hl::FindPattern("84 C0 74 07 C6 83 ?? ?? ?? ?? ?? 80 BB ?? ?? ?? ?? ?? 74 1A 80 BB ?? ?? ?? ?? ??");
m_shadowLoc2 = hl::FindPattern("0F 92 C0 80 BE 79 01 00 00 00 88 86 7A 01 00 00 0F 84 ?? ?? ?? ?? 80 7C 24 34 00 0F 84 ?? ?? ?? ?? 84 C0 0F 84 ?? ?? ?? ?? 41 8B 87 30 0E 00 00 48 8D 8E 70 01 00 00 41 8B D6");
//m_shadowLoc = hl::FindPattern("41 80 BE 79 01 00 00 00 ?? ?? ?? ?? ?? 94 00 00 00");
toggleShadowPatch(m_enableShadows);

uintptr_t aoLoc = hl::FindPattern("F3 44 0F 10 47 34 44 38 6F 30");
Expand Down Expand Up @@ -249,11 +250,15 @@ class MyMain : public hl::Main

void toggleShadowPatch(bool value) {
if (value) {
//m_shadowPatch.apply(m_shadowLoc, (const char*)&shadow_detour, 11);
m_shadowPatch.apply(m_shadowLoc, (const char*)&shadow_detour2, 8);
if (!m_shadowLoc || !m_shadowLoc2)
return;
m_shadowPatch.apply(m_shadowLoc, (const char*)&shadow_detour, 11);
m_shadowPatch2.apply(m_shadowLoc2, "\x31\xC0\x90", 3);
//m_shadowPatch.apply(m_shadowLoc, (const char*)&shadow_detour2, 8);
}
else {
m_shadowPatch.revert();
m_shadowPatch2.revert();
}
}

Expand Down Expand Up @@ -291,8 +296,10 @@ class MyMain : public hl::Main
bool m_enableIbl = false;
uintptr_t m_iblLoc = NULL;
uintptr_t m_shadowLoc = NULL;
uintptr_t m_shadowLoc2 = NULL;
hl::Patch m_iblPatch;
hl::Patch m_shadowPatch;
hl::Patch m_shadowPatch2;
hl::Hooker m_hooker;


Expand Down

0 comments on commit 792c67a

Please sign in to comment.