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

Method emit_handler

src/codec.cpp:594–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

592 }
593
594 void ImmCodec::emit_handler(X64Emitter& e, const VMConfig& vm) const {
595 const auto& r = vm.dispatcher_regs();
596
597 // slot index → scratch_a; width byte → scratch_b
598 emit_fetch_byte_dec(e, vm, r.scratch_a);
599 emit_fetch_byte_dec(e, vm, r.scratch_b);
600
601 // fetch the 4 obfuscation components, 8 bytes each, then compute
602 // a + b xor c - d
603 e.sub_reg_imm32(rx::rsp, 48); // 32 for components, 16 for align
604
605 // a -> [rsp+16]
606 emit_fetch_uN_dec(
607 e,
608 vm,
609 rx::rax,
610 8
611 );
612 e.mov_mem_reg(
613 rx::rsp,
614 16,
615 rx::rax,
616 true
617 );
618
619 // b -> [rsp+24]
620 emit_fetch_uN_dec(
621 e,
622 vm,
623 rx::rax,
624 8
625 );
626 e.mov_mem_reg(
627 rx::rsp,
628 24,
629 rx::rax,
630 true
631 );
632
633 // c -> [rsp+32]
634 emit_fetch_uN_dec(
635 e,
636 vm,
637 rx::rax,
638 8
639 );
640 e.mov_mem_reg(
641 rx::rsp,
642 32,
643 rx::rax,
644 true
645 );
646
647 // d -> [rsp+40]
648 emit_fetch_uN_dec(
649 e,
650 vm,
651 rx::rax,

Callers 2

emit_all_handlersMethod · 0.45
emit_all_handlersMethod · 0.45

Calls 15

emit_store_slot_valueFunction · 0.85
shuffle_in_placeFunction · 0.85
emit_bin_handlerFunction · 0.85
emit_unary_arithFunction · 0.85
emit_shift_handlerFunction · 0.85
emit_cmp_test_handlerFunction · 0.85
emit_cipher_resetFunction · 0.85
emit_native_handlerFunction · 0.85
cipher_k1Method · 0.80
slot_of_xregMethod · 0.80
emit_fetch_byte_decFunction · 0.70
emit_fetch_uN_decFunction · 0.70

Tested by

no test coverage detected