Гайд Правильная настройка углов от третьего лица

Начинающий
Статус
Оффлайн
Регистрация
3 Мар 2019
Сообщения
4
Реакции[?]
3
Поинты[?]
0
Many people believe that calling SetLocalViewangles or constantly setting an offset for each frame is a good idea, but in fact it is not, because it will affect things outside the third party and ruin the inner workings of the game. The best way is summarized a few months ago in this post:
Пожалуйста, авторизуйтесь для просмотра ссылки.
This is a much more sane approach to setting up your corners, but in what I will describe in this thread, all still not enough things. First of all, how can I connect the player's eye function? You can do this by customizing the player's listener and overwriting the function pointer for each player instance, or by completely replacing the vtable. In this topic, I'm going to use the “replace vtable” approach, but if you want to see how another method works, You can look at this source:
Пожалуйста, авторизуйтесь для просмотра ссылки.
Now about the intercepting part: to intercept a function from a virtual table, you first need to find a pointer to a virtual table. Vtable C_CSPlayer can be found by searching for this sig

Код:
 address_t m_pVtable = mem :: find_ida_sig ("client_panorama.dll", {"55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 89 7C 24 0C"}) .self_offset (0x45). Offset (0x2);
 
IDA: 55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 89 7C 24 0C
FIZZ: 55 8B EC 83 E4 F8 83 EC 18 56 57 8B F9 89 7C 24 0C [/ CODE]


Once this is done, we can connect the eyeangles function, based on previous experience in the opposite: Here’s what interception might look like: 

[CODE] :: static math angle_t * __fastcall eye_angles (REGISTER ;; [/ CODE]      
[CODE] CREATE_HOOK (:: ctx mem.CCSPlayer.m_pVtable, 167, eye_angles); [/ CODE]

You will need to install some kind of storage unit to store your corners, which I did.

[CODE] math :: angle_t * __fastcall hook_handler_t :: eye_angles (REGISTERS)
{
    return & ctx :: client.thirdperson_angles;
} [/ CODE]


(Obviously, you can set the angles to whatever you want, but I just set them to these fictitious values.) Now, if you just leave the hook as it is, you will notice that your review is completely spoiled, and your shots have fallen to earth, the reason is that the eyeangles function is often called, and therefore we overwrite angles more than necessary. The easy way to fix this is to check where the call came from, and respond accordingly. In addition to this, you must also install some kind of check on whether you are a third party or not. For third-person angles, there are two function calls that are important, one for height and the other for yawing. Both calls can be found in the same function. The function can be found here:

[CODE] math :: angle_t thirdperson_angles; [/ CODE]

 [CODE] ctx :: client.thirdperson_angles = {89.f, 90.f, 0.f}; [/ CODE]


And the corresponding return addresses can be found here:

[CODE] /// Pitch
Offset: 0x39C0B8 (most likely only for the current game version)
IDA: 8B CE F3 0F 10 00 8B 06 F3 0F 11 45? FF 90? ? ? ? F3 0F 10 55?
FIZZ: 8B CE F3 0F 10 00 8B 06 F3 0F 11 45 .. FF 90 .. .. .. .. F3 0F 10 55 .. [/ CODE]


[CODE] /// Yaw
Offset: 0x39C0CB (most likely only for the current game version)
IDA: F3 0F 10 55? 51 8B 8E? ? ? ?
FIZZ: F3 0F 10 55 .. 51 8B 8E .. .. .... [/ CODE]


Now respond accordingly in your hook.
[CODE] math :: angle_t * __fastcall hook_handler_t :: eye_angles (REGISTERS)
{
    /// Only Only on localplayer
    if (ecx! = uintptr_t (ctx :: client.local))
        return hooks :: get (). orig_eye_angles (ecx, edx);
 
    static auto ret_to_thirdperson_pitch = mem :: find_ida_sig ("client_panorama.dll", "8B CE F3 0F 10 00 8B 06 F3 0F 11 45? FF 90??? F3 0F 10 55?");
    static auto ret_to_thirdperson_yaw = mem :: find_ida_sig ("client_panorama.dll", "F3 0F 10 55? 51 8B 8E???");
 
    /// Are we even in thirdperson?
    if (! ctx :: client.in_thirdperson)
        return hooks :: get (). eye_angles (ecx, edx);
 
    /// Is the call coming from somewhere relevant?
    if (uintptr_t (_ReturnAddress ()) == ret_to_thirdperson_pitch.cast <uintptr_t> ()
         || uintptr_t (_returnaddress ()) == ret_to_thirdperson_yaw.cast <uintptr_t> ())
        return & ctx :: client.thirdperson_angles;
 
    return hooks :: get (). orig_eye_angles (ecx, edx);
} [/ CODE]


now you set the tp angles as the boss and the person is happy
 
Начинающий
Статус
Оффлайн
Регистрация
12 Июн 2017
Сообщения
85
Реакции[?]
18
Поинты[?]
0
Полностью с uc, тема ducari. Указал бы хоть. Только 1ую строчку изменил))
 
Сверху Снизу