MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / findSubFunction

Function findSubFunction

src/Chain/libraries/glua/glua_decompile.cpp:3385–3411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3383 }
3384
3385 Proto* findSubFunction(GluaDecompileContextP ctx, Proto* f, std::string funcnumstr, std::string &realfuncnumstr) {
3386 Proto* cf = f;
3387 auto startstr = funcnumstr;
3388 const char* endstr;
3389
3390 int c = stoi(startstr);
3391 if (c != 0) {
3392 return nullptr;
3393 }
3394 endstr = strchr(startstr.c_str(), '_');
3395 startstr = endstr + 1;
3396 realfuncnumstr = "0";
3397 ctx->functionnum = 0;
3398
3399 while (!(endstr == nullptr)) {
3400 c = stoi(startstr);
3401 if (c < 0 || c >= cf->sizep) {
3402 return nullptr;
3403 }
3404 cf = cf->p[c];
3405 endstr = strchr(startstr.c_str(), '_');
3406 startstr = endstr + 1;
3407 realfuncnumstr = realfuncnumstr + "_" + std::to_string(c);
3408 ctx->functionnum = c + 1;
3409 }
3410 return cf;
3411 }
3412
3413 std::string ProcessSubFunction(GluaDecompileContextP ctx, Proto* cf, int func_checking, std::string funcnumstr) {
3414 int i;

Callers 2

Calls 3

stoiFunction · 0.85
to_stringFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected