Solved Crash when drawing (esp)

Status
Not open for further replies.

RazerTexz

Platinian
Original poster
May 17, 2020
36
5
8
the void
Game used (For testing): Granny v1.8.1 | 32 Bit

Currently trying to make an esp but keep crashing when trying to draw it. I've been trying to fix it for the past 6 hours but can't find the problem, i'll try to fix it again but any help will be appreciated.

I'll give the files that is modified / added while making the esp.

Code:
************* Crash Head ****************
Time Of Crash: HIDDEN
Device Manufacturer: HIDDEN
Device Model: HIDDEN
Android Version: 12
Android SDK: 31
App VersionName: 1.8.1
App VersionCode: 63
************* Crash Head ****************

java.lang.Error: FATAL EXCEPTION [UnityMain]
Unity version     : 2021.3.11f1
Device model      : HIDDEN
Device fingerprint: HIDDEN
Build Type        : Release
Scripting Backend : IL2CPP
ABI               : armeabi-v7a
Strip Engine Code : true

Caused by: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2021.3.11f1 (0a5ca18544bf)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
Build fingerprint: 'HIDDEN'
Revision: '0'
ABI: 'arm'
Timestamp: HIDDEN
pid: 3162, tid: 3162, name: .dvloper.granny  >>> com.dvloper.granny <<<
uid: 10352
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20c4
    r0  ffa3a3ac  r1  00000008  r2  1e560de3  r3  0000002e
    r4  00000000  r5  0000005c  r6  ea9b6f90  r7  00002090
    r8  ffa3a320  r9  f0019380  r10 ea4e2ba0  r11 eef44274
    ip  ea9b24dc  sp  ffa3a300  lr  ea700d23  pc  ea6875ac

backtrace:
      #00 pc 002445ac  /apex/com.android.art/lib/libart.so (art::JNI<false>::CallNonvirtualVoidMethodV(_JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list)+1048) (BuildId: fe65c9191eeeb05ab1a462c3b4b557ab)

    at libart.art::JNI<false>::CallNonvirtualVoidMethodV(_JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list)(CallNonvirtualVoidMethodV:1048)
 

Attachments

RazerTexz

Platinian
Original poster
May 17, 2020
36
5
8
the void
Okay i just boiled down the problem to
C++:
jmethodID drawtext = _env->GetMethodID(canvasView, "DrawText", "(Landroid/graphics/Canvas;IIIILjava/lang/String;FFF)V");
My first suspicion was the signature but changing it doesn't seem to do anything. I'll look into it more.
 

RazerTexz

Platinian
Original poster
May 17, 2020
36
5
8
the void
C++:
void DrawText(Color color, const char *txt, Vector2 pos, float size) {
        if (isValid()) {
            LOGI(OBFUSCATE("DrawText on NepDraw.h called"));
            jclass canvasView = _env->GetObjectClass(_cvsView);
            if (canvasView) {
                LOGI(OBFUSCATE("canvasView class found"));
            }
            jmethodID drawText = _env->GetMethodID(canvasView, "DrawText", "(Landroid/graphics/Canvas;IIIILjava/lang/String;FFF)V");
            if (drawText) {
                LOGI(OBFUSCATE("drawtext method found"));
            }
            LOGI(OBFUSCATE("Calling void method"));
            _env->CallVoidMethod(_cvsView, drawText, _cvs, (int) color.a, (int) color.r, (int) color.g, (int) color.b, _env->NewStringUTF(txt), pos.X, pos.Y, size);
            LOGI(OBFUSCATE("SUCCESS"));
        }
    }
All logs was called successfully, except for "drawtext method found" and "SUCCESS"
 

RazerTexz

Platinian
Original poster
May 17, 2020
36
5
8
the void
Fixed it by adding
Java:
-keep public class com.android.support.ESPView {
    public void DrawText(android.graphics.Canvas, int, int, int, int, java.lang.String, float, float, float);
}
in proguard-rules.pro (i'm so stupid)
 
Status
Not open for further replies.