Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RadioStations limited to 96 #2517

Open
ook3D opened this issue May 12, 2024 · 0 comments
Open

RadioStations limited to 96 #2517

ook3D opened this issue May 12, 2024 · 0 comments
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action

Comments

@ook3D
Copy link

ook3D commented May 12, 2024

What happened?

the vanilla game radio stations add up to around almost 90, so there isnt much room for custom radio stations, luckily, ive already found the fix. this patch worked successfully on singleplayer on the latest build.

void PatchRadioStations()
{
	uint8_t* maxRadioStations = hook::get_pattern<uint8_t>("8D 5E 60 89 35", 2);
	DWORD oldProtect;
	VirtualProtect(maxRadioStations, 1, PAGE_EXECUTE_READWRITE, &oldProtect);
	*maxRadioStations = 255;
	VirtualProtect(maxRadioStations, 1, oldProtect, &oldProtect);
	uint32_t* radioStationsMemSize = (uint32_t*)(maxRadioStations + 0x26);
	VirtualProtect(radioStationsMemSize, 4, PAGE_EXECUTE_READWRITE, &oldProtect);
	*radioStationsMemSize = 255 * 8;
	VirtualProtect(radioStationsMemSize, 4, oldProtect, &oldProtect);
}

this should set the radio station limit to 255.

Expected result

stream custom radio stations without issue

Reproduction steps

Add multiple custom radio stations, you will go over the limit and crash sometimes

Importancy

Slight inconvenience

Area(s)

FiveM

Specific version(s)

FiveM/3179/Windows

Additional information

No response

@ook3D ook3D added bug triage Needs a preliminary assessment to determine the urgency and required action labels May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

1 participant