Tutorial Respawnables Wallhack Source (All Versions)

VanHoevenTR

Platinian
Original poster
Jul 8, 2019
19
694
78
Unknown
Unfortunately, some sources are lost but you can still learn and use some snippets. Author: D red

Some basic explanation

LiveShaderTester1.2.1.deb - Free and Simple File Hosting
First, you will need a tool made by Red16 to dump the shaders.
Download the .deb, go to the DynamicLibrary folder and found the LiveShaderTester.plist
Open it, and add or replace an older string by your app bundle id (can be find by Apps Manager)
Then, open your game, click on the mod menu, and again click on the head of the ModMenu. you will have a popup telling you all the shaders.
Just need to test them 1 by 1

You only need the shader name, the wireframe is an extra feature from Red16.

I will explain only the important part in the Tweak.xm

Headers:

C++:
#import "Macros.h"
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>       //These are hearders. Add them
#include "dlfcn.h"
#import <Foundation/Foundation.h>
Wallhack code:
C++:
// You need to dump the shaders of the game and test them to see the good ones. (in this case it will be : "g_mSkinPal")
// Don't change things under here until the next comment

void (*_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const void *indices);
GLint (*_glGetUniformLocation)(GLuint program,const GLchar *name);

GLint $glGetUniformLocation(GLuint program,const GLchar *name) {
NSLog(@"%s",name);
return _glGetUniformLocation(program,name);
}


%hook NSBundle
+ (id)bundleWithPath:(NSString *)fullPath
{
if ([fullPath isEqual:@"/System/Library/Frameworks/Metal.framework"]) {
NSLog(@"distable metal framework");
return NULL;
}

  return %orig(fullPath);
}

%end



void $glDrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices) {
    _glDrawElements(mode, count, type, indices);

    if (mode != GL_TRIANGLES || count < 1000) return;{  //Possibility to change de count

    GLint currProgram;
    glGetIntegerv(GL_CURRENT_PROGRAM, &currProgram);

if([switches isSwitchOn:@"Wallhack"]) {            //Adding the if statment.
GLint id = _glGetUniformLocation(currProgram, "g_mSkinPal");    //"g_mSkinPal" is the shader that will be use in this hack.
if (id == -1) return;
#define _DRAW_RGB_ 255,255,255     //The "background" color. In this case it is white

  //You can copy and paste this. Make some change if you want.

glDepthRangef(1, 0.5);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glEnable(GL_BLEND);
glDepthFunc(GL_ALWAYS);
glDepthMask(false);
glBlendFunc(GL_CONSTANT_COLOR, GL_ZERO);
glBlendColor(0.0f, 0.0f, 0.0F, 1.0f);
glEnable( GL_POLYGON_OFFSET_FILL);
glPolygonOffset( -2.5f, -2.5f );
glLineWidth( 6.0f );
_glDrawElements(GL_LINE_LOOP,count,type,indices);
glDepthFunc(GL_LESS);
glBlendFunc(GL_ONE, GL_ZERO);
glBlendColor(50.0f, 0.0f, 0.0F, 0.8f);
glDisable( GL_POLYGON_OFFSET_FILL );
_glDrawElements(mode,count,type,indices);
glDepthMask(true);
glDepthFunc(GL_LESS);
glColorMask(_DRAW_RGB_, 0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
_glDrawElements(mode, count, type, indices);
glDepthRangef(0.5, 1);
glColorMask(1, 1, 1, 1);
glDisable(GL_BLEND);
}
}
}

%ctor {
MSHookFunction((dlsym(RTLD_DEFAULT, "glDrawElements")), (void *)$glDrawElements, (void **)&_glDrawElements);

MSHookFunction((dlsym(RTLD_DEFAULT, "glGetUniformLocation")), (void *)$glGetUniformLocation, (void **)&_glGetUniformLocation);
}

Setup:
C++:
//Adding the feature
void setup() {

[switches addSwitch:@"Wallhack"
            description:@"See Through Wall"];
}
You should be good to compile and make it !
It can be done for any other games that use OpenGLES, just need to find the shader name

Example:

f0vAI61.jpg


I would like to remind that I am not the author of the original open source code.

D red have modified the content in a way that he like

Thanks to avenger, caoyin for the code. Red16 for the tool.