Untitled

 avatar
unknown
c_cpp
a month ago
6.8 kB
7
Indexable
void obfuscate_get_function_pointer_origin(uint64_t origin_xor_1, uint64_t origin_xor_2, iw9_u4 secure_origin, vec3_t* out_origin)
{
    uint32_t function_pointer_origin = (uint32_t)((aab_get_pointer_origin ^ origin_xor_1 ^ ~origin_xor_2) - game::module_base);

    iw9_u3 out_pos = {};

    {
        if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_0)
        {
            get_obfuscation_origin_0(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_1)
        {
            get_obfuscation_origin_1(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_2)
        {
            get_obfuscation_origin_2(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_3)
        {
            get_obfuscation_origin_3(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_4)
        {
            get_obfuscation_origin_4(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_5)
        {
            get_obfuscation_origin_5(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_6)
        {
            get_obfuscation_origin_6(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_7)
        {
            get_obfuscation_origin_7(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_8)
        {
            get_obfuscation_origin_8(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_9)
        {
            get_obfuscation_origin_9(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_10)
        {
            get_obfuscation_origin_10(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_11)
        {
            get_obfuscation_origin_11(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_12)
        {
            get_obfuscation_origin_12(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_13)
        {
            get_obfuscation_origin_13(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_14)
        {
            get_obfuscation_origin_14(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_15)
        {
            get_obfuscation_origin_15(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_16)
        {
            get_obfuscation_origin_16(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_17)
        {
            get_obfuscation_origin_17(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_18)
        {
            get_obfuscation_origin_18(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_19)
        {
            get_obfuscation_origin_19(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_20)
        {
            get_obfuscation_origin_20(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_21)
        {
            get_obfuscation_origin_21(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_22)
        {
            get_obfuscation_origin_22(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_23)
        {
            get_obfuscation_origin_23(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_24)
        {
            get_obfuscation_origin_24(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_25)
        {
            get_obfuscation_origin_25(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_26)
        {
            get_obfuscation_origin_26(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_27)
        {
            get_obfuscation_origin_27(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_28)
        {
            get_obfuscation_origin_28(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_29)
        {
            get_obfuscation_origin_29(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_30)
        {
            get_obfuscation_origin_30(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_31)
        {
            get_obfuscation_origin_31(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_32)
        {
            get_obfuscation_origin_32(&secure_origin, &out_pos);
        }
        else if (function_pointer_origin == offsets::BO6::pose::o_get_obfuscation_origin_33)
        {
            get_obfuscation_origin_33(&secure_origin, &out_pos);
        }
    }

    constexpr double poseMulti = 1.0 / 65536.0;
    *out_origin =
    {
        static_cast<f32>(static_cast<double>(static_cast<int32_t>(out_pos.v[0])) * poseMulti),
        static_cast<f32>(static_cast<double>(static_cast<int32_t>(out_pos.v[1])) * poseMulti),
        static_cast<f32>(static_cast<double>(static_cast<int32_t>(out_pos.v[2])) * poseMulti)
    };
}
Editor is loading...
Leave a Comment