speed hacks and such, just pushing some work

master
xerox 4 years ago
parent 369b873942
commit 37a3c51a95

@ -5131,7 +5131,7 @@ namespace gamebase {
il2cpp::il2cpp_base() + 0x1D85B68))(this, _spritetype); il2cpp::il2cpp_base() + 0x1D85B68))(this, _spritetype);
} }
template <typename T = bool> T canbedamagedby(std::uintptr_t _pawn) { template <typename T = bool> T canbedamagedby(pawn* _pawn) {
return ((T(*)(pawn *, std::uintptr_t))(il2cpp::il2cpp_base() + return ((T(*)(pawn *, std::uintptr_t))(il2cpp::il2cpp_base() +
0x1D85C50))(this, _pawn); 0x1D85C50))(this, _pawn);
} }

@ -72,10 +72,6 @@ namespace gameengine {
template <typename T = void> static T create() { template <typename T = void> static T create() {
return ((T(*)(void *))(il2cpp::il2cpp_base() + 0x5F36F70))(0); return ((T(*)(void *))(il2cpp::il2cpp_base() + 0x5F36F70))(0);
} }
template <typename T = void> static T shutdown() {
return ((T(*)(void *))(il2cpp::il2cpp_base() + 0x5F370E8))(0);
}
}; };
} // namespace gameengine } // namespace gameengine

@ -41,9 +41,6 @@ namespace gameengine {
template <typename T = bool> T &serverusability() { template <typename T = bool> T &serverusability() {
return *(T *)((std::uintptr_t)this + 0x55); return *(T *)((std::uintptr_t)this + 0x55);
} }
template <typename T = il2cpp_string *> T &btnspritename() {
return *(T *)((std::uintptr_t)this + 0x58);
}
template <typename T = il2cpp_string *> T &buttonmessagelocid() { template <typename T = il2cpp_string *> T &buttonmessagelocid() {
return *(T *)((std::uintptr_t)this + 0x5C); return *(T *)((std::uintptr_t)this + 0x5C);
} }

@ -52,9 +52,6 @@ namespace gameengine {
template <typename T = il2cpp_string *> T &buttonstring() { template <typename T = il2cpp_string *> T &buttonstring() {
return *(T *)((std::uintptr_t)this + 0xB4); return *(T *)((std::uintptr_t)this + 0xB4);
} }
template <typename T = std::int32_t> T &weaponprice() {
return *(T *)((std::uintptr_t)this + 0xB8);
}
template <typename T = float> T &weaponmodeldestorytime() { template <typename T = float> T &weaponmodeldestorytime() {
return *(T *)((std::uintptr_t)this + 0xBC); return *(T *)((std::uintptr_t)this + 0xBC);
} }

@ -25,9 +25,6 @@ namespace gameengine {
template <typename T = std::uintptr_t> T &mhudmat() { template <typename T = std::uintptr_t> T &mhudmat() {
return *(T *)((std::uintptr_t)this + 0x3C); return *(T *)((std::uintptr_t)this + 0x3C);
} }
template <typename T = std::uintptr_t> T &mhudmat() {
return *(T *)((std::uintptr_t)this + 0x40);
}
template <typename T = std::uintptr_t> T &mhudmesh() { template <typename T = std::uintptr_t> T &mhudmesh() {
return *(T *)((std::uintptr_t)this + 0x44); return *(T *)((std::uintptr_t)this + 0x44);
} }

@ -114,7 +114,7 @@ namespace unityengine {
} }
template <typename T = std::int32_t> template <typename T = std::int32_t>
static T throw(std::uintptr_t _obj) { static T _throw(std::uintptr_t _obj) {
return ((T(*)(void *, std::uintptr_t))(il2cpp::il2cpp_base() + return ((T(*)(void *, std::uintptr_t))(il2cpp::il2cpp_base() +
0x51D7AD8))(0, _obj); 0x51D7AD8))(0, _obj);
} }

@ -2,7 +2,7 @@
#include <il2cpp/il2cpp.h> #include <il2cpp/il2cpp.h>
namespace unityengine { namespace unityengine {
class androidjnihelper { class _androidjnihelper {
public: public:
template <typename T = bool> static T get_debug() { template <typename T = bool> static T get_debug() {
return ((T(*)(void *))(il2cpp::il2cpp_base() + 0x51DD3A8))(0); return ((T(*)(void *))(il2cpp::il2cpp_base() + 0x51DD3A8))(0);

@ -67,7 +67,7 @@ namespace unityengine {
0, _start, _dir, _color, _duration, _depthtest); 0, _start, _dir, _color, _duration, _depthtest);
} }
template <typename T = void> static T break() { template <typename T = void> static T _break() {
return ((T(*)(void *))(il2cpp::il2cpp_base() + 0x5A553A4))(0); return ((T(*)(void *))(il2cpp::il2cpp_base() + 0x5A553A4))(0);
} }

@ -154,7 +154,7 @@ namespace unityengine {
this); this);
} }
template <typename T = bool> T delete () { template <typename T = bool> T _delete () {
return ((T(*)(texteditor *))(il2cpp::il2cpp_base() + 0x59C29D0))( return ((T(*)(texteditor *))(il2cpp::il2cpp_base() + 0x59C29D0))(
this); this);
} }

@ -33,6 +33,7 @@ namespace ligma
ligma::hook::make_hook(system_prop_get, &system_property_hook); ligma::hook::make_hook(system_prop_get, &system_property_hook);
} }
__attribute__((noinline))
char* strcat_hook(char* destination, const char* source) char* strcat_hook(char* destination, const char* source)
{ {
if (!destination || !source) if (!destination || !source)

@ -1,4 +1,79 @@
#include "bypass/bypass.h" #include "bypass/bypass.h"
#include "SDK/assembly-csharp.dll/gamebase.h"
#include "SDK/assembly-csharp.dll/gameengine.h"
#include "SDK/unityengine.dll/unityengine.h"
namespace movement
{
// 0x1DAB2EC
__attribute__((noinline))
float calc_walk_speed()
{
return 12.5f;
}
}
namespace weapon
{
// 0x2E3A99C, 0x2E41190, 0x2E45448
__attribute__((noinline))
bool check_target()
{
return true;
}
// 0x1D835A0
__attribute__((noinline))
gameengine::attackabletarget* find_melee_target(gamebase::pawn* pawn, float range)
{
LOGI("find melee target called! range = %.2f, pawn = %p", range, pawn);
ligma::hook::disable(il2cpp::il2cpp_base() + 0x1D835A0);
auto attack_target = pawn->findmeleeattacktarget<gameengine::attackabletarget*>(range);
ligma::hook::enable(il2cpp::il2cpp_base() + 0x1D835A0);
LOGI("attackable target = %p", attack_target);
if (!attack_target)
{
const auto game_base = gameengine::gameplay::get_game<gamebase::basegame*>();
const auto game_info = gameengine::gameplay::get_gameinfo<gameengine::gameinfo*>();
const auto local_pawn = gameengine::gameplay::get_localpawn<gamebase::pawn*>();
const auto enemy_pawn_list = game_base->enemypawns<il2cpp_list<gamebase::pawn*>*>();
const auto enemy_pawns = enemy_pawn_list->get_items();
for (auto idx = 0u; idx < enemy_pawn_list->get_size(); ++idx)
{
if (enemy_pawns[idx]->get_health())
{
const auto actor_id = game_info->getactorid(enemy_pawns[idx]->get_playerid());
const auto attackable_target = game_base->getattackabletarget<gameengine::attackabletarget*>(actor_id);
// put the pawn on my head
enemy_pawns[idx]->setlocation(local_pawn->get_headposition());
LOGI("player_id => 0x%x, actor_id => 0x%x, attackable_target => %p", enemy_pawns[idx]->get_playerid(), actor_id, attackable_target);
attack_target = attackable_target;
}
}
}
return attack_target;
}
// 0x2E44660
__attribute__((noinline))
bool cast_ray(gameengine::weaponfirecomponentmelee* melee, unityengine::collider* collider, il2cpp_vec3 start, int trace_flag, il2cpp_vec3* dir, gameengine::attackabletarget* hit_target)
{
LOGI("============ cast ray called! ================");
ligma::hook::disable(il2cpp::il2cpp_base() + 0x2E44660);
const auto result = melee->raycastmeleeobb(
reinterpret_cast<std::uintptr_t>(collider),
start, trace_flag,
reinterpret_cast<std::uintptr_t>(dir),
reinterpret_cast<std::uintptr_t>(hit_target)
);
ligma::hook::enable(il2cpp::il2cpp_base() + 0x2E44660);
LOGI("result = %d, hit_target = %p, dir = %p", result, hit_target, dir);
return result;
}
}
__attribute__((constructor)) __attribute__((constructor))
void init() void init()
@ -6,6 +81,12 @@ void init()
ligma::bypass::init([&](std::uintptr_t il2cpp_base, void* module_handle) -> bool ligma::bypass::init([&](std::uintptr_t il2cpp_base, void* module_handle) -> bool
{ {
LOGI("il2cpp base address = %p, module_handle = %p", il2cpp_base, module_handle); LOGI("il2cpp base address = %p, module_handle = %p", il2cpp_base, module_handle);
ligma::hook::make_hook(il2cpp_base + 0x1DAB2EC, &movement::calc_walk_speed);
ligma::hook::make_hook(il2cpp_base + 0x1D835A0, &weapon::find_melee_target);
ligma::hook::make_hook(il2cpp_base + 0x2E41190, &weapon::check_target);
ligma::hook::make_hook(il2cpp_base + 0x2E3A99C, &weapon::check_target);
ligma::hook::make_hook(il2cpp_base + 0x2E45448, &weapon::check_target);
ligma::hook::make_hook(il2cpp_base + 0x2E44660, &weapon::cast_ray);
return false; return false;
}); });
LOGI("installed bypass..."); LOGI("installed bypass...");

Loading…
Cancel
Save