Ejemplo n.º 1
0
        /// <summary>
        /// Heuristically disassembles a range of addresses between
        /// <paramref name="addrStart"/> and <paramref name="addrEnd"/>.
        /// </summary>
        /// <param name="addrStart"></param>
        /// <param name="addrEnd"></param>
        /// <returns></returns>
        public HeuristicProcedure DisassembleProcedure(Address addrStart, Address addrEnd)
        {
            var proc = new HeuristicProcedure(
                addrStart,
                addrEnd,
                program.Architecture.CreateFrame());
            var sr = new ScanResults
            {
                ICFG = proc.Cfg,
                DirectlyCalledAddresses = new Dictionary <Address, int>(),
            };
            var dasm = new HeuristicDisassembler(
                program,
                binder,
                sr,
                proc.IsValidAddress,
                true,
                host);
            int instrByteGranularity = program.Architecture.InstructionBitSize / program.Architecture.MemoryGranularity;

            for (Address addr = addrStart; addr < addrEnd; addr = addr + instrByteGranularity)
            {
                dasm.Disassemble(addr);
            }
            DumpBlocks(proc.Cfg.Nodes);
            return(proc);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Heuristically disassembles a procedure that has been assumed to
        /// be located between <paramref name="addrStart"/> and <paramref name="addrEnd"/>.
        /// </summary>
        /// <param name="addrStart"></param>
        /// <param name="addrEnd"></param>
        /// <returns></returns>
        public HeuristicProcedure DisassembleProcedure(Address addrStart, Address addrEnd)
        {
            var proc = new HeuristicProcedure
            {
                BeginAddress = addrStart,
                EndAddress   = addrEnd,
                Frame        = program.Architecture.CreateFrame()
            };
            var dasm = new HeuristicDisassembler(program, proc, host);
            int instrByteGranularity = program.Architecture.InstructionBitSize / 8;

            for (Address addr = addrStart; addr < addrEnd; addr = addr + instrByteGranularity)
            {
                dasm.Disassemble(addr);
            }
            DumpBlocks(proc.Cfg.Nodes);
            return(proc);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Heuristically disassembles a procedure that has been assumed to 
 /// be located between <paramref name="addrStart"/> and <paramref name="addrEnd"/>. 
 /// </summary>
 /// <param name="addrStart"></param>
 /// <param name="addrEnd"></param>
 /// <returns></returns>
 public HeuristicProcedure DisassembleProcedure(Address addrStart, Address addrEnd)
 {
     var proc = new HeuristicProcedure
     {
         BeginAddress = addrStart,
         EndAddress = addrEnd,
         Frame = program.Architecture.CreateFrame()
     };
     var dasm = new HeuristicDisassembler(program, proc, host);
     int instrByteGranularity = program.Architecture.InstructionBitSize / 8;
     for (Address addr = addrStart; addr < addrEnd; addr = addr + instrByteGranularity)
     {
         dasm.Disassemble(addr);
     }
     DumpBlocks(proc.Cfg.Nodes);
     return proc;
 }