MCPcopy Create free account
hub / github.com/D7EAD/mkPIVM / encode

Method encode

src/codec.cpp:578–592  ·  view source on GitHub ↗

IMM: dst_slot = imm

Source from the content-addressed store, hash-verified

576
577 // IMM: dst_slot = imm
578 void ImmCodec::encode(BytecodeBuilder& out, const IRInsn& i, const VMConfig& vm) const {
579 out.u8(vm.opcode_for(family()));
580 const auto& v = get_op<VirReg>(i, 0);
581 enc_slot(out, vm, v);
582 const auto& im = get_op<Imm>(i, 1);
583
584 // 4-component obfuscated encoding so the original imm value never sits
585 // as contiguous bytes in the bytecode encrypted or decrypted
586 enc_imm_n_obfuscated(
587 out,
588 im.value,
589 8,
590 vm
591 );
592 }
593
594 void ImmCodec::emit_handler(X64Emitter& e, const VMConfig& vm) const {
595 const auto& r = vm.dispatcher_regs();

Callers 2

encode_bytecodeFunction · 0.80
package_shellcodeFunction · 0.80

Calls 15

enc_slotFunction · 0.85
enc_imm_n_obfuscatedFunction · 0.85
enc_memFunction · 0.85
width_bytesFunction · 0.85
enc_imm_nFunction · 0.85
enc_binFunction · 0.85
enc_shiftFunction · 0.85
enc_cmp_testFunction · 0.85
enc_nativeFunction · 0.85
ErrorClass · 0.85
opcode_forMethod · 0.80

Tested by

no test coverage detected