FindSymbolWithPattern uses regexp from one or multiple clues to find variable or function symbol in obfuscated code. Returns the matched symbols and the pattern that matched.
(debugInfo, content string, clues []string)
| 318 | // FindSymbolWithPattern uses regexp from one or multiple clues to find variable or |
| 319 | // function symbol in obfuscated code. Returns the matched symbols and the pattern that matched. |
| 320 | func FindSymbolWithPattern(debugInfo, content string, clues []string) ([]string, string) { |
| 321 | for _, v := range clues { |
| 322 | re := regexp.MustCompile(v) |
| 323 | found := re.FindStringSubmatch(content) |
| 324 | if found != nil { |
| 325 | return found[1:], v |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | if len(debugInfo) > 0 { |
| 330 | PrintError("Cannot find symbol for " + debugInfo) |
| 331 | } |
| 332 | |
| 333 | return nil, "" |
| 334 | } |
| 335 | |
| 336 | // CreateJunction creates a junction in Windows or a symlink in Linux/Mac. |
| 337 | func CreateJunction(location, destination string) error { |
no test coverage detected