MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / GetLinuxSigPtr

Function GetLinuxSigPtr

tools/gdc-psyfork/gdc.cpp:554–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552
553}
554void *GetLinuxSigPtr(void *handle, const char* symbol)
555{
556 bool isAt = (symbol[0] == '@' && symbol[1] != '\0');
557 int matches = 0;
558 bool dummy;
559
560 if (isAt)
561 {
562 if( use_symtab && mu.ResolveSymbol(handle, &symbol[1]) )
563 return mu.ResolveSymbol(handle, &symbol[1]);
564 else if( !use_symtab && dlsym(handle, &symbol[1]) )
565 return dlsym(handle, &symbol[1]);
566 }
567 else
568 {
569 unsigned char real_sig[511];
570 size_t real_bytes = UTIL_DecodeHexString(real_sig, sizeof(real_sig), symbol);
571
572 if (real_bytes >= 1)
573 {
574 struct link_map *dlmap = (struct link_map *)handle;
575
576 return mu.FindPattern((void *)dlmap->l_addr, (char*)real_sig, real_bytes, matches, dummy);
577 }
578 }
579
580 return NULL;
581}
582int checkSigStringW(int file, const char* symbol)
583{
584 int matches = 0;

Callers 1

CheckLinuxSigOffsetFunction · 0.85

Calls 3

UTIL_DecodeHexStringFunction · 0.70
ResolveSymbolMethod · 0.45
FindPatternMethod · 0.45

Tested by

no test coverage detected