> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/ida-9.3/ida-actions/hx_forcecalltype.md).

# hx\_ForceCallType

## Description

Tell the decompiler to skip analyzing the call arguments and instead use the type of the called object as-is. In some cases, especially for indirect calls, the decompiler cannot correctly detect call arguments. For a call like:

```
        push something
        mov  eax, [ecx]
        call [eax+8]
```

it is very difficult to determine where are the input arguments. For example, it is unclear if ECX is used by the call or not.

However, the number of arguments and their types can become available at later stages of decompilation. For example, the decompiler may determine that ECX points to a class with a table of virtual functions. If the user specifies the vtable layout, the output may become similar to:

```
        ((int (*__stdcall)(DWORD))ptr-vftable-somefunc)(v1);
```

If the user declares somefunc as a pointer to a function like this:

```
        int __thiscall (*somefunc)(myclass *obj, int arg);
```

then the code is incorrect. The decompiler detected only one argument and missed the one in ECX.

The *Force call type* command instructs the decompiler not to perform the call argument analysis but just use the type of the call object. For the above example, the call will be transformed into something like:

```
        ptr-vftable-somefunc(obj, v1);  // obj is in ECX
```

In other words, this command **copies the call type from the call object to the call instruction**. The call object may be any expression, the only requirement is that it must be a pointer to a function.

There is a more general command *Set call type...* (Action name: `hx:SetCallType`) that allows the user to set any type for a call instruction.

{% hint style="info" %}
Behind the scenes, the 'force call' command copies the desired type to the operand of the call instruction. To revert the effects of 'force call' or to fine tune the forced type please use the **Edit, Operand type, Set operand type** in the disassembly view while staying on the call instruction.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hex-rays.com/ida-9.3/ida-actions/hx_forcecalltype.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
