### BridgeInit Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/bridge/BridgeInit.html
A placeholder example for the BridgeInit function.
```text
Example code.
```
--------------------------------
### GuiAddLogMessageHtml Usage Examples
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiAddLogMessageHtml.html
Examples demonstrating how to call the function in C++ and Assembly.
```cpp
GuiAddLogMessageHtml("This formatted text will be displayed in the log view.\n");
```
```asm
.data
szMsg db "This formatted text will be displayed in the log view",13,10,0 ; CRLF
.code
Invoke GuiAddLogMessageHtml, Addr szMsg
```
--------------------------------
### GuiAddLogMessage Usage Examples
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiAddLogMessage.html
Examples demonstrating how to call the function in C++ and Assembly.
```cpp
GuiAddLogMessage("This text will be displayed in the log view.\n");
```
```asm
.data
szMsg db "This text will be displayed in the log view",13,10,0 ; CRLF
.code
Invoke GuiAddLogMessage, Addr szMsg
```
--------------------------------
### Execute Command Example
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgCmdExecDirect.html
A basic example of executing the 'run' command using DbgCmdExecDirect.
```cpp
DbgCmdExecDirect("run");
```
--------------------------------
### Set Search Start Column Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceSetSearchStartCol.html
Sets the search starting column to the second column (index 1).
```C
GuiReferenceSetSearchStartCol(1);
```
--------------------------------
### Using DbgArgumentGet to Log Argument Range
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgArgumentGet.html
Example demonstrating how to fetch and log the start and end addresses of an argument.
```cpp
duint start;
duint end;
std::string message;
if(DbgArgumentGet(0x00401000, &start, &end))
{
sprintf_s(message.c_str(), MAX_PATH, "Argument range: %08X-%08X\r\n", start, end);
GuiAddLogMessage(message);
}
else
{
GuiAddLogMessage("Argument start and end addresses couldn't be get\r\n");
}
```
--------------------------------
### BridgeGetDbgVersion usage example
Source: https://help.x64dbg.com/en/latest/developers/functions/bridge/BridgeGetDbgVersion.html
Example showing how to call the function to store the version in an integer variable.
```cpp
int version = BridgeGetDbgVersion();
```
--------------------------------
### GuiReferenceAddColumn Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceAddColumn.html
An example demonstrating how to call the function to add a column with a width of 8.
```C
GuiReferenceAddColumn(8,&sztitle);
```
--------------------------------
### GuiUpdateEnable Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateEnable.html
Basic syntax for calling the function.
```cpp
GuiUpdateEnable(bool updateNow);
```
--------------------------------
### GuiLogClear Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiLogClear.html
A basic example showing how to invoke the function to clear the log.
```cpp
GuiLogClear();
```
--------------------------------
### Command syntax example
Source: https://help.x64dbg.com/en/latest/commands/index.html
General format for executing commands with multiple arguments.
```x64dbg
command arg1, arg2, argN
```
--------------------------------
### GuiScriptSetIp Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiScriptSetIp.html
Sets the script view to the first line.
```cpp
GuiScriptSetIp(0);
```
--------------------------------
### Evaluate Expression Example
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgValFromString.html
Usage example showing how to evaluate the 'cip' expression.
```cpp
eip = DbgValFromString("cip");
```
--------------------------------
### Setting a Menu Icon Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiMenuSetIcon.html
Demonstrates initializing an ICONDATA structure and applying it to a menu entry.
```cpp
ICONDATA rocket;
rocket.data = icon_rocket;
rocket.size = sizeof(icon_rocket);
hNewMenuEntry = GuiMenuAddEntry(hMenu, &szMenuEntryText);
GuiMenuSetIcon(hMenuDisasm,&rocket);
```
--------------------------------
### Usage example for GuiUpdateWatchView
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateWatchView.html
A simple call to refresh the watchdog view.
```cpp
GuiUpdateWatchView();
```
--------------------------------
### Check Debugging Status Examples
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgIsDebugging.html
Examples demonstrating how to check if a process is being debugged before executing specific logic.
```cpp
if(!DbgIsDebugging())
{
GuiAddLogMessage("You need to be debugging to use this option!\n");
return false;
}
```
```asm
.data
szMsg db "You need to be debugging to use this option!",13,10,0 ; CRLF
.code
Invoke DbgIsDebugging
.IF eax == FALSE
Invoke GuiAddLogMessage, Addr szMsg
.ENDIF
```
--------------------------------
### Populating Reference View Cells
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceSetCellContent.html
Example demonstrating initialization, column addition, row count setting, and populating cells with data.
```cpp
const char szRefStart = "Start";
const char szRefFinish = "Finish";
const char szRefType = "Type";
GuiReferenceInitialize("Some Information"); // Add Reference View Header Title
GuiReferenceAddColumn(2 * sizeof(DWORD),&szRefStart); // Add column Name
GuiReferenceAddColumn(2 * sizeof(DWORD),&szRefFinish); // Add column Name
GuiReferenceAddColumn(8,&szRefType); // Add column Name
GuiReferenceSetRowCount(2); // add 2 rows
int iRow = 0;
GuiReferenceSetCellContent(iRow,0,&szCodeCaveStartAddress); // add start address
GuiReferenceSetCellContent(iRow,1,&szCodeCaveFinishAddress); // add finish address
GuiReferenceSetCellContent(iRow,2,&szNop); // add type
iRow = iRow + 1; // Increment rows
// get variables to convert to strings (szCodeCaveStartAddress, szCodeCaveFinishAddress etc)
// add to next row's columns
```
--------------------------------
### Initialize Reference View Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceInitialize.html
Creates a new Reference View tab titled 'Code Caves'.
```C
GuiReferenceInitialize("Code Caves");
```
--------------------------------
### Usage Example for GuiUpdateSideBar
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateSideBar.html
A simple call to trigger a sidebar update.
```cpp
GuiUpdateSideBar();
```
--------------------------------
### GuiSymbolLogAdd Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiSymbolLogAdd.html
Example of calling the function with a message pointer.
```cpp
GuiSymbolLogAdd(&szMsg);
```
--------------------------------
### Function Usage
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateThreadView.html
Example of calling the GuiUpdateThreadView function.
```cpp
GuiUpdateThreadView();
```
--------------------------------
### Enable Script Highlighting Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiScriptEnableHighlighting.html
Enables syntax highlighting in the script view.
```cpp
GuiScriptEnableHighlighting(true);
```
--------------------------------
### GuiUpdateWindowTitle Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateWindowTitle.html
Examples showing how to clear or update the window title with a filename variable.
```cpp
GuiUpdateWindowTitle("");
GuiUpdateWindowTitle(szFileName);
```
--------------------------------
### GuiShowCpu Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiShowCpu.html
A basic call to switch the GUI focus to the CPU tab.
```cpp
GuiShowCpu();
```
--------------------------------
### Example Usage of GuiMenuAddEntry
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiMenuAddEntry.html
Demonstrates how to call the function to add a new menu entry using a menu handle and text.
```c
hNewMenuEntry = GuiMenuAddEntry(hMenu, &szMenuEntryText);
```
--------------------------------
### GuiMenuClear Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiMenuClear.html
Demonstrates adding a new menu and subsequently clearing it.
```C
hNewMenu = GuiMenuAdd(hMenu, &szMenuTitle);
GuiMenuClear(hMenuNew);
```
--------------------------------
### GuiUpdateAllViews Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateAllViews.html
A basic call to refresh all GUI views.
```cpp
GuiUpdateAllViews();
```
--------------------------------
### Execute a Command
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgCmdExec.html
Example of using DbgCmdExec to trigger the run command.
```cpp
DbgCmdExec("run");
```
--------------------------------
### BridgeFree Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/bridge/BridgeFree.html
Demonstrates the standard workflow of allocating memory with BridgeAlloc and subsequently releasing it with BridgeFree.
```cpp
auto ptr = (char*)BridgeAlloc(128);
//do something with ptr
BridgeFree(ptr);
```
--------------------------------
### Function Usage
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateArgumentWidget.html
Example of calling the function to refresh the arguments widget.
```cpp
GuiUpdateArgumentWidget();
```
--------------------------------
### GuiUpdateSEHChain Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateSEHChain.html
A simple call to refresh the SEH chain view.
```cpp
GuiUpdateSEHChain();
```
--------------------------------
### GuiUpdatePatches Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdatePatches.html
A simple call to refresh the patches view.
```cpp
GuiUpdatePatches();
```
--------------------------------
### Usage Example for GuiUpdateDumpView
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateDumpView.html
A simple call to trigger a refresh of the dump view.
```cpp
GuiUpdateDumpView();
```
--------------------------------
### GuiUpdateMemoryView Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateMemoryView.html
A simple call to refresh the memory view.
```cpp
GuiUpdateMemoryView();
```
--------------------------------
### GuiUpdateBreakpointsView Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateBreakpointsView.html
A simple call to refresh the breakpoints view.
```cpp
GuiUpdateBreakpointsView();
```
--------------------------------
### GuiUpdateRegisterView Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateRegisterView.html
A simple call to refresh the registers view.
```C++
GuiUpdateRegisterView();
```
--------------------------------
### GuiUpdateGraphView Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateGraphView.html
A simple call to refresh the Graph view.
```C++
GuiUpdateGraphView();
```
--------------------------------
### Updating Symbol Module List Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiSymbolUpdateModuleList.html
Demonstrates how to retrieve a module list and pass it to the GUI thread using GuiSymbolUpdateModuleList.
```cpp
// Build the vector of modules
std::vector modList;
if(!SymGetModuleList(&modList))
{
GuiSymbolUpdateModuleList(0, nullptr);
return;
}
// Create a new array to be sent to the GUI thread
size_t moduleCount = modList.size();
SYMBOLMODULEINFO* data = (SYMBOLMODULEINFO*)BridgeAlloc(moduleCount * sizeof(SYMBOLMODULEINFO));
// Direct copy from std::vector data
memcpy(data, modList.data(), moduleCount * sizeof(SYMBOLMODULEINFO));
// Send the module data to the GUI for updating
GuiSymbolUpdateModuleList((int)moduleCount, data);
```
--------------------------------
### DbgArgumentAdd Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgArgumentAdd.html
Demonstrates how to call DbgArgumentAdd and handle the return value with log messages.
```cpp
if(DbgArgumentAdd(0x00401000, 0x00401013))
GuiAddLogMessage("Argument successfully setted\r\n");
else
GuiAddLogMessage("Argument couldn't be set\r\n");
```
--------------------------------
### GuiUpdateDisable Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateDisable.html
Basic usage to disable GUI updates.
```cpp
GuiUpdateDisable();
```
--------------------------------
### GuiMenuAdd Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiMenuAdd.html
Basic implementation showing how to add a new menu using a handle and a title string.
```c
hNewMenu = GuiMenuAdd(hMenu, &szMenuTitle);
```
--------------------------------
### DbgArgumentDel Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgArgumentDel.html
Demonstrates how to call DbgArgumentDel and handle the return value to log the result.
```cpp
if(DbgArgumentDel(0x00401013))
GuiAddLogMessage("Argument successfully deleted\r\n");
else
GuiAddLogMessage("Argument couldn't be deleted\r\n");
```
--------------------------------
### GuiSymbolSetProgress Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiSymbolSetProgress.html
Sets the symbol view progress bar to 50 percent.
```cpp
GuiSymbolSetProgress(50);
```
--------------------------------
### GuiReferenceSetProgress Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceSetProgress.html
Updates the progress bar at different stages of an operation.
```C
GuiReferenceSetProgress(0);
// do something
GuiReferenceSetProgress(50);
// do something else
GuiReferenceSetProgress(100);
// tell user operation has ended
```
--------------------------------
### GuiScriptSetTitle Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiScriptSetTitle.html
Sets the script view window title to a specific string.
```cpp
GuiScriptSetTitle("Window Title");
```
--------------------------------
### GuiGetWindowHandle Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiGetWindowHandle.html
Retrieves the main window handle and stores it in an HWND variable.
```cpp
HWND hWnd = GuiGetWindowHandle();
```
--------------------------------
### void GuiReferenceSetSearchStartCol(int col)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceSetSearchStartCol.html
Sets the search starting column in the current Reference View instance.
```APIDOC
## GuiReferenceSetSearchStartCol
### Description
Sets the search starting column in the current Reference View instance.
### Signature
`void GuiReferenceSetSearchStartCol(int col);`
### Parameters
- **col** (int) - The 0-based column index to use for searching.
### Return Value
This function does not return a value.
### Example
```c
GuiReferenceSetSearchStartCol(1);
```
```
--------------------------------
### Displaying a Status Bar Message
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiAddStatusBarMessage.html
A basic example demonstrating how to display a string in the status bar.
```cpp
GuiAddStatusBarMessage("This text will be displayed in the statusbar.");
```
--------------------------------
### GuiReferenceReloadData Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceReloadData.html
A simple call to refresh the Reference View data.
```cpp
GuiReferenceReloadData();
```
--------------------------------
### Set Debuggee Notes Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiSetDebuggeeNotes.html
Demonstrates extracting a string from a JSON object and applying it as debuggee notes.
```cpp
const char* text = json_string_value(json_object_get(root, "notes"));
GuiSetDebuggeeNotes(text);
```
--------------------------------
### Resolve Module Exports
Source: https://help.x64dbg.com/en/latest/introduction/Values.html
Examples of resolving function addresses and ordinals within modules.
```text
ntdll.dll:ZwContinue
ntdll:memcmp
ntdll.memcmp // same as above
ntdll:1D // Ordinal 0x1D
:myexport // Export 'myexport' in the current module
```
--------------------------------
### Set Comment at Selected Instruction
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgSetCommentAt.html
Example of setting a comment at the currently selected instruction address.
```cpp
DbgSetCommentAt(DbgValFromString("dis.sel()"), "This is the currently selected instruction");
```
--------------------------------
### GuiReferenceSetCurrentTaskProgress Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceSetCurrentTaskProgress.html
Demonstrates updating the progress bar and status text at different stages of an operation.
```cpp
GuiReferenceSetCurrentTaskProgress(0,"Starting Search, Please Wait...");
// do something
GuiReferenceSetCurrentTaskProgress(50,"Searching, Please Wait...");
// do something else
GuiReferenceSetCurrentTaskProgress(100,"Finished Searching.");
// finished
```
--------------------------------
### Focusing on the Disassembly View
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiFocusView.html
Example usage of GuiFocusView to switch the active tab to the disassembly view.
```cpp
GuiFocusView(GUI_DISASSEMBLY); // focus on the disassembly tab.
```
--------------------------------
### DbgInit
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgInit.html
Initializes the debugging environment.
```APIDOC
## DbgInit
### Description
Initializes the debugging environment.
### Parameters
- **param1**: Parameter description.
### Return Value
Return value description.
### Example
```
Example code.
```
```
--------------------------------
### Define Initialization Exports
Source: https://help.x64dbg.com/en/latest/developers/plugins/basics.html
Required exports for plugin lifecycle management including initialization, stopping, and setup.
```cpp
extern "C" __declspec(dllexport) bool pluginit(PLUG_INITSTRUCT* initStruct);
extern "C" __declspec(dllexport) bool plugstop();
extern "C" __declspec(dllexport) void plugsetup(PLUG_SETUPSTRUCT* setupStruct);
```
--------------------------------
### Equivalent Command Sequence for bpgoto
Source: https://help.x64dbg.com/en/latest/commands/breakpoint-control/bpgoto.html
This sequence of commands demonstrates the underlying operations performed by the bpgoto command.
```x64dbg
SetBreakpointCondition arg1, 0
SetBreakpointCommand arg1, "CIP=arg2"
SetBreakpointCommandCondition arg1, 1
SetBreakpointFastResume arg1, 0
```
--------------------------------
### void GuiReferenceInitialize(const char* name)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceInitialize.html
Initializes and creates a new instance of a Reference View. A new tab will appear under Reference Views entitled as per the name parameter.
```APIDOC
## void GuiReferenceInitialize(const char* name)
### Description
Initializes and creates a new instance of a Reference View. A new tab will appear under Reference Views entitled as per the name parameter.
### Parameters
- **name** (const char*) - Required - The text string to name the Reference View instance.
### Return Value
This function does not return a value.
### Example
```cpp
GuiReferenceInitialize("Code Caves");
```
```
--------------------------------
### InitDebug/initdbg/init
Source: https://help.x64dbg.com/en/latest/commands/debug-control/InitDebug.html
Initializes the debugger, loads the executable, sets breakpoints on TLS callbacks and the entry point, and breaks at the system breakpoint.
```APIDOC
## InitDebug/initdbg/init
### Description
Initializes the debugger. This command will load the executable, set breakpoints on TLS callbacks (if present), set a breakpoint at the process entry point, and break at the system breakpoint.
### Arguments
- **arg1** (string) - Required - Path to the executable file to debug. If no full path is given, the GetCurrentDirectory API is used.
- **arg2** (string) - Optional - Commandline to create the process with.
- **arg3** (string) - Optional - Current folder (working directory) passed to the CreateProcess API.
### Result
This command gives control back to the user after the system breakpoint is reached. It sets the $pid, $hp, and $hProcess variables.
```
--------------------------------
### Define PLUG_SETUPSTRUCT structure
Source: https://help.x64dbg.com/en/latest/developers/plugins/Structures/setupstruct.html
This structure is used by the function that allows the creation of plugin menu entries.
```C
struct PLUG_SETUPSTRUCT
{
//data provided by the debugger to the plugin.
[IN] HWND hwndDlg; //GUI window handle
[IN] int hMenu; //plugin menu handle
[IN] int hMenuDisasm; //plugin disasm menu handle
[IN] int hMenuDump; //plugin dump menu handle
[IN] int hMenuStack; //plugin stack menu handle
};
```
--------------------------------
### StepSystem/StepSystemInto
Source: https://help.x64dbg.com/en/latest/commands/debug-control/StepSystem.html
Steps into execution until a system module is reached.
```APIDOC
## StepSystem/StepSystemInto
### Description
Steps into code execution until a system module is reached.
### Arguments
This command has no arguments.
### Results
This command does not set any result variables.
```
--------------------------------
### void GuiOpenTraceFile(const char* fileName)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiOpenTraceFile.html
Opens a specified run trace file in the trace view.
```APIDOC
## void GuiOpenTraceFile(const char* fileName)
### Description
Opens a run trace file (*.trace32 or *.trace64 file) in the trace view.
### Parameters
- **fileName** (const char*) - Required - Path to the run trace file.
### Return Value
This function does not return a value.
```
--------------------------------
### Setting USER variables
Source: https://help.x64dbg.com/en/latest/introduction/Variables.html
Demonstrates basic assignment syntax to create or update a USER variable.
```text
mov myvar, 1234
mov $myvar, 1234
myvar = 1234
$myvar = 1234
```
--------------------------------
### DbgValSetScalar Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgValSetScalar.html
Sets the value of the 'eax' register to 1.
```cpp
DbgValSetScalar("eax", 1);
```
--------------------------------
### Function Analysis
Source: https://help.x64dbg.com/en/latest/introduction/Expression-functions.html
Functions to retrieve the start and end addresses of a function.
```APIDOC
## Function Analysis
- `func.start()`: Returns the start address of the function containing `addr`.
- `func.end()`: Returns the end address of the function containing `addr`.
```
--------------------------------
### Function Signature
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceSetSearchStartCol.html
The function definition for setting the search starting column.
```C
void GuiReferenceSetSearchStartCol(int col);
```
--------------------------------
### Argument Functions
Source: https://help.x64dbg.com/en/latest/introduction/Expression-functions.html
Functions to get or set function arguments on the stack.
```APIDOC
## Argument Functions
- `arg(index)`, `arg.get(index)`: Gets the argument at the specified zero-based `index`.
- `arg.set(index, value)`: Sets the argument at the specified zero-based `index` to `value`.
```
--------------------------------
### void GuiShowCpu()
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiShowCpu.html
Switches the focus and view of the GUI to the main disassembly window (CPU tab).
```APIDOC
## void GuiShowCpu()
### Description
Switches the focus and view of the GUI to the main disassembly window (CPU tab).
### Parameters
This function has no parameters.
### Return Value
This function does not return a value.
### Example
```cpp
GuiShowCpu();
```
```
--------------------------------
### GuiUpdateCallStack Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateCallStack.html
A simple call to refresh the call stack widget.
```cpp
GuiUpdateCallStack();
```
--------------------------------
### refinit
Source: https://help.x64dbg.com/en/latest/commands/gui/refinit.html
Initializes a reference view for command usage.
```APIDOC
## refinit
### Description
Initializes a reference view for command usage.
### Arguments
- **arg1** (string) - Required - The title of the new reference view. String formatting is supported.
```
--------------------------------
### GuiSymbolRefreshCurrent Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiSymbolRefreshCurrent.html
A basic call to refresh the current symbol view.
```cpp
GuiSymbolRefreshCurrent();
```
--------------------------------
### GuiSymbolLogClear Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiSymbolLogClear.html
Basic usage of the function to clear the symbol log.
```cpp
GuiSymbolLogClear();
```
--------------------------------
### GuiReferenceDeleteAllColumns Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceDeleteAllColumns.html
A simple call to remove all columns from the Reference View.
```cpp
GuiReferenceDeleteAllColumns();
```
--------------------------------
### GuiIsUpdateDisabled Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiIsUpdateDisabled.html
Retrieves the current update status into a boolean variable.
```cpp
bool bUpdate = GuiIsUpdateDisabled();
```
--------------------------------
### void GuiDumpAt(duint va)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiDumpAt.html
Sets the dump window to display the contents at the specified virtual address.
```APIDOC
## void GuiDumpAt(duint va)
### Description
Changes the address of the dump window to the given virtual address, allowing the user to view memory at that location.
### Parameters
- **va** (duint) - The virtual address of the pointer to dump.
### Return Value
This function does not return a value.
```
--------------------------------
### BridgeStart
Source: https://help.x64dbg.com/en/latest/developers/functions/bridge/BridgeStart.html
Initializes the bridge functionality.
```APIDOC
## BridgeStart
### Description
Initializes the bridge functionality.
### Parameters
- **param1**: Parameter description.
### Return Value
Return value description.
### Example
```
Example code.
```
```
--------------------------------
### DbgArgumentGet
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgArgumentGet.html
Retrieves the start and end address boundaries for a given argument address.
```APIDOC
## DbgArgumentGet
### Description
Gets the boundaries of the given argument location as start and end addresses.
### Signature
`bool DbgArgumentGet(duint addr, duint* start, duint* end);`
### Parameters
- **addr** (duint) - Address of the argument to fetch.
- **start** (duint*) - Pointer to a duint variable that will hold the start address of the argument.
- **end** (duint*) - Pointer to a duint variable that will hold the end address of the argument.
### Return Value
- **bool** - Returns TRUE if the start and end addresses are found, FALSE otherwise. If TRUE, the variables `start` and `end` will hold the fetched values.
### Example
```cpp
duint start;
duint end;
std::string message;
if(DbgArgumentGet(0x00401000, &start, &end))
{
sprintf_s(message.c_str(), MAX_PATH, "Argument range: %08X-%08X\r\n", start, end);
GuiAddLogMessage(message);
}
else
{
GuiAddLogMessage("Argument start and end addresses couldn't be get\r\n");
}
```
```
--------------------------------
### Define _plugin_startscript function
Source: https://help.x64dbg.com/en/latest/developers/plugins/API/startscript.html
Use this function signature to initiate an asynchronous callback thread.
```c
void _plugin_startscript(
CBPLUGINSCRIPT cbScript //callback
);
```
--------------------------------
### Refresh Disassembly View Usage
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateDisassemblyView.html
Example of calling the function to update the disassembly view.
```cpp
GuiUpdateDisassemblyView();
```
--------------------------------
### Initialize Reference View Function Signature
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceInitialize.html
The function signature for initializing a new Reference View instance.
```C
void GuiReferenceInitialize(const char* name)
```
--------------------------------
### GuiReferenceSetRowCount Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceSetRowCount.html
Sets the Reference View to contain exactly 5 rows.
```C
GuiReferenceSetRowCount(5);
```
--------------------------------
### void GuiScriptMessage(const char* message)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiScriptMessage.html
Displays a message in the GUI.
```APIDOC
## void GuiScriptMessage(const char* message)
### Description
Displays a message in the GUI.
### Parameters
- **message** (const char*) - The message string to be displayed.
### Return Value
This function does not return a value.
```
--------------------------------
### Display a Warning Dialog
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiDisplayWarning.html
Example usage of the GuiDisplayWarning function to show a warning message.
```cpp
GuiDisplayWarning("Warning!", "Operation cannot be reversed.");
```
--------------------------------
### FoldDisassembly
Source: https://help.x64dbg.com/en/latest/commands/gui/FoldDisassembly.html
Folds the disassembly within the specified range defined by a start address and length.
```APIDOC
## FoldDisassembly
### Description
Folds the disassembly within the specified range.
### Arguments
- **arg1** (address) - The start address of the range.
- **arg2** (integer) - The length of the range.
### Results
This command does not set any result variables.
```
--------------------------------
### GuiUpdateTimeWastedCounter Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateTimeWastedCounter.html
Basic usage of the function to trigger a refresh of the time wasted counter.
```cpp
GuiUpdateTimeWastedCounter();
```
--------------------------------
### GuiReferenceSetSingleSelection Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceSetSingleSelection.html
Sets the first row as the selected item and ensures it is scrolled into view.
```cpp
GuiReferenceSetSingleSelection(0,true);
```
--------------------------------
### GuiLoadSourceFile
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiLoadSourceFile.html
Loads a source file into the GUI.
```APIDOC
## GuiLoadSourceFile
### Description
Loads a source file into the GUI interface.
### Parameters
- **param1**: Parameter description.
### Return Value
Return value description.
### Example
```
Example code.
```
```
--------------------------------
### void GuiSetGlobalNotes(char** text)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiSetGlobalNotes.html
Sets the global notes in the GUI using the provided string pointer.
```APIDOC
## void GuiSetGlobalNotes(char** text)
### Description
Sets the global notes, based on the text variable passed to the function. The text variable is a pointer to a string containing the information to set as the global notes.
### Parameters
- **text** (char**) - Required - A variable that contains a pointer to a string that contains the text to set as the global notes.
### Return Value
This function does not return a value.
### Example
```cpp
notesFile = String(szProgramDir) + "\\notes.txt";
String text;
if(!FileExists(notesFile.c_str()) || FileHelper::ReadAllText(notesFile, text))
GuiSetGlobalNotes(text.c_str());
```
```
--------------------------------
### Register a command in x64dbg
Source: https://help.x64dbg.com/en/latest/developers/plugins/API/registercommand.html
Registers a new command with the plugin system. Ensure the return value is checked to confirm successful registration.
```cpp
bool _plugin_registercommand(
int pluginHandle, //plugin handle
const char* command, //command name
CBPLUGINCOMMAND cbCommand, //function that is called when the command is executed
bool debugonly //restrict the command to debug-only
);
```
--------------------------------
### HWND GuiGetWindowHandle()
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiGetWindowHandle.html
Retrieves the main window handle for the x64dbg application.
```APIDOC
## HWND GuiGetWindowHandle()
### Description
Obtains the main window handle for x64dbg.
### Parameters
This function has no parameters.
### Return Value
Returns the main window handle for x64dbg as a HWND variable.
### Example
```cpp
HWND hWnd = GuiGetWindowHandle();
```
```
--------------------------------
### void _plugin_startscript(CBPLUGINSCRIPT cbScript)
Source: https://help.x64dbg.com/en/latest/developers/plugins/API/startscript.html
Creates a new thread to run the provided callback function asynchronously.
```APIDOC
## void _plugin_startscript(CBPLUGINSCRIPT cbScript)
### Description
Creates a new thread to run the callback function asynchronously.
### Parameters
- **cbScript** (CBPLUGINSCRIPT) - Required - A callback function with the typedef: typedef void (*CBPLUGINSCRIPT)();
### Return Values
This function does not return a value.
```
--------------------------------
### void GuiUpdateWindowTitle(const char* filename)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateWindowTitle.html
Updates the x64dbg window title by appending the provided string.
```APIDOC
## void GuiUpdateWindowTitle(const char* filename)
### Description
Updates the x64dbg window title with a string to be appended to the title text. Typically the string is a filename.
### Parameters
- **filename** (const char*) - Required - A string to be appended to the x64dbg title bar.
### Return Value
This function does not return a value.
### Example
```cpp
GuiUpdateWindowTitle("");
GuiUpdateWindowTitle(szFileName);
```
```
--------------------------------
### void GuiSymbolSetProgress(int percent)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiSymbolSetProgress.html
Sets the progress bar in the symbol view to a specific percentage.
```APIDOC
## void GuiSymbolSetProgress(int percent)
### Description
Sets the progress bar in the symbol view based on the integer value supplied. This can be used to convey to the user an operation and how close it is to completion.
### Parameters
- **percent** (int) - Required - An integer representing the percentage to set for the progress bar.
### Return Value
This function does not return a value.
### Example
```c
GuiSymbolSetProgress(50);
```
```
--------------------------------
### Adding a Separator to a Menu
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiMenuAddSeparator.html
Demonstrates creating a menu, adding entries, inserting a separator, and adding further entries.
```C
hNewMenu = GuiMenuAdd(hMenu, &szMenuTitle);
GuiMenuAddEntry(hNewMenu, &szMenuEntry1Text);
GuiMenuAddEntry(hNewMenu, &szMenuEntry2Text);
GuiMenuAddSeparator(hNewMenu);
GuiMenuAddEntry(hNewMenu, &szMenuEntry3Text);
GuiMenuAddEntry(hNewMenu, &szMenuEntry4Text);
```
--------------------------------
### void GuiMenuSetIcon(int hMenu, const ICONDATA* icon)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiMenuSetIcon.html
Sets an icon for a specified menu handle.
```APIDOC
## void GuiMenuSetIcon(int hMenu, const ICONDATA* icon)
### Description
Sets an icon for a specified menu. This function is used to associate an icon resource with a menu handle.
### Parameters
- **hMenu** (int) - Menu handle from a previously-added menu or from the main menu.
- **icon** (const ICONDATA*) - Pointer to the icon data structure.
### Return Value
This function does not return a value.
### Example
```cpp
ICONDATA rocket;
rocket.data = icon_rocket;
rocket.size = sizeof(icon_rocket);
hNewMenuEntry = GuiMenuAddEntry(hMenu, &szMenuEntryText);
GuiMenuSetIcon(hMenuDisasm,&rocket);
```
```
--------------------------------
### void GuiUpdateSEHChain()
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiUpdateSEHChain.html
Refreshes the contents of the SEH Chain view in the GUI.
```APIDOC
## void GuiUpdateSEHChain()
### Description
Refreshes the contents of the SEH Chain view.
### Parameters
This function has no parameters.
### Return Value
This function does not return a value.
### Example
```cpp
GuiUpdateSEHChain();
```
```
--------------------------------
### int GuiMenuAddEntry(int hMenu, const char* title)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiMenuAddEntry.html
Adds a menu entry to a specified menu handle.
```APIDOC
## GuiMenuAddEntry
### Description
Adds a menu entry to a menu.
### Signature
`int GuiMenuAddEntry(int hMenu, const char* title)`
### Parameters
- **hMenu** (int) - Menu handle from a previously-added menu or from the main menu.
- **title** (const char*) - The text title of the menu item to be added.
### Return Value
- **int** - Returns the menu handle (unique), or -1 on failure.
### Example
```c
hNewMenuEntry = GuiMenuAddEntry(hMenu, &szMenuEntryText);
```
```
--------------------------------
### DbgValSetBuffer Usage Example
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgValSetBuffer.html
Demonstrates setting a value named _K0 using an unsigned long long variable.
```cpp
unsigned long long opmask = 1;
DbgValSetBuffer("_K0", &opmask, sizeof(opmask));
```
--------------------------------
### void GuiDumpAtN(duint va, int index)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiDumpAtN.html
Changes the address of the Nth dump window to the specified virtual address.
```APIDOC
## GuiDumpAtN
### Description
Changes the address of the Nth dump window to the given virtual address, to show the dump at this address in the specified dump window.
### Signature
`void GuiDumpAtN(duint va, int index)`
### Parameters
- **va** (duint) - Virtual address of the pointer to dump.
- **index** (int) - Index of the dump window.
### Return Value
This function does not return a value.
```
--------------------------------
### Example Usage of DbgSetAutoCommentAt
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgSetAutoCommentAt.html
Sets an auto comment on the currently selected instruction using DbgValFromString to resolve the address.
```cpp
DbgSetAutoCommentAt(DbgValFromString("dis.sel()"), "This is the currently selected instruction");
```
--------------------------------
### void GuiFocusView(int hWindow)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiFocusView.html
Changes the active view to the specified window.
```APIDOC
## void GuiFocusView(int hWindow)
### Description
Changes the active view to the given view.
### Parameters
- **hWindow** (int) - Required - One of the following values: GUI_DISASSEMBLY, GUI_DUMP, GUI_STACK, GUI_GRAPH, GUI_MEMMAP, GUI_SYMMOD, GUI_THREADS.
### Return Value
This function does not return a value.
### Example
```cpp
GuiFocusView(GUI_DISASSEMBLY); // focus on the disassembly tab.
```
```
--------------------------------
### bool BridgeSettingRead(int* errorLine)
Source: https://help.x64dbg.com/en/latest/developers/functions/bridge/BridgeSettingRead.html
Reads settings from the INI file. Returns true on success, false on failure.
```APIDOC
## BridgeSettingRead
### Description
Read the settings from disk (INI file).
### Signature
`bool BridgeSettingRead(int* errorLine)`
### Parameters
- **errorLine** (int*) - Pointer to an integer that will be populated with the line number where an error occurred if the function fails.
### Return Value
- **bool** - Returns true if successful, false otherwise.
```
--------------------------------
### Get Reference View Row Count
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiReferenceGetRowCount.html
Retrieves the total number of rows in the current Reference View instance as an integer.
```cpp
int GuiReferenceGetRowCount()
```
```cpp
int iTotalRows = GuiReferenceGetRowCount();
```
--------------------------------
### Search for a pattern in the current memory page
Source: https://help.x64dbg.com/en/latest/commands/searching/findall.html
Searches for a specific byte pattern starting from the base address of the current instruction pointer.
```x64dbg
findall mem.base(cip), "0FA2 E8 ???????? C3"
```
--------------------------------
### bool DbgArgumentAdd(duint start, duint end)
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgArgumentAdd.html
Adds an argument to the specified address range. Returns true if successful, false otherwise.
```APIDOC
## DbgArgumentAdd
### Description
Adds an argument to the specified address range.
### Signature
`bool DbgArgumentAdd(duint start, duint end)`
### Parameters
- **start** (duint) - The first address of the argument range.
- **end** (duint) - The last address of the argument range.
### Return Value
- **bool** - Returns TRUE if the argument is successfully set, FALSE otherwise.
### Example
```cpp
if(DbgArgumentAdd(0x00401000, 0x00401013))
GuiAddLogMessage("Argument successfully setted\r\n");
else
GuiAddLogMessage("Argument couldn't be set\r\n");
```
```
--------------------------------
### void GuiScriptAdd(int count, const char** lines)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiScriptAdd.html
Reloads the script view with a new script provided as an array of strings.
```APIDOC
## void GuiScriptAdd(int count, const char** lines)
### Description
Reloads the script view with a new script.
### Parameters
- **count** (int) - Number of lines.
- **lines** (const char**) - A buffer containing count pointers to UTF-8 strings, each representing a single line. This buffer is freed by BridgeFree afterwards.
### Return Value
This function does not return a value.
```
--------------------------------
### Get page size and base address
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgMemGetPageSize.html
Retrieves the page size for a selected memory address and optionally finds the base address of the memory section.
```cpp
SELECTIONDATA sel; // Define Address the slected line in the Disassembly window ( begin , End )
GuiSelectionGet(GUI_DISASSEMBLY, &sel); // Get the value of sel(begin addr , End addr )
duint pagesize = DbgMemGetPageSize(sel.start); // get the page size of the section from the selected memory addr
//Or use the following statement to get page base and size in one call.
duint sctionbase = DbgMemFindBaseAddr(sel.start, &pagesize); // get the base of this section ( begin addr of the section )
```
--------------------------------
### DbgAssembleAt
Source: https://help.x64dbg.com/en/latest/developers/functions/debug/DbgAssembleAt.html
Assembles instructions at a specified address.
```APIDOC
## DbgAssembleAt
### Description
Function description.
### Definition
```
Function definition.
```
### Parameters
- **param1**: Parameter description.
### Return Value
Return value description.
### Example
```
Example code.
```
```
--------------------------------
### void GuiScriptSetTitle(const char* title)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiScriptSetTitle.html
Sets the window title of the script view.
```APIDOC
## void GuiScriptSetTitle(const char* title)
### Description
Sets the window title of the script view.
### Parameters
- **title** (const char*) - Required - Window title of the script view.
### Return Value
This function does not return a value.
### Example
```cpp
GuiScriptSetTitle("Window Title");
```
```
--------------------------------
### GuiGetDisassembly
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiGetDisassembly.html
Retrieves disassembly information from the x64dbg GUI.
```APIDOC
## GuiGetDisassembly
### Description
Retrieves disassembly information from the GUI interface.
### Parameters
- **param1** - Parameter description.
### Return Value
Return value description.
### Example
```
Example code.
```
```
--------------------------------
### bool BridgeSettingGetUint(const char* section, const char* key, duint* value)
Source: https://help.x64dbg.com/en/latest/developers/functions/bridge/BridgeSettingGetUint.html
Reads an integer from the settings.
```APIDOC
## BridgeSettingGetUint
### Description
Reads an integer from the settings.
### Signature
`bool BridgeSettingGetUint(const char* section, const char* key, duint* value)`
### Parameters
- **section** (const char*) - Section name to read.
- **key** (const char*) - Key in the section to read.
- **value** (duint*) - Destination value.
### Return Value
Returns true if successful or false otherwise.
```
--------------------------------
### int GuiMenuAdd(int hMenu, const char* title)
Source: https://help.x64dbg.com/en/latest/developers/functions/gui/GuiMenuAdd.html
Adds a new child menu to a specified menu.
```APIDOC
## GuiMenuAdd
### Description
Adds a new child menu to a menu.
### Signature
`int GuiMenuAdd(int hMenu, const char* title)`
### Parameters
- **hMenu** (int) - Menu handle from a previously-added menu or from the main menu.
- **title** (const char*) - The text title of the menu item to be added.
### Return Value
Returns the menu handle (unique), or -1 on failure.
### Example
```c
hNewMenu = GuiMenuAdd(hMenu, &szMenuTitle);
```
```