MCPcopy Index your code
hub / github.com/spicetify/cli / FindSymbolWithPattern

Function FindSymbolWithPattern

src/utils/utils.go:320–334  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
320func 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.
337func CreateJunction(location, destination string) error {

Callers 1

insertCustomAppFunction · 0.92

Calls 1

PrintErrorFunction · 0.85

Tested by

no test coverage detected