--- trunk/RomCheater/Docking/FloatingRamDumperDialog.cs 2012/06/03 15:15:51 246 +++ trunk/RomCheater/Docking/FloatingRamDumperDialog.cs 2012/06/03 16:09:05 249 @@ -57,25 +57,25 @@ private void radioBTNGigaBytes_CheckedChanged(object sender, EventArgs e) { dumpSize = DumpSize.GigaBytes; } private void btnCalcEndAddr_Click(object sender, EventArgs e) { - ulong start = 0; - ulong end = 0; + long start = 0; + long end = 0; start = txtStart.Value; switch (dumpSize) { case DumpSize.Bytes: - end = (ulong)(Convert.ToDouble(txtDumpSize.Text) * 1.0 + (double)start) + BYTE_CORRECTION_VALUE; + end = (long)(Convert.ToDouble(txtDumpSize.Text) * 1.0 + (double)start) + BYTE_CORRECTION_VALUE; txtEnd.Value = end; break; case DumpSize.KiloBytes: - end = (ulong)(Convert.ToDouble(txtDumpSize.Text) * 1000.0 + (double)start) + BYTE_CORRECTION_VALUE; + end = (long)(Convert.ToDouble(txtDumpSize.Text) * 1000.0 + (double)start) + BYTE_CORRECTION_VALUE; txtEnd.Value = end; break; case DumpSize.MegaBytes: - end = (ulong)(Convert.ToDouble(txtDumpSize.Text) * 1000000.0 + (double)start) + BYTE_CORRECTION_VALUE; + end = (long)(Convert.ToDouble(txtDumpSize.Text) * 1000000.0 + (double)start) + BYTE_CORRECTION_VALUE; txtEnd.Value = end; break; case DumpSize.GigaBytes: - end = (ulong)(Convert.ToDouble(txtDumpSize.Text) * 1000000000.0 + (double)start) + BYTE_CORRECTION_VALUE; + end = (long)(Convert.ToDouble(txtDumpSize.Text) * 1000000000.0 + (double)start) + BYTE_CORRECTION_VALUE; txtEnd.Value = end; break; } @@ -89,27 +89,27 @@ { case DumpSize.Bytes: start = (long)((double)end - (Convert.ToDouble(txtDumpSize.Text) * 1.0)) + BYTE_CORRECTION_VALUE; - txtStart.Value = (ulong)start; ; + txtStart.Value = (long)start; break; case DumpSize.KiloBytes: start = (long)((double)end - (Convert.ToDouble(txtDumpSize.Text) * 1000.0)) + BYTE_CORRECTION_VALUE; - txtStart.Value = (ulong)start; ; + txtStart.Value = (long)start; break; case DumpSize.MegaBytes: start = (long)((double)end - (Convert.ToDouble(txtDumpSize.Text) * 1000000.0)) + BYTE_CORRECTION_VALUE; - txtStart.Value = (ulong)start; ; + txtStart.Value = (long)start; break; case DumpSize.GigaBytes: start = (long)((double)end - (Convert.ToDouble(txtDumpSize.Text) * 1000000000.0)) + BYTE_CORRECTION_VALUE; - txtStart.Value = (ulong)start; + txtStart.Value = (long)start; break; } } private void btnCalcDumpSize_Click(object sender, EventArgs e) { - ulong start = txtStart.Value; - ulong end = txtEnd.Value; - ulong byte_diff = (end - start) + BYTE_CORRECTION_VALUE; + long start = txtStart.Value; + long end = txtEnd.Value; + long byte_diff = (end - start) + BYTE_CORRECTION_VALUE; switch (dumpSize) { case DumpSize.Bytes: @@ -140,7 +140,7 @@ #endregion #region memory support - private void DumpRam(ulong start, ulong end, string filename) + private void DumpRam(long start, long end, string filename) { uint byte_count = (uint)(end - start); string arch = ProcessorAssemblyArchitecture.GetProcessorArchitecture(typeof(FloatingRamDumperDialog).Assembly); @@ -178,13 +178,13 @@ } DumpRam(start, byte_count, filename); } - private void DumpRam(ulong start, uint count, string filename) + private void DumpRam(long start, uint count, string filename) { if (this.AcceptedProcess == null) return; GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this); provider.OpenProvider(); int bytesReadSize; - if (provider.WriteProcessMemoryToFile(filename, (uint)start, count, out bytesReadSize)) + if (provider.WriteProcessMemoryToFile(filename, (int)start, count, out bytesReadSize)) { MessageBox.Show(string.Format("Succefully dumped memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", start, start + count, filename, string.Format("0x{0:x4} {1}.exe", this.AcceptedProcess.Id, AcceptedProcess.ProcessName)), "", MessageBoxButtons.OK, MessageBoxIcon.Information); }