danielkrupinski / Osiris

Cross-platform game hack for Counter-Strike 2 with Panorama-based GUI.
MIT License
3.35k stars 961 forks source link

Show Fake #1076

Closed VoltexYT closed 1 year ago

VoltexYT commented 4 years ago

The game crashes after activate this

static void __stdcall drawModelExecute :

static void __stdcall drawModelExecute(void* ctx, void* state, const ModelRenderInfo& info, matrix3x4* customBoneToWorld) noexcept
{

    hooks.modelRender.callOriginal<void, 21>(ctx, state, std::cref(info), customBoneToWorld);

    auto localPlayer = interfaces.entityList->getEntity(interfaces.engine->getLocalPlayer());

    interfaces.modelRender->forceMaterialOverride(nullptr);
    auto fake = localPlayer->eyeAngles();
    localPlayer->viewPunchAngle() = fake;
    localPlayer->drawModel(0x1, 255);
    interfaces.modelRender->forceMaterialOverride(nullptr);
}

DRAW MODEL : 

    void drawModel(int flags, char alpha)
    {
        return callVirtualMethod<void(__thiscall*)(void*, int, unsigned char)>(this + 4, 9)(this + 4, flags, alpha);
    }
notgoodusename commented 4 years ago

dont use char for alpha use int

notgoodusename commented 4 years ago

if you do that maybe it wont crash, but maybe it wont show the chams but show the shadows(happend to me if i remember)

VoltexYT commented 4 years ago

Without the drawmodel function it shows the shadows and with the client crashes

notgoodusename commented 4 years ago

dont use char for alpha use int

try this and tell me how it goes

LeYesnt commented 4 years ago

i think hes pc exploded lol

VoltexYT commented 4 years ago

int = crash!

notgoodusename commented 4 years ago

check this post maybe it can help you, he refers that he called original sceneend, i dont understand him, but maybe you do https://www.unknowncheats.me/forum/counterstrike-global-offensive/322882-crashing-calling-function-drawmodel-chams.html

VoltexYT commented 4 years ago

sorry dude i dont get anything.

notgoodusename commented 4 years ago

try replacing drawmodrl with hooks.modelRender.calloriginal blahblah

notaila commented 4 years ago

Bruh u cslling endscene chams stuff in dme Great job :facepalm:

VoltexYT commented 4 years ago

wtf osiris calling chams in drawModelExecute too

notgoodusename commented 4 years ago

wtf osiris calling chams in drawModelExecute too

what do u mean?

ghost commented 4 years ago

could you tell us where it crashes?

osiris does use DME for chams, not EndScene. bool Chams::render(void ctx, void state, const ModelRenderInfo& info, matrix3x4* customBoneToWorld) const noexcept ^ DME calling convention

also Entity doesn't have a method called drawModel?

notgoodusename commented 4 years ago

also Entity doesn't have a method called drawModel?

no it doesnt, you have to do this + 4 to get clientrenderable, just like getmodel

VoltexYT commented 4 years ago

Have anyone a smart idea to show fake antiaim?

notgoodusename commented 4 years ago

Have anyone a smart idea to show fake antiaim?

do getoriginal idk if it changes anything but i think it does, since drawmodelexecute is a void func it will work perfectly(correct me if i am wrong)