githubEdit

!lbr (tracing branches using Last Branch Record)

Description of '!lbr' command in HyperDbg.

Command

!lbr

Syntax

!lbr [Function (string)]

!lbr [filter FilterOptions (string)]

Description

Performs operations for Last Branch Record (LBR), including enabling, disabling, flushing, and configuring filters.

circle-info

To dump the LBR entries after enabling them, use the '!lbrdumparrow-up-right' command.

Parameters

[Function (string)]

The target functionality. Can be one of the following values:

Function
Description

enable

Enable the Last Branch Record

disable

Disable the Last Branch Record

flush

Flush (clear) the Last Branch Record

filter

Configure the LBR filter options

[FilterOptions (string)] (optional)

One or more filter options to configure which branch types are not captured. If no option is specified, everything is captured (default). Can be a combination of the following values:

Option
Description

kernel

Do not capture at ring 0

user

Do not capture at ring > 0

jcc

Do not capture conditional branches

rel_call

Do not capture relative calls

ind_call

Do not capture indirect calls

return

Do not capture near returns

ind_jmp

Do not capture indirect jumps

rel_jmp

Do not capture relative jumps

far

Do not capture far branches

Examples

The following command enables the Last Branch Record.

The following command disables the Last Branch Record.

The following command flushes (clears) the Last Branch Record.

The following command applies the default LBR configuration in which all types of branches are shown or in other words, it just resets the filter options to include all branches.

The following command configures the LBR filter to not capture kernel-mode conditional branches, indirect jumps, relative jumps, and far branches.

The following command configures the LBR filter to not capture kernel-mode conditional branches, near returns, indirect jumps, relative jumps, and far branches.

The following command configures the LBR filter to not capture kernel-mode conditional branches, indirect jumps, and relative jumps.

The following command configures the LBR filter to not capture user-mode relative calls, indirect calls, near returns, and far branches.

IOCTL

None

Remarks

Starting from v0.19, this command was added to the HyperDbg debugger.

This command will continue the debuggee for some time (in Debugger Mode). This means that you lose the current context (registers & memory) after executing this command.

Requirements

None

lbr_savearrow-up-right

lbr_printarrow-up-right

!lbrdump (dump Last Branch Record entries)arrow-up-right

Last updated