Skip to content

Commit

Permalink
nvm javahook still doesn't work
Browse files Browse the repository at this point in the history
Disabled aimassist and autoclicker while in gui
  • Loading branch information
Lefraudeur committed Nov 2, 2023
1 parent df28477 commit dff09dc
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Ripterms Ghost.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
<ClCompile Include="net\minecraft\block\state\IBlockState.cpp" />
<ClCompile Include="net\minecraft\client\entity\AbstractClientPlayer\AbstractClientPlayer.cpp" />
<ClCompile Include="net\minecraft\client\entity\EntityPlayerSP\EntityPlayerSP.cpp" />
<ClCompile Include="net\minecraft\client\gui\GuiScreen\GuiScreen.cpp" />
<ClCompile Include="net\minecraft\client\Minecraft\Minecraft.cpp" />
<ClCompile Include="net\minecraft\client\multiplayer\PlayerControllerMP\PlayerControllerMP.cpp" />
<ClCompile Include="net\minecraft\client\multiplayer\WorldClient\WorldClient.cpp" />
Expand Down Expand Up @@ -249,6 +250,7 @@
<ClInclude Include="net\minecraft\block\state\IBlockState.h" />
<ClInclude Include="net\minecraft\client\entity\AbstractClientPlayer\AbstractClientPlayer.h" />
<ClInclude Include="net\minecraft\client\entity\EntityPlayerSP\EntityPlayerSP.h" />
<ClInclude Include="net\minecraft\client\gui\GuiScreen\GuiScreen.h" />
<ClInclude Include="net\minecraft\client\Minecraft\Minecraft.h" />
<ClInclude Include="net\minecraft\client\multiplayer\PlayerControllerMP\PlayerControllerMP.h" />
<ClInclude Include="net\minecraft\client\multiplayer\WorldClient\WorldClient.h" />
Expand Down
6 changes: 6 additions & 0 deletions Ripterms Ghost.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@
<ClCompile Include="Ripterms\Hook\JavaHook.cpp">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="net\minecraft\client\gui\GuiScreen\GuiScreen.cpp">
<Filter>Fichiers sources</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Ripterms\Ripterms.h">
Expand Down Expand Up @@ -365,5 +368,8 @@
<ClInclude Include="java\nio\IntBuffer\IntBuffer.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
<ClInclude Include="net\minecraft\client\gui\GuiScreen\GuiScreen.h">
<Filter>Fichiers d%27en-tête</Filter>
</ClInclude>
</ItemGroup>
</Project>
11 changes: 11 additions & 0 deletions Ripterms/Mappings/mappings_forge_1_7_10.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ R"(
"obfuscated": "field_71442_b",
"signature": "Lnet/minecraft/client/multiplayer/PlayerControllerMP;",
"static": false
},
{
"name": "currentScreen",
"obfuscated": "field_71462_r",
"signature": "Lnet/minecraft/client/gui/GuiScreen;",
"static": false
}
],
"methods": [
Expand Down Expand Up @@ -757,6 +763,11 @@ R"(
"static": false
}
]
},
"net/minecraft/client/gui/GuiScreen": {
"obfuscated": "net/minecraft/client/gui/GuiScreen",
"fields": [],
"methods": []
}
}
)";
Expand Down
11 changes: 11 additions & 0 deletions Ripterms/Mappings/mappings_lunar_1_16_5.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ R"(
"obfuscated": "gameMode",
"signature": "Lnet/minecraft/client/multiplayer/MultiPlayerGameMode;",
"static": false
},
{
"name": "currentScreen",
"obfuscated": "screen",
"signature": "Lnet/minecraft/client/gui/screens/Screen;",
"static": false
}
],
"methods": [
Expand Down Expand Up @@ -693,6 +699,11 @@ R"(
"static": false
}
]
},
"net/minecraft/client/gui/GuiScreen": {
"obfuscated": "net/minecraft/client/gui/screens/Screen",
"fields": [],
"methods": []
}
}
)";
Expand Down
11 changes: 11 additions & 0 deletions Ripterms/Mappings/mappings_lunar_1_7_10.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ R"(
"obfuscated": "playerController",
"signature": "Lnet/minecraft/client/multiplayer/PlayerControllerMP;",
"static": false
},
{
"name": "currentScreen",
"obfuscated": "currentScreen",
"signature": "Lnet/minecraft/client/gui/GuiScreen;",
"static": false
}
],
"methods": [
Expand Down Expand Up @@ -745,6 +751,11 @@ R"(
"static": false
}
]
},
"net/minecraft/client/gui/GuiScreen": {
"obfuscated": "net/minecraft/client/gui/GuiScreen",
"fields": [],
"methods": []
}
}
)";
Expand Down
11 changes: 11 additions & 0 deletions Ripterms/Mappings/mappings_lunar_1_8_9.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ R"(
"obfuscated": "playerController",
"signature": "Lnet/minecraft/client/multiplayer/PlayerControllerMP;",
"static": false
},
{
"name": "currentScreen",
"obfuscated": "currentScreen",
"signature": "Lnet/minecraft/client/gui/GuiScreen;",
"static": false
}
],
"methods": [
Expand Down Expand Up @@ -768,6 +774,11 @@ R"(
"static": false
}
]
},
"net/minecraft/client/gui/GuiScreen": {
"obfuscated": "net/minecraft/client/gui/GuiScreen",
"fields": [],
"methods": []
}
}
)";
Expand Down
11 changes: 11 additions & 0 deletions Ripterms/Mappings/mappings_vanilla_1_8_9.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ R"(
"obfuscated": "c",
"signature": "Lbda;",
"static": false
},
{
"name": "currentScreen",
"obfuscated": "m",
"signature": "Laxu;",
"static": false
}
],
"methods": [
Expand Down Expand Up @@ -768,6 +774,11 @@ R"(
"static": false
}
]
},
"net/minecraft/client/gui/GuiScreen": {
"obfuscated": "axu",
"fields": [],
"methods": []
}
}
)";
Expand Down
2 changes: 1 addition & 1 deletion Ripterms/Modules/AimAssist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
void Ripterms::Modules::AimAssist::run()
{
static EntityPlayer prev_selected_target{};
if (!enabled || !(GetKeyState(VK_LBUTTON) & 0x8000) || GUI::draw)
if (!enabled || !(GetKeyState(VK_LBUTTON) & 0x8000) || GUI::draw || cache->theMinecraft.getCurrentScreen().isValid())
{
prev_selected_target.clear();
return;
Expand Down
2 changes: 1 addition & 1 deletion Ripterms/Modules/LeftClicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
void Ripterms::Modules::LeftClicker::run()
{
static CTimer timer(std::chrono::milliseconds(1000/min_cps));
if (!enabled || Ripterms::GUI::draw || !(GetKeyState(VK_LBUTTON) & 0x8000))
if (!enabled || Ripterms::GUI::draw || !(GetKeyState(VK_LBUTTON) & 0x8000) || cache->theMinecraft.getCurrentScreen().isValid())
return;
if (!timer.isElapsed())
return;
Expand Down
3 changes: 1 addition & 2 deletions Ripterms/Modules/Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

static void callback(const Ripterms::JavaHook::JavaParameters& params)
{
EntityPlayer a(params.get_jobject_at(0));
std::cout << a.getPosition().x << std::endl;
std::cout << "ha" << std::endl;
}

void Ripterms::Modules::Test::renderGUI()
Expand Down
7 changes: 7 additions & 0 deletions net/minecraft/client/Minecraft/Minecraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ Timer Minecraft::getTimer()
return Timer(env->GetObjectField(instance, MinecraftClass.getFieldID("timer")), env);
}

GuiScreen Minecraft::getCurrentScreen()
{
if (!instance)
return GuiScreen(env);
return GuiScreen(env->GetObjectField(instance, MinecraftClass.getFieldID("currentScreen")), env);
}

int Minecraft::getRightClickDelayTimer()
{
if (!instance) return 0;
Expand Down
2 changes: 2 additions & 0 deletions net/minecraft/client/Minecraft/Minecraft.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "../../util/MovingObjectPosition/MovingObjectPosition.h"
#include "../../util/Timer/Timer.h"
#include "../multiplayer/PlayerControllerMP/PlayerControllerMP.h"
#include "../gui/GuiScreen/GuiScreen.h"

class Minecraft : public Object {
public:
Expand All @@ -19,6 +20,7 @@ class Minecraft : public Object {
MovingObjectPosition getObjectMouseOver();
Entity getPointedEntity();
Timer getTimer();
GuiScreen getCurrentScreen();
int getRightClickDelayTimer();
void clickMouse();

Expand Down
1 change: 1 addition & 0 deletions net/minecraft/client/gui/GuiScreen/GuiScreen.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "GuiScreen.h"
10 changes: 10 additions & 0 deletions net/minecraft/client/gui/GuiScreen/GuiScreen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once
#include "../../../../../java/lang/Object/Object.h"

class GuiScreen : public Object
{
public:
using Object::Object;
protected:
inline static Ripterms::JavaClassV2 GuiScreenClass{ "net/minecraft/client/gui/GuiScreen" };
};

0 comments on commit dff09dc

Please sign in to comment.