public StackFrame Unwind(StackFrame frame, TargetMemoryAccess target, Architecture arch) { Registers old_regs = frame.Registers; Registers regs = arch.CopyRegisters(old_regs); SetRegisters(regs, target, arch, columns); Register eip = GetRegister(regs, 0); Register esp = GetRegister(regs, 1); Register ebp = GetRegister(regs, 2); if (!eip.Valid || !esp.Valid) { return(null); } TargetAddress address = new TargetAddress( target.AddressDomain, eip.Value); TargetAddress stack = new TargetAddress( target.AddressDomain, esp.Value); TargetAddress frame_addr = TargetAddress.Null; if (ebp.Valid) { frame_addr = new TargetAddress( target.AddressDomain, ebp.Value); } return(arch.CreateFrame( frame.Thread, FrameType.Normal, target, address, stack, frame_addr, regs)); }
public StackFrame Unwind(StackFrame frame, TargetMemoryAccess target, Architecture arch) { Registers old_regs = frame.Registers; Registers regs = arch.CopyRegisters (old_regs); SetRegisters (regs, target, arch, columns); Register eip = GetRegister (regs, 0); Register esp = GetRegister (regs, 1); Register ebp = GetRegister (regs, 2); if (!eip.Valid || !esp.Valid) return null; TargetAddress address = new TargetAddress ( target.AddressDomain, eip.Value); TargetAddress stack = new TargetAddress ( target.AddressDomain, esp.Value); TargetAddress frame_addr = TargetAddress.Null; if (ebp.Valid) frame_addr = new TargetAddress ( target.AddressDomain, ebp.Value); return arch.CreateFrame ( frame.Thread, FrameType.Normal, target, address, stack, frame_addr, regs); }