Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #219 from PoiDoe/master
Browse files Browse the repository at this point in the history
Updates to some mods
  • Loading branch information
cursey authored Apr 29, 2022
2 parents ef70f83 + 1bd430c commit 3fd2f02
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 36 deletions.
24 changes: 12 additions & 12 deletions Kanan/CookingMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ namespace kanan {
{
mov eax, 00000000
mov esi, [cookingOne]
mov[edi + eax * 4 + 0x000001AC], esi
mov[edi + eax * 4 + 0x0000020C], esi
mov eax, 00000001
mov esi, [cookingTwo]
mov[edi + eax * 4 + 0x000001AC], esi
mov[edi + eax * 4 + 0x0000020C], esi
mov eax, 00000002
mov esi, [cookingThree]
mov[edi + eax * 4 + 0x000001AC], esi
mov[edi + eax * 4 + 0x0000020C], esi
ret

}
Expand Down Expand Up @@ -86,7 +86,7 @@ namespace kanan {

//find the addresses we need for patching
CookingMod::CookingMod() {
auto cookingAddress = scan("client.exe", "0F 83 ? ? ? ? 8B 75 ? 8D 04");
auto cookingAddress = scan("client.exe", "55 8B EC 6A ? 68 ? ? ? ? 64 ? ? ? ? ? ? ? ? ? 80 22 ? 03 33 C5 50 8D ? F4 64 ? ? ? ? ? ? ? ? ? 14 ? 00 00");
DWORD cookingAddresst = *cookingAddress;
if (!cookingAddresst) {
log("unable to find cooking address");
Expand All @@ -97,13 +97,13 @@ namespace kanan {

if (cookingAddresst) {

addressOfCooking = cookingAddresst + 33;
addressOfCooking = cookingAddresst + 95;
log("Address of func to change @ %p", addressOfCooking);

}
}


//imgui ui stuff
void CookingMod::onUI() {
if (ImGui::CollapsingHeader("Cooking mod"))
Expand Down Expand Up @@ -132,15 +132,15 @@ namespace kanan {
//apply or remove our patch
void CookingMod::applycook(bool m_cooking_is_enabled) {
if (m_cooking_is_enabled) {
log("Cooking applying patch");
//inject our custom cooking asm
Hookcall((void*)addressOfCooking, HookForCooking, 7);
log("Cooking applying patch");
//inject our custom cooking asm
Hookcall((void*)addressOfCooking, HookForCooking, 7);

}
else if (!m_cooking_is_enabled) {
log("Cooking removing patch");
//patch back to default
Patchmem((BYTE*)(addressOfCooking), (BYTE*)"\x01\xb4\x87\xAC\x01\x00\x00", 7);
log("Cooking removing patch");
//patch back to default
Patchmem((BYTE*)(addressOfCooking), (BYTE*)"\x01\xb4\x87\x0C\x02\x00\x00", 7);
}
}

Expand Down
70 changes: 46 additions & 24 deletions Kanan/Patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,14 +973,9 @@
"category": "Graphics",
"patches": [
{
"pattern": "8B 10 8B C8 8B 42 04 FF D0 84 C0 0F 84 EE 09 00 00 8B 0E",
"offset": 11,
"patch": "90 90 90 90 90 90"
},
{
"pattern": "FF D0 3A C3 0F 85",
"offset": 4,
"patch": "90 E9"
"pattern": "8B C8 8B 10 8B 42 ? FF D0 84 C0 0F 85 ? ? ? ? 64",
"offset": 7,
"patch": "B0 01"
}
]
},
Expand All @@ -989,14 +984,46 @@
"desc": "Shows FPS and other game performance infos",
"category": "Graphics",
"patches": [
{
"pattern": "8B 10 8B C8 8B 42 04 FF D0 84 C0 0F 84 EE 09 00 00 8B 0E",
"offset": 11,
"patch": "90 90 90 90 90 90"
},
{
"pattern": "FF D0 84 C0 0F 84 AD 08 00 00 2B 3D",
"patch": "90 90"
{
"pattern": "8B C8 8B 10 8B 52 ? FF D2 84 C0 0F 84 ? ? ? ? 8B C7",
"offset": 7,
"patch": "B0 01"
}
]
},
{
"name": "Disable character rendering",
"desc": "",
"category": "Graphics",
"patches": [
{
"pattern": "8B C8 8B 10 8B 42 ? FF D0 84 C0 0F 84 ? ? ? ? 8B 9F",
"offset": 56,
"patch": "EB"
}
]
},
{
"name": "Disable prop rendering",
"desc": "",
"category": "Graphics",
"patches": [
{
"pattern": "8B C8 8B 10 8B 42 ? FF D0 84 C0 0F 84 ? ? ? ? 8B 9F",
"offset": 125,
"patch": "EB"
}
]
},
{
"name": "shadows and clouds",
"desc": "shows some screens that show details about clouds and shadows",
"category": "Graphics",
"patches": [
{
"pattern": "8B C8 8B 10 8B 42 ? B0 ? 84 C0 0F 84 ? ? ? ? 8B 4E",
"offset": 7,
"patch": "B0 01"
}
]
},
Expand All @@ -1023,14 +1050,9 @@
"category": "Graphics",
"patches": [
{
"pattern": "8B 10 8B C8 8B 42 04 FF D0 84 C0 0F 84 EE 09 00 00 8B 0E",
"offset": 11,
"patch": "90 90 90 90 90 90"
},
{
"pattern": "8B 42 04 FF D0 84 C0 74 40 8B 0E",
"offset": 3,
"patch": "90 90"
"pattern": "8B C8 8B 10 8B 42 ? FF D0 84 C0 0F 84 ? ? ? ? 8B 4F ? E8",
"offset": 7,
"patch": "B0 01"
}
]
},
Expand Down

0 comments on commit 3fd2f02

Please sign in to comment.