Skip to main content

Overview

The create_move hook is called every time the game processes player input, allowing you to modify user commands before they’re sent to the server. This is one of the most important hooks for implementing features like aimbot, movement enhancements, and anti-aim.
This hook is called at virtual table index 22 of the i_client_dll interface.

Hook Signature

void __fastcall create_move_detour(
    sdk::i_client_dll* _this,
    void* edx,
    int sequence_number,
    float input_sample_frametime,
    bool active
)

Parameters

_this
sdk::i_client_dll*
Pointer to the client DLL interface instance
edx
void*
EDX register (fastcall convention) - not used
sequence_number
int
The command sequence number used to retrieve the user command
input_sample_frametime
float
The time delta for this input sample
active
bool
Whether the client is currently active

When It’s Called

This hook is invoked every frame when the game needs to process player input. It occurs before the command is sent to the server, giving you the opportunity to:
  • Modify view angles (aim)
  • Change movement buttons and velocities
  • Alter firing state
  • Implement prediction
  • Control packet sending behavior

Common Use Cases

Aimbot Implementation

The hook retrieves the user command and runs aimbot logic before finalizing the command:
auto command = g_interfaces.input->get_user_cmd(sequence_number);
g_aimbot.run();

Movement Fixes

After modifying view angles, movement needs to be corrected to maintain intended direction:
g_movement.movement_fix(command, g_prediction.backup_vars.view_angles);

Prediction System

The hook runs prediction to accurately simulate player state:
g_prediction.update();
g_prediction.store_backup();
g_prediction.start(g_ctx.local);
g_prediction.end(g_ctx.local);
You must verify the command checksum after modifications to prevent detection:
verified->command = *command;
verified->checksum = command->checksum();

Implementation Details

The hook uses naked function assembly to preserve registers and properly handle the send_packet boolean:
CREATE_HOOK_HELPER(create_move_hook, 
    __declspec(naked) void(__fastcall)(
        sdk::i_client_dll*, void*, int, float, bool
    )
);

static void __fastcall create_move_detour(
    sdk::i_client_dll* _this, 
    void* edx, 
    int sequence_number,
    float input_sample_frametime,
    bool active
);

Source Files

  • Header: globals/hooks/create_move/create_move.h:18-31
  • Implementation: globals/hooks/create_move/create_move.cpp:15-64

Initialization

void init()
{
    hooks::create_move_hook.create(
        virtual_func::get(g_interfaces.client, 22),
        create_move_detour,
        _("create_move_detour")
    );
}

See Also

Build docs developers (and LLMs) love