def obfuscatePowershellScript(code):
 import re
 newCode = code
 newCode = remove_comments(newCode)
 if ('function Invoke-ReflectivePEInjection' in newCode):
  newCode = newCode.replace("$TypeBuilder.DefineLiteral('IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE', [UInt16] 0x0040) | Out-Null", "$TypeBuilder.DefineLiteral('IMAGE_DLL_CHARACTERIS'+'TICS_DYNAMIC_BASE', [UInt16] 0x0040) | Out-Null")
 return newCode

def obfuscatePowershellScript ( code ) : import re newCode = code newCode = remove_comments ( newCode ) if ( 'function Invoke-ReflectivePEInjection' in newCode ) : newCode = newCode . replace ( "$TypeBuilder.DefineLiteral('IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE', [UInt16] 0x0040) | Out-Null" , "$TypeBuilder.DefineLiteral('IMAGE_DLL_CHARACTERIS'+'TICS_DYNAMIC_BASE', [UInt16] 0x0040) | Out-Null" ) return newCode
try to clean powershell script .