GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — I Fixed ---- Arithmetic operation resulted in an overflow. (ReClass.NET) · Issue #264 · ReClassNET/ReClass.NET

I Fixed ---- Arithmetic operation resulted in an overflow. (ReClass.NET) #264

New issue
Copy link
New issue
Copy link
Open
Open
I Fixed ---- Arithmetic operation resulted in an overflow. (ReClass.NET)#264
Copy link

Description

@chrisjd20
chrisjd20
opened on Aug 17, 2023
Issue body actions

I got this error on 64bit compiled version against a 64 bit process I was memory searching (had to change it to a long):

===================================

Arithmetic operation resulted in an overflow. (ReClass.NET)

------------------------------
For help, click: https://github.com/ReClassNET/ReClass.NET/issues

------------------------------
Program Location:

   at ReClassNET.MemoryScanner.Scanner.ConsolidateSections(IList`1 sections) in C:\Users\chris\Downloads\ReClass.NET-master\ReClass.NET\MemoryScanner\Scanner.cs:line 344
   at ReClassNET.MemoryScanner.Scanner.FirstScan(IScanComparer comparer, IProgress`1 progress, CancellationToken ct) in C:\Users\chris\Downloads\ReClass.NET-master\ReClass.NET\MemoryScanner\Scanner.cs:line 201
   at ReClassNET.Forms.ScannerForm.<StartFirstScanEx>d__43.MoveNext() in C:\Users\chris\Downloads\ReClass.NET-master\ReClass.NET\Forms\ScannerForm.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ReClassNET.Forms.ScannerForm.<firstScanButton_Click>d__17.MoveNext() in C:\Users\chris\Downloads\ReClass.NET-master\ReClass.NET\Forms\ScannerForm.cs:line 142

I fixed it by changing Scanner.cs

		class ConsolidatedMemoryRegion
		{
			public IntPtr Address { get; set; }
			public int Size { get; set; } // Keep as int
		}

Also in that same file:

		private static List<ConsolidatedMemoryRegion> ConsolidateSections(IList<Section> sections)
		{
			var regions = new List<ConsolidatedMemoryRegion>();

			if (sections.Count > 0)
			{
				var address = sections[0].Start;
				long size = sections[0].Size.ToInt64(); // Updated to long

				for (var i = 1; i < sections.Count; ++i)
				{
					var section = sections[i];
					if (address + (int)size != section.Start) // Updated to cast to int
					{
						regions.Add(new ConsolidatedMemoryRegion { Address = address, Size = (int)size }); // Updated to cast to int

						address = section.Start;
						size = section.Size.ToInt64(); // Updated to long
					}
					else
					{
						size += section.Size.ToInt64(); // Updated to long
					}
				}

				regions.Add(new ConsolidatedMemoryRegion { Address = address, Size = (int)size }); // Updated to cast to int
			}

			return regions;
		}

Activity

  1. TetzkatLipHoka
    added a commit that references this issue on Jan 10, 2025

    Issue 264

    8d016c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.