MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / score

Function score

arch/powerpc/assembler.cpp:2450–2472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2448}
2449
2450float score(vector<token> baseline, uint32_t newcomer, uint32_t addr)
2451{
2452 vector<token> toks_child;
2453 string err;
2454 string src;
2455
2456 if(disasm_capstone((uint8_t *)&newcomer, addr, src, err))
2457 return -1;
2458
2459 /* compare mnemonics before doing more work */
2460 string mnem = baseline[0].sval;
2461 if(src.compare(0, mnem.size(), mnem) != 0) {
2462 return 0;
2463 }
2464
2465 /* mnemonics are the same, tokenize now... */
2466 if(tokenize(src, toks_child, err)) {
2467 printf("ERROR: %s\n", err.c_str());
2468 return 0;
2469 }
2470
2471 return fitness(baseline, toks_child);
2472}
2473
2474struct match {
2475 uint32_t src_hi, src_lo; // source bit range

Callers 1

assemble_singleFunction · 0.85

Calls 6

disasm_capstoneFunction · 0.85
tokenizeFunction · 0.85
fitnessFunction · 0.85
c_strMethod · 0.80
compareMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected