MCPcopy Create free account
hub / github.com/d35ha/CallObfuscator / match_wildcard

Method match_wildcard

src/obfuscate.cpp:564–597  ·  view source on GitHub ↗

Matching with the module name or any symbol.

Source from the content-addressed store, hash-verified

562
563// Matching with the module name or any symbol.
564BOOL cobf::csym::match_wildcard(PCCH wild_card, PCCH string)
565{
566 // Init.
567 PCCH s_wild;
568 PCCH s_str;
569 BOOL wild = FALSE;
570
571loop_start:
572 for (s_wild = wild_card, s_str = string; *s_str; ++s_str, ++s_wild) {
573 if (*s_wild == '*')
574 {
575 // Found a wildcard.
576 wild = TRUE;
577 string = s_str, wild_card = s_wild;
578
579 // Overlooking any consecutive wildcards.
580 do { ++wild_card; } while (*wild_card == '*');
581
582 // Reached the end of the wildcard string.
583 if (!*wild_card) return TRUE;
584 goto loop_start;
585 }
586 // Default match.
587 else if (*s_wild != *s_str) goto wild_check;
588 };
589 while (*s_wild == '*') ++s_wild;
590 return (!*s_wild);
591
592wild_check:
593 // Move to next char.
594 if (!wild) return FALSE;
595 string++;
596 goto loop_start;
597};
598
599// Check the symbol name.
600BOOL cobf::csym::check_sym(string n_sym)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected