4gb Patch

General discussion about RailWorks, your thoughts, questions, news and views!

Moderator: Moderators

User avatar
Wikkus
Very Active Forum Member
Posts: 3480
Joined: Tue Dec 04, 2001 12:00 am
Location: Malta

Re: 4gb Patch

Post by Wikkus »

cowey2511 wrote:I was wandering {sic} if i could have a bit of help,
Hi Josh, as John ("CaptScarlet") has already responded, you need to have a darned good read and understand what it is you're trying to do as this is not any sort of "trick" or a "magic bullet".

You say:
i have read through the links and have successfully increased the amount of memeory on my system
So, what have you implemented? Was it IncreaseUserVa?

You then go on to say:
My problem is how can i reference the increased memory so it is utilised my RW
AFTER you've got the "IncreaseUserVa" change in place, you'll need to set the IMAGE_FILE_LARGE_ADDRESS_AWARE for the executable (RailworksProc2.exe).

You'll need Visual Studio C++ Express from Microsoft (free download from this page at Microsoft) and then get funky at the command line:
Navigate to the folder where RailworksProc2.exe lives (mine is at D:\Program Files (x86)\Steam\steamapps\common\railworks but yours is likely to be different),
Type: editbin.exe /LARGEADDRESSAWARE RailworksProc2.exe
Hit ENTER
You should get a Microsoft Copyright/Trademark disclaimer appear to which you type 'exit', hit ENTER and you're done.

If you don't see a disclaimer and instead see something else, e.g." 'editbin' is not recognized as an internal or external command,
operable program or batch file", then you've either not successfully installed VC++ or you've mistyped or some other syntax error, etc.

Usual disclaimers apply, i.e. If you (or anyone else) thinks this is a "TL,DR" moment, then you're very likely to trash your OS installation and Windows won't boot...

Rgds, Rik.
User avatar
cowey2511
Established Forum Member
Posts: 303
Joined: Thu Oct 29, 2009 3:28 pm
Location: Newcastle upon Tyne

Re: 4gb Patch

Post by cowey2511 »

Wikkus wrote:
So, what have you implemented? Was it IncreaseUserVa?
Yep, followed that through and was successful :) sorry to be a pain, should have been more clear in the first place lol!

Could you possibly point me to how i navigate to RWproc2.exe please? sorry to be a noob but i have only just installed C++ soley to do this :)

Many thanks, i know what i wanted to do i just couldn't explain it very well :)

Josh
Part of the Trans pennine Route building Team http://rw-transpennine.blogspot.com/
User avatar
alanch
Very Active Forum Member
Posts: 4907
Joined: Mon Feb 27, 2006 6:07 pm
Location: Leeds, England
Contact:

Re: 4gb Patch

Post by alanch »

cowey2511 wrote:Could you possibly point me to how i navigate to RWproc2.exe please? sorry to be a noob but i have only just installed C++ soley to do this :)
Open the command prompt window. If you need to change drive, just type the drive letter and a colon

Then you need to use in the command prompt window cd - for change directory.

On my installation it would be:

e:

cd program files\steam\steamapps\common\railworks


It will depend on where you have installed Steam to.

When you have finished with the Command prompt type exit and enter - to exit.
Alan

My railway photos are now on Google + - links to the albums are in this thread http://forums.uktrainsim.com/viewtopic. ... 9&t=149558

Lots of steam and early diesels from 1959 to 1963.
User avatar
cowey2511
Established Forum Member
Posts: 303
Joined: Thu Oct 29, 2009 3:28 pm
Location: Newcastle upon Tyne

Re: 4gb Patch

Post by cowey2511 »

Hi, i have followed you guys' advice, but i get an error message when i put in "c:\program files\steam\steamapps\common\railworks"
VC++ says ""c:\program" is not recognised as an internal or external command, operable program or batch file
is this because there is a space, and so that effectivly cuts off the rest of the command?
another issue i have had is when i input what alanch said to do
c:
then
cd program files\steam\steamapps\common\railworks
i get a message saying "the system cannot find the path specified :-?

I'm really sorry to be a pain but im really new to this whole fiddling with code stuff, i have got to this point so im nearly there i just need the last push to be able to get this to work!

Thanks

Josh
Part of the Trans pennine Route building Team http://rw-transpennine.blogspot.com/
User avatar
cowey2511
Established Forum Member
Posts: 303
Joined: Thu Oct 29, 2009 3:28 pm
Location: Newcastle upon Tyne

Re: 4gb Patch

Post by cowey2511 »

aha! just got it to work! i hadn't put ACER(C:) just C: :oops:

However, i got an error message underneath the microsft disclaimer
"LINK : fatal error LNK1104: cannot open file "RailworksProc2.exe"

any ideas? :-?

Josh
Part of the Trans pennine Route building Team http://rw-transpennine.blogspot.com/
markpullinger
Very Active Forum Member
Posts: 3105
Joined: Sun Jun 08, 2003 6:24 pm

Re: 4gb Patch

Post by markpullinger »

Hi, at a guess you need to open & run the command prompt as an administrator if Vista or 7.
User avatar
Wikkus
Very Active Forum Member
Posts: 3480
Joined: Tue Dec 04, 2001 12:00 am
Location: Malta

Re: 4gb Patch

Post by Wikkus »

markpullinger wrote:Hi, at a guess you need to open & run the command prompt as an administrator if Vista or 7.
That'd be my guess, too...

Rik.
CaptScarlet
Very Active Forum Member
Posts: 3673
Joined: Fri Nov 17, 2006 11:29 am
Location: The Netherlands

Re: 4gb Patch

Post by CaptScarlet »

Wikkus wrote:
AFTER you've got the "IncreaseUserVa" change in place, you'll need to set the IMAGE_FILE_LARGE_ADDRESS_AWARE for the executable (RailworksProc2.exe).

You'll need Visual Studio C++ Express from Microsoft (free download from this page at Microsoft) and then get funky at the command line:
Navigate to the folder where RailworksProc2.exe lives (mine is at D:\Program Files (x86)\Steam\steamapps\common\railworks but yours is likely to be different),
Type: editbin.exe /LARGEADDRESSAWARE RailworksProc2.exe
Hit ENTER
You should get a Microsoft Copyright/Trademark disclaimer appear to which you type 'exit', hit ENTER and you're done.

If you don't see a disclaimer and instead see something else, e.g." 'editbin' is not recognized as an internal or external command,
operable program or batch file", then you've either not successfully installed VC++ or you've mistyped or some other syntax error, etc.

Usual disclaimers apply, i.e. If you (or anyone else) thinks this is a "TL,DR" moment, then you're very likely to trash your OS installation and Windows won't boot...

Rgds, Rik.
Hi, perhaps I am missing something here but why does he have to do this as well ? Is this not doing exactly the same thing as the so called "patch" mentioned previously that automates the changeing of the file header flag on Railworksproc2.exe to allow >2gb memory usage ?

In the links I have seen for FSX and done my self ( on 32bit Vista when I had it ) I never had to do do this besides what is mentioned in the link I posted ?

John
User avatar
Wikkus
Very Active Forum Member
Posts: 3480
Joined: Tue Dec 04, 2001 12:00 am
Location: Malta

Re: 4gb Patch

Post by Wikkus »

CaptScarlet wrote:Hi, perhaps I am missing something here but why does he have to do this as well ? Is this not doing exactly the same thing as the so called "patch" mentioned previously that automates the changeing of the file header flag on Railworksproc2.exe to allow >2gb memory usage ?


Good point, John, you may be well be right -- the accompanying text for the 'patch' suggests it's only applicable to x64 systems, but since it seems not to explicitly state what exactly it changes, I did a bit more reading about the file header flag and found this other process for what could indeed be the same thing. Can you confirm?
In the links I have seen for FSX and done my self ( on 32bit Vista when I had it ) I never had to do do this besides what is mentioned in the link I posted ?
Surely, if the program doesn't have the ability to natively address >2GB memory, then one needs to enable this somehow...?

Besides, it occurs to me (rather sheepishly :oops: ) that this may all be moot and we could be on a hiding to nothing here; having re-read the original post, he actually stated that he'd seen "a substantial increase in system performance". Therefore, if overall system performance has increased and yet RW still runs like a three-legged tortoise, then it's got to be a more fundamental system problem, e.g. a below-par CPU...?

Rik.
CaptScarlet
Very Active Forum Member
Posts: 3673
Joined: Fri Nov 17, 2006 11:29 am
Location: The Netherlands

Re: 4gb Patch

Post by CaptScarlet »

Hi,

It is my understanding that all that patch is doing is changing the flag in the file header which can be achieved by either applying the patch or using Cff explorer to do it manually as per this picture



the only thing that gets changed is the flag "app can handle >2gb addressest" then for the those with a 64 bit OS nothing else needs doing but for those with a 32bit OS they need to set up and tweak the amount of virtual space applied as per that FSX article I posted.

John
User avatar
Wikkus
Very Active Forum Member
Posts: 3480
Joined: Tue Dec 04, 2001 12:00 am
Location: Malta

Re: 4gb Patch

Post by Wikkus »

CaptScarlet wrote:It is my understanding that all that patch is doing is changing the flag in the file header which can be achieved by either applying the patch or using Cff explorer to do it manually <snip>

the only thing that gets changed is the flag "app can handle >2gb addressest" then for the those with a 64 bit OS nothing else needs doing but for those with a 32bit OS they need to set up and tweak the amount of virtual space applied as per that FSX article I posted.
Aha... That makes a great deal more sense :)

So, it's *not* just for 64-bitters and everyone can enjoy >2GB goodness! Huzzah! :D

Cheers, Rik.
User avatar
Easilyconfused
Worried about Silent Chickens
Posts: 13205
Joined: Tue Dec 31, 2002 9:06 am
Location: Portsmouth & Bristol
Contact:

Re: 4gb Patch

Post by Easilyconfused »

Yes - it does apply to 32 bit operating systems as the previous links provided inform you if you read them from end to end. However, XP Home edition 32 bit is NOT covered by this - only XP Professional according to the Microsoft documentation.

It all goes back to the statement made a number of times in this thread that you must read the linked pages carefully and understand what it is you are about to do to your PC before doing it.
Kindest regards

John Lewis

Member of the forum moderation team
sanyix
Been on the forums for a while
Posts: 232
Joined: Wed Mar 03, 2010 7:24 pm

Re: 4gb Patch

Post by sanyix »

strange, but this isn't makes any change in the executable... if i compare the patched file, with the backup, they are bit exact.
My top wishes: Realistic engine physics - Superelevation - Multi-core support - Remove Physix engine, and use better one
styckx
Very Active Forum Member
Posts: 3989
Joined: Mon Jul 27, 2009 8:33 pm

Re: 4gb Patch

Post by styckx »

sanyix wrote:strange, but this isn't makes any change in the executable... if i compare the patched file, with the backup, they are bit exact.
This was done naively by RSC in a prior update. This the patch is redundant now and not needed
gordonamiller
New to the Forums
Posts: 3
Joined: Sat Nov 12, 2011 3:25 pm

Re: 4gb Patch

Post by gordonamiller »

Daniel Pistelli has just released a new version of the 4gb_patch that now re-calculates the PE checksum. Altho the website does not show this, the executable has been updated. This is good, because it means that many, many more programs can be Large Memory Aware (LMA) without needing to install editbin from MASM, or navigate around CFF Explorer.

Those that have used CFF Explorer should be aware that they should really be Rebuilding the PE header (which of course updates the checksum) before saving the new executable. This is now unnecessary with the all new improved 4gb patch.

Also to clear up a few misconceptions I have read here concerning 64/32 bit and 2/3/4/4+ GB ram ...

... when you change the LMA status bit in the PE header, it just lets the Windows loader know that the executable can use more than 1G of user virtual memory. In 32 bit Windows, this means you can increase to 2G user virtual memory, leaving 1G for the system, provided you give the /3GB (and possibly /USERVA=xxxx to tune it somewhat) kernel flag in boot.ini. In 64 bit Windows you don't need to edit anything, just run the patcher on the executable, and you get the full goodness.
Locked

Return to “[RW] General RW Discussion”