158 |
private void DumpRam(ulong start, ulong end, string filename) |
private void DumpRam(ulong start, ulong end, string filename) |
159 |
{ |
{ |
160 |
uint byte_count = (uint)(end - start); |
uint byte_count = (uint)(end - start); |
161 |
|
string arch = ProcessorAssemblyArchitecture.GetProcessorArchitecture(typeof(FloatingRamDumperDialog).Assembly); |
162 |
//string arch = ProcessorAssemblyArchitecture.GetProcessorArchitecture(typeof(FloatingRamDumperDialog).Assembly); |
if (arch == ProcessorAssemblyArchitecture.x86) |
163 |
//if (arch == ProcessorAssemblyArchitecture.x86) |
{ |
164 |
//{ |
// intptr is 4 bytes on x86 |
165 |
if (end > int.MaxValue) |
if (end > int.MaxValue) |
166 |
logger.Warn.WriteLine("Warning: DumpRam(): ending address is greater than 0x{0:x8} and we are running x86, this will exceed the ", int.MaxValue); |
logger.Warn.WriteLine("Warning: DumpRam(): ending address is greater than 0x{0:x8} and we are running x86, this will exceed the max value for IntPtr", int.MaxValue); |
167 |
//} |
} |
168 |
//else if (arch == ProcessorAssemblyArchitecture.x64) |
else if (arch == ProcessorAssemblyArchitecture.x64) |
169 |
//{ |
{ |
170 |
//} |
// inptr is 8 bytes on x64 |
171 |
//else |
if (end > uint.MaxValue) |
172 |
//{ |
logger.Warn.WriteLine("Warning: DumpRam(): ending address is greater than 0x{0:x8} and we are running x64, this will exceed the max value for UIntPtr", int.MaxValue); |
173 |
// // don't know |
} |
174 |
//} |
else |
175 |
|
{ |
176 |
|
throw new InvalidProgramException(string.Format("Unexcepted processor aritecture: expected x86 or x64 but we have: {0}", arch)); |
177 |
|
} |
178 |
DumpRam(start, byte_count, filename); |
DumpRam(start, byte_count, filename); |
179 |
} |
} |
180 |
private void DumpRam(ulong start, uint count, string filename) |
private void DumpRam(ulong start, uint count, string filename) |