> 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.5/core/decompiler/concepts/function-pointer-members.md).

# Function pointer members

Programs often call a function through a pointer that a structure holds: a table of operations that a driver fills in, a dispatch table built by hand, or the virtual function table of a C++ class. The pseudocode shows such a call as a call through a structure member:

```
g_pro_ops.start(dev);
ops->start(dev);
```

<kbd>Enter</kbd> or a double click on the member of such a call (`start` above) goes to the **function that the member points to**.

## When the pseudocode names the object

When the pseudocode shows which object holds the member, IDA reads the pointer out of that object and goes to the function at once. The object can be:

* a global: `g_pro_ops.start()`
* an element of an array with a constant index: `g_tab[1].start()`
* a member of another structure or union: `g_dev.ops.start()`
* a chain of these

## When the object is not known

The pseudocode often does not name the object. The pointer can come from a function parameter (`ops->start()`), or the index can be a variable or an index on a pointer (`g_tab[i].start()`, `p[1].start()`).

IDA then looks at every data item in the database that has the structure type applied, and reads the member out of each one:

* if all of them point to the same function, IDA goes to it
* if they point to different functions, a chooser named **Possible callees of** *Type::member* lists them, and you pick one

When there are more than 1000 objects to look at, for example a large array with the structure type, a wait box appears and you can cancel it.

{% hint style="info" %}
The candidates come only from data items that have the structure type applied. IDA does not guess callees from function names. If the tables in your database are not typed, apply the structure type to them first.
{% endhint %}

## When IDA goes to the declaration

<kbd>Enter</kbd> and a double click go to the declaration of the member in Local Types when:

* the member is not called: an assignment, a comparison, or the address of the member
* the member is not a function pointer
* no candidate is found: no data item has the structure type applied, or the member does not point to the start of a function in any of them (for example, it is null, or it points to an imported function)
* you cancel the wait box

[Jump to structure definition](/ida-9.5/ida-actions/hx_jmpstrucdef.md) (<kbd>Z</kbd>) always goes to the declaration.

## C++ virtual calls

A virtual call is a call through a member of the virtual function table, so it works the same way, but only when the virtual function table is described by a structure type, such as `Shape_vtbl`, and the vtable pointer of the class has that type. The decompiler then shows the call as a member access:

```
sh->_vptr.Shape->area(sh);
```

and the vtables that have the `Shape_vtbl` type are the candidates.

When IDA has no such structure, the decompiler shows the virtual call as arithmetic on the vtable pointer, and there is no member to click:

```
(*((__int64 (__fastcall **)(Shape *))sh->_vptr.Shape + 1))(sh);
```

This is usual for binaries built by GCC or Clang, also with DWARF debug information. To use the navigation there, create the vtable structure, give the vtable pointer the type of a pointer to it, and apply the structure type to the vtables of the classes.

## Where it works

* the pseudocode view, also with <kbd>Alt</kbd>+<kbd>Enter</kbd> (Jump to pseudocode in a new view)
* the Dalvik class view


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hex-rays.com/ida-9.5/core/decompiler/concepts/function-pointer-members.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
