本文整理汇总了C#中TargetMemoryAccess.ReadLongInteger方法的典型用法代码示例。如果您正苦于以下问题:C# TargetMemoryAccess.ReadLongInteger方法的具体用法?C# TargetMemoryAccess.ReadLongInteger怎么用?C# TargetMemoryAccess.ReadLongInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TargetMemoryAccess
的用法示例。
在下文中一共展示了TargetMemoryAccess.ReadLongInteger方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: unwind_method
StackFrame unwind_method(StackFrame frame, TargetMemoryAccess memory, byte[] code,
int pos, int offset)
{
Registers old_regs = frame.Registers;
Registers regs = CopyRegisters (old_regs);
if (!old_regs [(int) X86_Register.RBP].Valid)
return null;
TargetAddress rbp = new TargetAddress (
memory.AddressDomain, old_regs [(int) X86_Register.RBP].Value);
int addr_size = TargetAddressSize;
TargetAddress new_rbp = memory.ReadAddress (rbp);
regs [(int) X86_Register.RBP].SetValue (rbp, new_rbp);
TargetAddress new_rip = memory.ReadAddress (rbp + addr_size);
regs [(int) X86_Register.RIP].SetValue (rbp + addr_size, new_rip);
TargetAddress new_rsp = rbp + 2 * addr_size;
regs [(int) X86_Register.RSP].SetValue (rbp, new_rsp);
rbp -= addr_size;
int length = System.Math.Min (code.Length, offset);
while (pos < length) {
byte opcode = code [pos++];
long value;
if ((opcode == 0x41) && (pos < length)) {
byte opcode2 = code [pos++];
if ((opcode2 < 0x50) || (opcode2 > 0x57))
break;
switch (opcode2) {
case 0x50: /* r8 */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.R8].SetValue (rbp, value);
break;
case 0x51: /* r9 */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.R9].SetValue (rbp, value);
break;
case 0x52: /* r10 */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.R10].SetValue (rbp, value);
break;
case 0x53: /* r11 */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.R11].SetValue (rbp, value);
break;
case 0x54: /* r12 */
value = (long) memory.ReadAddress (rbp).Address;
regs [(int) X86_Register.R12].SetValue (rbp, value);
break;
case 0x55: /* r13 */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.R13].SetValue (rbp, value);
break;
case 0x56: /* r14 */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.R14].SetValue (rbp, value);
break;
case 0x57: /* r15 */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.R15].SetValue (rbp, value);
break;
}
} else {
if ((opcode < 0x50) || (opcode > 0x57))
break;
switch (opcode) {
case 0x50: /* rax */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.RAX].SetValue (rbp, value);
break;
case 0x51: /* rcx */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.RCX].SetValue (rbp, value);
break;
case 0x52: /* rdx */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.RDX].SetValue (rbp, value);
break;
case 0x53: /* rbx */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.RBX].SetValue (rbp, value);
break;
case 0x56: /* rsi */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.RSI].SetValue (rbp, value);
break;
case 0x57: /* rdi */
value = memory.ReadLongInteger (rbp);
regs [(int) X86_Register.RDI].SetValue (rbp, value);
break;
}
}
//.........这里部分代码省略.........