static VehicleControl() { byte *addr = MemoryFunctions.FindPattern("\x74\x0A\xF3\x0F\x11\xB3\x1C\x09\x00\x00\xEB\x25", "xxxxxx????xx"); throttlePOffset = addr == null ? 0 : *(int *)(addr + 6) + 0x10; brakePOffset = addr == null ? 0 : *(int *)(addr + 6) + 0x14; steeringAngleOffset = addr == null ? 0 : *(int *)(addr + 6) + 8; addr = MemoryFunctions.FindPattern("\x44\x88\xA3\x00\x00\x00\x00\x45\x8A\xF4", "xxx????xxx"); handbrakeOffset = addr == null ? 0 : *(int *)(addr + 3); addr = MemoryFunctions.FindPattern("\x3C\x03\x0F\x85\x00\x00\x00\x00\x48\x8B\x41\x20\x48\x8B\x88", "xxxx????xxxxxxx"); handlingOffset = addr == null ? 0 : *(int *)(addr + 0x16); addr = MemoryFunctions.FindPattern("\x3B\xB7\x48\x0B\x00\x00\x7D\x0D", "xx????xx"); wheelsPtrOffset = addr == null ? 0 : *(int *)(addr + 2) - 8; numWheelsOffset = addr == null ? 0 : *(int *)(addr + 2); addr = MemoryFunctions.FindPattern("\x0F\x2F\x81\xBC\x01\x00\x00\x0F\x97\xC0\xEB\xDA", "xx???xxxxxxx"); wheelSteeringAngleOffset = addr == null ? 0 : *(int *)(addr + 3); addr = MemoryFunctions.FindPattern("\x74\x26\x0F\x57\xC9", "xxxxx"); fuelLevelOffset = addr == null ? 0 : *(int *)(addr + 8); addr = MemoryFunctions.FindPattern("\x45\x0f\x57\xc9\xf3\x0f\x11\x83\x60\x01\x00\x00\xf3\x0f\x5c", "xxx?xxx???xxxxx"); wheelSuspensionCompressionOffset = addr == null ? 0 : *(int *)(addr + 8); wheelAngleOffset = addr == null ? 0 : (*(int *)(addr + 8)) + 0x8; wheelAngularVelocityOffset = addr == null ? 0 : (*(int *)(addr + 8)) + 0xc; addr = MemoryFunctions.FindPattern("\xF3\x0F\x11\xB3\x00\x00\x00\x00\x44\x88\x00\x00\x00\x00\x00\x48\x85\xC9", "xxxx????xx?????xxx"); deluxoTransformationOffset = addr == null ? 0 : *(int *)(addr + 4); deluxoFlyModeOffset = deluxoTransformationOffset == 0 ? 0 : deluxoTransformationOffset + 4; }
internal static bool Init() { byte *address = MemoryFunctions.FindPattern("\x85\xD2\x78\x44\x4C\x8B\x49\x68\x4D\x85\xC9\x74\x29\x49\x8B\x81\x00\x00\x00\x00", "xxxxxxxxxxxxxxxx????"); if (AssertAddress(address, nameof(GetBoundIndexForBone))) { GetBoundIndexForBone = Marshal.GetDelegateForFunctionPointer <GetBoundIndexForBoneDelegate>((IntPtr)address); } return(!anyAssertFailed); }