Help! I can make a Class or Method NOP with

AmateurHacker

Platinian
Hello, I use Libtool. I can easily nop methods or classes. But how can I do this on modmenu? I don't want to use hexpatch.
 

Attachments

  • Ekran görüntüsü 2025-07-23 131023.png
    Ekran görüntüsü 2025-07-23 131023.png
    21.6 KB · Views: 21
Solution
Not sure what you mean as your question is badly formulated. But if your goal is to make sure that the argument in the return is always false then the code below will do just that:

C++:
void (*o_UpdateMeshShadow)(void* _this, bool bShow);
void UpdateMeshShadow(void* _this, bool bShow) {
    if (_this) {
        bShow = false;
        LOGI("Called UpdateMeshShadow");
        return o_UpdateMeshShadow( _this , bShow);
    }
}

If your goal is to just skip Updating mesh shadows for each entity then just return nothing.
C++:
void  (*o_SetParent)(void* _this, void* parent);

void SetParent(void* _this, void* parent) {
    if (_this != nullptr) {
        return;
    }
}



Or if you don't want to hook it then hex patch it with NOP operation
public System.Void SetFoldScreen(System.Int32 width, System.Int32 hight);
I'm trying to do something like this.
bool TransparentGameplay;
void (*FoldScreen)(void *instance,int Uzunluk ,int Genislik);

void (*old_ScreenAdapt)(void* instance);
void new_ScreenAdapt(void* instance) {
if (TransparentGameplay) {
FoldScreen(instance,1900,1440);
TransparentGameplay = false;

}
old_ScreenAdapt(instance);
}


but it doesn't work. Everything on the screen is erased in the game, but it doesn't turn into the size I want.
I'm trying to transfer this to the mod menu. But the game crashes.









1753552632939.png
 
public System.Void SetFoldScreen(System.Int32 width, System.Int32 hight);
I'm trying to do something like this.
bool TransparentGameplay;
void (*FoldScreen)(void *instance,int Uzunluk ,int Genislik);

void (*old_ScreenAdapt)(void* instance);
void new_ScreenAdapt(void* instance) {
if (TransparentGameplay) {
FoldScreen(instance,1900,1440);
TransparentGameplay = false;

}
old_ScreenAdapt(instance);
}


but it doesn't work. Everything on the screen is erased in the game, but it doesn't turn into the size I want.
I'm trying to transfer this to the mod menu. But the game crashes.









View attachment 789027
Not detailed enough.

Are both methods in the same class? Is ScreenAdapt method even called at any point ? Did you try logging? Is TransparentGameplay a toggle? If not then the condition is never met. If your goal is to play with the screen resolution then your best bet is SetResolution which is a static method in UnityEngine.Screen
 
Not detailed enough.

Are both methods in the same class? Is ScreenAdapt method even called at any point ? Did you try logging? Is TransparentGameplay a toggle? If not then the condition is never met. If your goal is to play with the screen resolution then your best bet is SetResolution which is a static method in UnityEngine.Screen
My problem is solved. I solved it. How can I change my post to solved?
 
Edit the prefix from help to Solved
public System.Void UpdateMeshShadow(System.Boolean bShow); // 0x7fff1da35298

Hi buddy. I want to ask you one last thing. My friend is right, but even if I return true or false, it doesn't work. My goal is to make everything in the showentity this return false. And even if a new value is added to it, it will return false. In short, it will always return false for everything.
1753742987144.png
 
Not sure what you mean as your question is badly formulated. But if your goal is to make sure that the argument in the return is always false then the code below will do just that:

C++:
void (*o_UpdateMeshShadow)(void* _this, bool bShow);
void UpdateMeshShadow(void* _this, bool bShow) {
    if (_this) {
        bShow = false;
        LOGI("Called UpdateMeshShadow");
        return o_UpdateMeshShadow( _this , bShow);
    }
}

If your goal is to just skip Updating mesh shadows for each entity then just return nothing.
 
Solution
Not sure what you mean as your question is badly formulated. But if your goal is to make sure that the argument in the return is always false then the code below will do just that:

C++:
void (*o_UpdateMeshShadow)(void* _this, bool bShow);
void UpdateMeshShadow(void* _this, bool bShow) {
    if (_this) {
        bShow = false;
        LOGI("Called UpdateMeshShadow");
        return o_UpdateMeshShadow( _this , bShow);
    }
}

If your goal is to just skip Updating mesh shadows for each entity then just return nothing.
My friend. I want the current example argument, 120, to return false. As the game progresses, more arguments are added, and the number reaches 300. Even if it reaches 300, they should also return false. I'll try your code. ALL ARGUMENTS FALSE
 
Not sure what you mean as your question is badly formulated. But if your goal is to make sure that the argument in the return is always false then the code below will do just that:

C++:
void (*o_UpdateMeshShadow)(void* _this, bool bShow);
void UpdateMeshShadow(void* _this, bool bShow) {
    if (_this) {
        bShow = false;
        LOGI("Called UpdateMeshShadow");
        return o_UpdateMeshShadow( _this , bShow);
    }
}

If your goal is to just skip Updating mesh shadows for each entity then just return nothing.
t
Thank you very much. I hope all your wishes come true.
 
Back
Top Bottom