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

Method Assemble

arch/mips/arch_mips.cpp:444–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442 }
443
444 bool Assemble(const string& code, uint64_t addr, DataBuffer& result, string& errors) override
445 {
446 (void)addr;
447
448 int assembleResult;
449 char *instrBytes=NULL, *err=NULL;
450 int instrBytesLen=0, errLen=0;
451
452 BNLlvmServicesInit();
453
454 errors.clear();
455 const char* triple = "mips-pc-none-o32";
456 if (m_endian == LittleEndian)
457 triple = "mipsel-pc-none-o32";
458
459 assembleResult = BNLlvmServicesAssemble(code.c_str(), LLVM_SVCS_DIALECT_UNSPEC,
460 triple, LLVM_SVCS_CM_DEFAULT, LLVM_SVCS_RM_STATIC,
461 &instrBytes, &instrBytesLen, &err, &errLen);
462
463 if(assembleResult || errLen)
464 {
465 errors = err;
466 BNLlvmServicesAssembleFree(instrBytes, err);
467 return false;
468 }
469
470 result.Clear();
471 result.Append(instrBytes, instrBytesLen);
472 BNLlvmServicesAssembleFree(instrBytes, err);
473 return true;
474 }
475
476 bool InstructionIsBranchLikely(Instruction& instr)
477 {

Callers

nothing calls this directly

Calls 4

c_strMethod · 0.80
clearMethod · 0.45
ClearMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected