From b800eaa1978612d9b7b75934832e4f23d54b291b Mon Sep 17 00:00:00 2001 From: doronz88 Date: Wed, 11 Sep 2024 15:52:15 +0300 Subject: [PATCH] commands: fix if-not --- commands.md | 42 +++++++++---------- fa/commands/{if-not.py => if_not.py} | 0 .../sublime/sig.sublime-completions | 10 ++--- 3 files changed, 25 insertions(+), 27 deletions(-) rename fa/commands/{if-not.py => if_not.py} (100%) diff --git a/commands.md b/commands.md index 0e61a5c..d5dbd80 100644 --- a/commands.md +++ b/commands.md @@ -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) @@ -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 @@ -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 @@ -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. diff --git a/fa/commands/if-not.py b/fa/commands/if_not.py similarity index 100% rename from fa/commands/if-not.py rename to fa/commands/if_not.py diff --git a/ide-completions/sublime/sig.sublime-completions b/ide-completions/sublime/sig.sublime-completions index 63274bf..e2e578b 100644 --- a/ide-completions/sublime/sig.sublime-completions +++ b/ide-completions/sublime/sig.sublime-completions @@ -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", @@ -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",