CopyRegisters() abstract private method

abstract private CopyRegisters ( Registers regs ) : Registers
regs Registers
return Registers
Esempio n. 1
0
            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));
            }
Esempio n. 2
0
            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);
            }