Giter VIP home page Giter VIP logo

Comments (9)

sneakyevil avatar sneakyevil commented on June 2, 2024

I knew about this issue since beginning, but never bother to look futher since I have no clue why it happens and especially with different functions.
At the moment I just prefer to hook function like OnUpdate of some class or Camera render function and just do stuff there.
If you really need to do like World2Screen stuff, then you could take look at matrixes and just read them from Camera and calculate the screen position, instead calling the function.

from il2cpp_resolver.

sneakyevil avatar sneakyevil commented on June 2, 2024

Anyone who still has problem with this I need some tests on diff games as result:

void* m_pThisThread = IL2CPP::Thread::Attach(IL2CPP::Domain::Get());
/*

Run your code here... 

*/
IL2CPP::Thread::Detach(m_pThisThread);

Instead creating new thread via API create it yourself and run this code in the loop so it attach and deattach.

from il2cpp_resolver.

Rednick16 avatar Rednick16 commented on June 2, 2024

I did do this a while back and came back to it, it had no effect, I tested it on a mobile game(CriticalOps) and terraria il2cpp steam game, I read some where a dude said he fixed his crashes by calling the il2cpp_thread_attach everytime he was ready to call a Unity function, personally I don’t think this function dose anything useful.

from il2cpp_resolver.

sneakyevil avatar sneakyevil commented on June 2, 2024

Seems weird since I tried to do simple ESP by just filtering out objects by certain name and calling Camera WorldToScreen function and I got the thread error and after doing attach and doing same thing and detaching it, it didn't popup error anymore.

from il2cpp_resolver.

kashiwazaki2 avatar kashiwazaki2 commented on June 2, 2024

Seems weird since I tried to do simple ESP by just filtering out objects by certain name and calling Camera WorldToScreen function and I got the thread error and after doing attach and doing same thing and detaching it, it didn't popup error anymore.

Well i tried it as you said to me and i can confirm it does work 100%, tested on Naraka BladePoint no crash/GC Collecting from unknown thread anymore so i guess this is an appropiate fix since i am doing like that on present and yei all works and the best part is i don't need the hook anymore.

HRESULT __fastcall naraka_hooks::hkPresent(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags)
{
	void* m_pThisThread = IL2CPP::Thread::Attach(IL2CPP::Domain::Get());

        //init imgui things

	ImGui_ImplDX11_NewFrame();
	ImGui_ImplWin32_NewFrame();
	ImGui::NewFrame();

        //render shit

	ImGui::EndFrame();
	ImGui::Render();
	ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());

	IL2CPP::Thread::Detach(m_pThisThread);

	return naraka_hooks::_returns::oPresent(pSwapChain, SyncInterval, Flags);
}

from il2cpp_resolver.

Rednick16 avatar Rednick16 commented on June 2, 2024

Seems weird since I tried to do simple ESP by just filtering out objects by certain name and calling Camera WorldToScreen function and I got the thread error and after doing attach and doing same thing and detaching it, it didn't popup error anymore.

Well it seems to work I tested it on another game and it worked hahaha no idea what’s happening I guess this is the best way to use this attach method welp dipping thanks for all the help and the tool very helpful

from il2cpp_resolver.

extremeblackliu avatar extremeblackliu commented on June 2, 2024

re-check the repo , added callback to use OnUpdate

from il2cpp_resolver.

kashiwazaki2 avatar kashiwazaki2 commented on June 2, 2024

Thank you guys for your work, this need update looks dope.

from il2cpp_resolver.

sneakyevil avatar sneakyevil commented on June 2, 2024

Closing this because callbacks has been added and it is easier to use than threads.

from il2cpp_resolver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.