Example #1
0
 /// <summary>
 ///     Converts the specified map.
 /// </summary>
 /// <param name="map">The map.</param>
 /// <returns>ILToNativeMap.</returns>
 public ILToNativeMap Convert(ClrMd.ILToNativeMap map)
 {
     return(Cache.GetOrAdd(map, () => new ILToNativeMap
     {
         EndAddress = map.EndAddress,
         ILOffset = map.ILOffset,
         StartAddress = map.StartAddress
     }));
 }
Example #2
0
        private void DisassembleNative(ILToNativeMap map)
        {
            ulong nextInstr;
            StringBuilder disasmBuffer = new StringBuilder(512);
            uint disasmSize;
            ulong disasmAddress = map.StartAddress;
            while (true)
            {
                int hr = _control.Disassemble(disasmAddress, 0,
                    disasmBuffer, disasmBuffer.Capacity, out disasmSize,
                    out nextInstr);
                if (hr != 0)
                    break;
                _context.Write(disasmBuffer.ToString());

                if (nextInstr >= map.EndAddress)
                    break;
                disasmAddress = nextInstr;
            }
        }