Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. uint8_t rsi_value = process.read<uint8_t>(scope->rsi + scope->base);
  2. uint64_t handler_addr = process.read<uint64_t>(scope->r12 + rsi_value * 8 + scope->base);
  3.  
  4. InstructionList instructions = disasm_handler(handler_addr);
  5.  
  6. if (!scope->is_neg_rsi)
  7. scope->rsi += 1;
  8.  
  9. size_t rsi_size = matcher->match(instructions);
  10.  
  11. if (scope->ret)
  12. {
  13. expect(scope->ret->const_value.type == ConstValueType::Image);
  14. if (scope->ret->const_value.value64 == ret_addr)
  15. {
  16. expect(scope->stack_pos == -1);
  17. break;
  18. }
  19.  
  20. expect(false);
  21. break;
  22. }
  23.  
  24. if (scope->jmp)
  25. {
  26. expect(!rsi_size);
  27. expect(scope->r12 == start_r12);
  28. if (scope->load_cc)
  29. {
  30. dot(scope->jmp);
  31. ir(scope->jmp);
  32. expect(scope->load_cc->target_node_0->const_value.type == ConstValueType::Const);
  33. expect(scope->load_cc->target_node_1->const_value.type == ConstValueType::Const);
  34. scope->next_0 = link_basic_block(scope->r12, scope->load_cc->target_node_0->const_value.value64 + (scope->is_neg_rsi ? -1 : 0), ret_addr);
  35. scope->next_1 = link_basic_block(scope->r12, scope->load_cc->target_node_1->const_value.value64 + (scope->is_neg_rsi ? -1 : 0), ret_addr);
  36. }
  37. else
  38. {
  39. expect(scope->jmp->const_value.type == ConstValueType::Image);
  40. scope->next_0 = link_basic_block(scope->r12, scope->jmp->const_value.value64 + (scope->is_neg_rsi ? -1 : 0), ret_addr);
  41. }
  42. break;
  43. }
  44.  
  45. if (scope->is_neg_rsi)
  46. scope->rsi -= rsi_size + 1;
  47. else
  48. scope->rsi += rsi_size;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement