# Basics

### Calling conventions

* Thiscall
  * microsoft 32bit c++ specific&#x20;
  * this pointer in ECX, rest of arguments on the stack
  * [tell me more](https://docs.microsoft.com/en-us/cpp/cpp/thiscall?view=msvc-160)
* fastcall
  * The first 4 arguments are stored in registers, the rest on the stack
    * windows uses the registers RCX, RDX, r8 and r9
    * [tell me more](https://docs.microsoft.com/en-us/cpp/cpp/fastcall?view=msvc-160)
* stdcall
  * used by 32bit windows.
  * arguments are pused in reverse order onto the stack.
  * the callee cleans up the stack (arguments)
  * [tell me more](https://docs.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-160)
* cdecl
  * used by 32bits \*nix
  * same as stdcall but the caller cleans up the stack
  * [tell me more](https://docs.microsoft.com/en-us/cpp/cpp/cdecl?view=msvc-160)


---

# Agent Instructions: 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:

```
GET https://luftenshjaltar.gitbook.io/ctf/binary/basics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
