Skip to content

Commit

Permalink
commands: fix if-not
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Sep 11, 2024
1 parent 3c83a05 commit b800eaa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
42 changes: 20 additions & 22 deletions commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Below is the list of available commands:
- [function-lines](#function-lines)
- [function-start](#function-start)
- [goto-ref](#goto-ref)
- [if-not](#if-not)
- [if](#if)
- [if-not](#if-not)
- [intersect](#intersect)
- [keystone-find-opcodes](#keystone-find-opcodes)
- [keystone-verify-opcodes](#keystone-verify-opcodes)
Expand Down Expand Up @@ -182,9 +182,8 @@ options:
```
usage: deref-data [-h] -l LEN
Dereference pointer as integer data type. Note that the data is assumed to be stored in little endian format. Example #1:
0x00000000: LDR R1, [SP, #0x34] results = [0] -> deref-data -l 4 results = [0xe5d1034] Example #2: 0x00000000: LDR R1, [SP, #0x34]
results = [0] -> deref-data -l 2 results = [0x1034]
Dereference pointer as integer data type. Note that the data is assumed to be stored in little endian format. Example #1: 0x00000000: LDR R1, [SP, #0x34] results = [0] -> deref-data -l 4 results = [0xe5d1034] Example #2: 0x00000000: LDR R1, [SP, #0x34] results = [0]
-> deref-data -l 2 results = [0x1034]
options:
-h, --help show this help message and exit
Expand Down Expand Up @@ -374,56 +373,56 @@ options:
--code include code references
--data include data references
```
## if-not
## if
```
usage: if-not [-h] cond label
usage: if [-h] cond label
perform an 'if not' statement to create conditional branches
perform an 'if' statement to create conditional branches
using an FA command
EXAMPLE:
results = [0, 4, 8]
-> if-not 'verify-single' a_is_single_label
-> if 'verify-single' a_is_single_label
set-name a_is_single
set-name a_isnt_single
b end
label a_is_not_single_label
set-name a_is_not_single
label a_is_single_label
set-name a_is_single
label end
positional arguments:
cond condition as an FA command
label label to jump to if condition is false
label label to jump to if condition is true
options:
-h, --help show this help message and exit
```
## if
## if-not
```
usage: if [-h] cond label
usage: if-not [-h] cond label
perform an 'if' statement to create conditional branches
perform an 'if not' statement to create conditional branches
using an FA command
EXAMPLE:
results = [0, 4, 8]
-> if 'verify-single' a_is_single_label
-> if-not 'verify-single' a_is_single_label
set-name a_isnt_single
set-name a_is_single
b end
label a_is_single_label
set-name a_is_single
label a_is_not_single_label
set-name a_is_not_single
label end
positional arguments:
cond condition as an FA command
label label to jump to if condition is true
label label to jump to if condition is false
options:
-h, --help show this help message and exit
Expand Down Expand Up @@ -637,8 +636,7 @@ options:
```
## next-instruction
```
usage: next-instruction [-h] [--limit LIMIT] [--back] [--op0 OP0] [--op1 OP1] [--op2 OP2] [--op3 OP3] [--op4 OP4] [--op5 OP5]
mnem [mnem ...]
usage: next-instruction [-h] [--limit LIMIT] [--back] [--op0 OP0] [--op1 OP1] [--op2 OP2] [--op3 OP3] [--op4 OP4] [--op5 OP5] mnem [mnem ...]
Map the resultset to the next instruction of a given pattern. The instruction is searched for linearly.
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions ide-completions/sublime/sig.sublime-completions
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@
"contents": "goto-ref --code --data"
},
{
"trigger": "if-not",
"trigger": "if",
"kind": "snippet",
"contents": "if-not ${1:cond} ${2:label}"
"contents": "if ${1:cond} ${2:label}"
},
{
"trigger": "if",
"trigger": "if-not",
"kind": "snippet",
"contents": "if ${1:cond} ${2:label}"
"contents": "if-not ${1:cond} ${2:label}"
},
{
"trigger": "intersect",
Expand Down Expand Up @@ -159,7 +159,7 @@
{
"trigger": "next-instruction",
"kind": "snippet",
"contents": "next-instruction --limit ${1:LIMIT} --back --op0 ${2:OP0} --op1 ${3:OP1} --op2 ${4:OP2} --op3 ${5:OP3} --op4 ${6:OP4} --op5 ${7:OP5} ${8:mnem} ${9:mnem} ..."
"contents": "next-instruction --limit ${1:LIMIT} --back --op0 ${2:OP0} --op1 ${3:OP1} --op2 ${4:OP2} --op3 ${5:OP3} --op4 ${6:OP4} --op5 ${7:OP5} ${8:mnem} ${9:mnem} ..."
},
{
"trigger": "offset",
Expand Down

0 comments on commit b800eaa

Please sign in to comment.