Heap Patcher error help

Arnius
MM2X Newbie
MM2X Newbie
Posts: 4
Registered for: 1 year 11 months

Heap Patcher error help

Postby Arnius » Mon Jan 02, 2023 5:46 pm

Hello,

Recently I've seen this patch in the downloads to fix that pesky Heap overrun error.
Does it even work?
The instructions are to drag the midtown2.exe file onto it, that's how I understood.
But when I do this I recieve this:

Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'E:\Program Files\Midtown Madness 2\midtown2.exe' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost)
at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
at MM2HeapPatcher.Program.Patch(String fileName, Int32 size)
at MM2HeapPatcher.Program.Main(String[] args)


I ran the code as administrator and still no difference.
It's even a problem to play the New York City mod with some cars, not to mention pedestrians or any other vehicle on the road.

Please help, thank you
Cheers!

User avatar
Franch88
MM2X Admin
MM2X Admin
Posts: 15760
Registered for: 17 years 6 months
Location: Italy
Been thanked: 1 time
Contact:
Italy

Re: Heap Patcher error help

Postby Franch88 » Mon Jan 02, 2023 10:38 pm

Hello and welcome here.
Let's try with some attempts in order to fix this error. Instead to use that edited Midtown2.exe file, use the one included in the archive of this other release, which has some more feature. In case it won't work either, but also if it works, it's highly suggested to use the definitive solution implemented in the latest years, called MM2Hook, download the latest version here. Keeping the above Midtown2.exe file of that other release, add all the content of the archive of the MM2Hook patcher in the main game folder and then run the game. Successively, you can also customize and switch various features by editing MM2Hook's .ini file using Windows Notepad.
Fiat 500 = Italian motorization. Franch88, MM2 eXtreme forum and website Administrator.
|Franch88's MM2 Releases|

Arnius
MM2X Newbie
MM2X Newbie
Posts: 4
Registered for: 1 year 11 months

Re: Heap Patcher error help

Postby Arnius » Tue Jan 03, 2023 5:25 pm

Hello, thank you for the input.

The first and the second fix didn't work.
With the second fix, I've changed the heap size from 128 to 256, ran the new midtown2.exe that you provided, selected cruise on New York City, with the default pedestrian, cops and traffic density and I got an error in a Guru Mediation window saying:

EAX=00000000 EI3X=11755908 ECX=118cab50 EDX=005b2cb0 ESI= 11888048 EDI=1188304c EBP=0019170c ESP=0019f6c0 Exception c0000005 at EIP=0042bed5 (Unknown)
0042bed5 (Unknown),
72455c81 (MM2Hook+e5c81),
00559432 (Unknown),
0053d96c (Unknown),
00535d78 (Unknown),
7245339d (MM2Hook+e339d),
00412b9d (Unknown),
0041fa38 (Unknown),
004018ed (Unknown), 00401600 (Unknown), 00402216 (Unknown), 004023e8 (Unknown), 0058202a (Unknown), 761100f9 (Unknown), 7767bbe (Unknown), 7767b8e (Unknown)

Should I set the heap size higher, maybe even to 1024?

Arnius
MM2X Newbie
MM2X Newbie
Posts: 4
Registered for: 1 year 11 months

Re: Heap Patcher error help

Postby Arnius » Thu Jan 05, 2023 5:07 pm

Okay, I've just noticed that there is a good MM2 .rar on the Madness discord. And everything works there.... so its great.
Thanks for the help though.

User avatar
Franch88
MM2X Admin
MM2X Admin
Posts: 15760
Registered for: 17 years 6 months
Location: Italy
Been thanked: 1 time
Contact:
Italy

Re: Heap Patcher error help

Postby Franch88 » Thu Jan 05, 2023 10:07 pm

Good to know that you've solved this problem, but at the moment, I have no idea of the .rar file that you've found there. Which is it?
About the heap size, 256 is enough for almost all the cases. I keep it set to 512 because I've tested something which required this higher value.
Fiat 500 = Italian motorization. Franch88, MM2 eXtreme forum and website Administrator.
|Franch88's MM2 Releases|

Arnius
MM2X Newbie
MM2X Newbie
Posts: 4
Registered for: 1 year 11 months

Re: Heap Patcher error help

Postby Arnius » Fri Jan 06, 2023 3:28 pm

It's in the MM2-download channel. Downloaded the latest November 2022 "version if you could cal it that". Works great. Maybe a few hiccups, when you select a certain LTV skin it shows an error. It comes with some city, track and vehicle mods preinstalled.