YimMenuV2 icon indicating copy to clipboard operation
YimMenuV2 copied to clipboard

[Request]: incorporate xenos to make YM2 self-injecting.

Open StheCat opened this issue 5 months ago • 3 comments

Problem

Xenos is stable and hasn't been updated in years. That code could be added to Yim to make it self-injecting as an exe instead of the extra step of using Xenos.

If Yim is self-injecting there's future possibilities to make command line scriptable features.

Solution

Xenos source: https://github.com/DarthTon/Xenos

Reason

Being scriptable is a bonus even to FSL or solo players.

There's also some possible race conditions in Battleye that could be exploited to disable it for short windows. With a short BE bypass window a self-injecting YM2 could change values and exit - in public sessions.

Additional context

No response

Duplicate

  • [x] I confirm that issue isn't a duplicate.

!!!READ THIS!!! Recovery features

  • [x] I confirm that I'm not requesting a recovery feature

StheCat avatar Jun 30 '25 00:06 StheCat

That code could be added to Yim to make it self-injecting

No it can not. This is an internal menu. It runs inside thegame's process, hence the reason it's a dll. You're describing an external menu which is very different (you could manual map your exe as a dll but only masochists will do that). Even in an external menu, absolutely nobody will use something as complex as Xenos for simple process attachment. If you really want ease of access/automation, you could write a simple program that updates and injects the DLL using a high-level language like Python or C#.

If Yim is self-injecting there's future possibilities to make command line scriptable features.

Not sure what you mean by that.

xesdoog avatar Jun 30 '25 15:06 xesdoog

If Yim is self-injecting there's future possibilities to make command line scriptable features.

I have a real time exploit that causes Battleye to drop out for a few seconds. That's too short a time to do anything with a menu that requires manual injection and user navigation. But, if I could script it.., exploit.exe yimcmdlineversion set global 262145.f_25510 25

(that global sets the arena war AP multiplier, just an example). You could play online with other people and by exploiting the race condition change a value that is persistent with the session even after the menu unloads and Battleye recovers.

StheCat avatar Jul 07 '25 05:07 StheCat

// I hope I'm not breaking any rules by posting this code here. // compile command: g++ gta5_injector.cpp -o injector.exe -std=c++17 -static #include <windows.h> #include <tlhelp32.h> #include #include #include

DWORD getPid( std::wstring procName ) { PROCESSENTRY32 p={sizeof(p)}; auto s=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); if(Process32First(s,&p)){ do{ if(procName==p.szExeFile){ CloseHandle(s); return p.th32ProcessID; }}while(Process32Next(s,&p));} CloseHandle(s); return 0;}

bool yeetDll( DWORD pid,std::string dll){ auto h=OpenProcess(PROCESS_ALL_ACCESS,0,pid); if(!h){ std::cout<<"bruh can't open process: "<<GetLastError()<<"\n";return false;}

void* m=VirtualAllocEx(h,0,dll.size()+1,MEM_COMMIT,PAGE_READWRITE); if(!m){ std::cout<<"no mem for u\n"; CloseHandle(h); return false;}

WriteProcessMemory(h,m,dll.c_str(),dll.size()+1,0); auto k32=GetModuleHandleA("kernel32.dll"); auto ll=GetProcAddress(k32,"LoadLibraryA");

 auto t=CreateRemoteThread(h,0,0,(LPTHREAD_START_ROUTINE)ll,m,0,0);

if(!t){ std::cout<<"thread go brrrr... oh wait it doesn't\n"; VirtualFreeEx(h,m,0,MEM_RELEASE); CloseHandle(h); return false;}

WaitForSingleObject(t,INFINITE); VirtualFreeEx(h,m,0,MEM_RELEASE); CloseHandle(t); CloseHandle(h); std::cout<<"DLL has entered the chat\n"; return true; }

int main(){

std::string dll="C:\path\to\your.dll"; std::string exe="C:\path\to\GTA5.exe"; std::wstring name=L"GTA5.exe";

STARTUPINFOA s={sizeof(s)}; PROCESS_INFORMATION p;

std::cout<<"Launching da game...\n"; if(!CreateProcessA(exe.c_str(),0,0,0,0,0,0,0,&s,&p)){ std::cout<<"nah fam, failed to launch: "<<GetLastError()<<"\n"; return 1;}

std::cout<<"Waiting 10s cuz we're patient...\n"; std::this_thread::sleep_for(std::chrono::seconds(10));

DWORD id=getPid(name); if(!id){ std::cout<<"where tf is GTA5.exe?\n"; return 1;}

 std::cout<<"found it. time to inject some sauce...\n";

if(!yeetDll(id,dll)){ std::cout<<"yeet failed :(\n"; return 1;}

std::cout<<"mission passed, respect++\n"; return 0;}

j1m1l0k0 avatar Aug 06 '25 21:08 j1m1l0k0