MCPcopy
hub / github.com/spicetify/cli / FindSymbol

Function FindSymbol

src/utils/utils.go:302–316  ·  view source on GitHub ↗

FindSymbol uses regexp from one or multiple clues to find variable or function symbol in obfuscated code.

(debugInfo, content string, clues []string)

Source from the content-addressed store, hash-verified

300// FindSymbol uses regexp from one or multiple clues to find variable or
301// function symbol in obfuscated code.
302func FindSymbol(debugInfo, content string, clues []string) []string {
303 for _, v := range clues {
304 re := regexp.MustCompile(v)
305 found := re.FindStringSubmatch(content)
306 if found != nil {
307 return found[1:]
308 }
309 }
310
311 if len(debugInfo) > 0 {
312 PrintError("Cannot find symbol for " + debugInfo)
313 }
314
315 return nil
316}
317
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.

Callers 1

pushExtensionsFunction · 0.92

Calls 1

PrintErrorFunction · 0.85

Tested by

no test coverage detected