Skip to content

[Vehicle Light Overflow Crash]a fix that never fixes the crash #759

@DaShouZhi

Description

@DaShouZhi

Describe the bug

static bool light_overflow_protect = false;

//41 57 41 56 41 55 41 54 56 57 55 53 48 81 EC ? ? ? ? 48 8B 01 4C 8D 48 0F
char hooks::sub_7FF6FA14A340(int64_t a1)//process vehicle light
{
	//v24 = *(_OWORD **)(v18 + 8 * v23); pvehicle
	//v18 = v11 + 8 * v9;
	//v11 = *(_QWORD *)v7; v7 pvehicle*
	int64_t v7 = *(int64_t*)(a1 + 8);
	int64_t v11 = *(int64_t*)v7;
	int64_t v8 = *(int64_t*)(a1 + 0x10);
	int32_t v9 = *(int32_t*)(a1 + 0x18);
	int32_t v10 = *(int32_t*)(a1 + 0x20);
	
	CVehicle** Vehicless = reinterpret_cast<CVehicle**>(v11);
	for (int i = v9; i <= v10; i++)
	{
		CVehicle* pVehicle = Vehicless[i];
		if (IsValidPtr(pVehicle))
		{
			if (v10 > 30)
			{
				light_overflow_protect = true;
			}
			else if (light_overflow_protect && v10 <= 20)
			{
				light_overflow_protect = false;
			}
		}
	}
	return OG(sub_7FF6FA14A340)(a1);
}

//E8 ? ? ? ? 49 FF C6 48 83 C3 10  + 1 rip
char hooks::sub_7FF6FA14A560(int64_t a1, int64_t a2, unsigned int a3, int64_t a4, int a5, int64_t a6) // set vehicle light
{
	if (light_overflow_protect)
		return 0;
	return OG(sub_7FF6FA14A560)(a1, a2, a3, a4, a5, a6);
}

Steps To Reproduce

someone said this crash cant get patch,so i just patch it,but it no the best way to fix

Expected Behavior

no

Logs and/or screenshots

<paste your logs here>

Store

Steam

Anticheat bypass mode

With FSL

Additional context

No response

Build

  • I've confirmed the issue exists on the latest version of YimMenuV2

Duplicate

  • I confirm that issue isn't a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions