MCPcopy Create free account
hub / github.com/Bashfuscator/Bashfuscator / strToArrayElements

Method strToArrayElements

bashfuscator/core/mutators/mutator.py:59–74  ·  view source on GitHub ↗
(self, inCmd)

Source from the content-addressed store, hash-verified

57 return inCmd.replace("'", "'\"'\"'")
58
59 def strToArrayElements(self, inCmd):
60 # escape all Ascii unprintable chars, as well as all special chars and space chars
61 escapeChars = string.punctuation + " " + "".join(chr(i) for i in range(1, 33)) + chr(127)
62 ansicQuoteChars = [chr(10), chr(11), chr(12), chr(13)]
63 arrayElementsStr = "* *"
64
65 for char in inCmd:
66 if char in escapeChars:
67 if char in ansicQuoteChars:
68 char = self.mangler._getAnsiCQuotedStr(char)
69 else:
70 char = "\\" + char
71
72 arrayElementsStr += char + "% %"
73
74 return arrayElementsStr[:-3] + "* *"

Callers 1

mutateMethod · 0.80

Calls 1

_getAnsiCQuotedStrMethod · 0.80

Tested by

no test coverage detected