danielbohannon / Invoke-Obfuscation

PowerShell Obfuscator
Apache License 2.0
3.62k stars 763 forks source link

Exclude function names from token randomization #7

Closed IISResetMe closed 7 years ago

IISResetMe commented 7 years ago

PSParser.Tokenize() treats function name literals as CommandArgument tokens. This causes the TOKEN\ARGUMENT\1 (Random Case) routine to quote the function name, incidentally invalidating function definitions.

Suggested way of avoiding this is to exclude CommandArgument tokens in Out-ObfuscatedTokenCommand from random quoting if the preceding token is the function keyword

danielbohannon commented 7 years ago

Issue fixed in d419d0b4a0592c0cd48d7a22d462477f4b976970 release.