Skip to content

Commit c092642

Browse files
Merge pull request #2 from wmetcalf/master
tries to deal with empty sets of double quotes inside of quoted string which apparently is allowed and abused.
2 parents a0d9d51 + 1295741 commit c092642

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: batch_deobfuscator/batch_interpreter.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ def normalize_command(self, command):
165165
if state == "init": # init state
166166
if char == '"': # quote is on
167167
state = "str_s"
168-
normalized_com += char
168+
if normalized_com and normalized_com[-1] == '"':
169+
normalized_com = normalized_com[:-1]
170+
else:
171+
normalized_com += char
169172
elif char == "," or char == ";" or char == "\t":
170173
# commas (",") are replaced by spaces, unless they are part of a string in doublequotes
171174
# semicolons (";") are replaced by spaces, unless they are part of a string in doublequotes

0 commit comments

Comments
 (0)