Skip to content

Commit

Permalink
document scriptcmd
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Jul 28, 2020
1 parent 021794f commit d4bb877
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/script/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ This section contains various commands that are only used or available in a scri
printstack
ret
scriptload
scriptdll
scriptdll
scriptcmd
29 changes: 29 additions & 0 deletions commands/script/scriptcmd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# scriptcmd

Execute a command in the context of a running script.

## arguments

Unlike other commands this command forwards everything after `scriptcmd ` directly to the command processor.

For example `scriptcmd add rax, 0x1245` will execute the command `add rax, 0x1234`.

## result

This command does not set any result variables.

## example

This command can be used in combination with [SetBreakpointCommand](../conditional-breakpoint-control/SetBreakpointCommand.md) to execute scripts on breakpoint callbacks:

```
fn_addr = module.dll:$0x1234 // module.dll RVA 0x1234
bp fn_addr
SetBreakpointCommand fn_addr, "scriptcmd call mycallback"
// make sure the script is not unloaded
mycallback:
log "fn({arg.get(0)}, {arg.get(1)})"
ret
```

0 comments on commit d4bb877

Please sign in to comment.