Use PowerSlide with Windows 7 (no saves)

Use PowerSlide with Windows 7 (no saves)

Joined: January 9th, 2010, 11:15 pm

January 9th, 2010, 11:46 pm #1

Well, I felt like this should be documented in case it might help others and this forums seemed like the most appropriate place. After running the game two times on Windows 7, it returned a nasty error "Call to GetTempFileName()" failed. This is obviously a problem with the games source code. Not really sure what the issue is, but I did manage to find out that two files in the Program Files\Ratbag\Powerslide folder were causing the issue, store.pf & store.pfb. Best solution I could find was to copy the two files after a fresh install into a folder named backups in the same directory and then rewrite before each time running the game. I automated this with a batch file. In notepad type

DEL store.pf
DEL store.pfb
COPY "%CD%\backups\store.pf" "%CD%\store.pf"
COPY "%CD%\backups\store.pfb" "%CD%\store.pfb"
START powerslide.exe

file -> save as -> all types -> powerslide.bat. Save this in your Program Files\Ratbag\Powerslide folder and change your desktop icon to reflect this file instead of the powerslide.exe. It would appear powerslide edits these two files after every race so you'll have to close the game and run again or you'll get another error at the end of your second race. While I haven't tested this, it may be possible to make a looping batch file. Also, this wont work with 1.04. Not sure about 1.01. I just left mine at 1.00. Since you can't save, might as well use the MegaSaxon cheat (hope I spelled that right). Lastly, you'll have to take the same steps as with an xp install

(1) Installed the game (used all defaults except "compact"; used "complete" installation instead)
(2) Once installed, right-clicked the Powerslide icon, clicked Properties, Compatibility tab, checked the "Run in compatibility mode ..." box and chose "Windows 98 / Windows ME"
(3) OK

That was the first bit. The second one (that caused the "HRESULT ERROR" crash in XP) had to be handled this ([first] the hard) way;

(4) Open Windows Explorer
(5) Go to the folder the game was installed into (C:\Program Files\Ratbag\Powerslide)
(6) Run the OTHER executable file called "ps_clo.exe" (it is a config options program)
(7) Check the "-nopollsound" box/option
(8) OK

Hopefully someone smarter than I can come up with a better solution. This one is not exactly eloquent. A better method would be to use a virtual pc or even dual boot. Even Wine on linux will supposedly run this game with the same steps as xp, which is where I'll probably go from here.
Quote
Like
Share

Joined: June 5th, 2007, 10:22 pm

January 10th, 2010, 12:04 am #2

Must be checked before the game is brought up for the first time or you will get the hr error.
Quote
Like
Share

Joined: June 5th, 2007, 10:22 pm

January 10th, 2010, 12:05 am #3

Well, I felt like this should be documented in case it might help others and this forums seemed like the most appropriate place. After running the game two times on Windows 7, it returned a nasty error "Call to GetTempFileName()" failed. This is obviously a problem with the games source code. Not really sure what the issue is, but I did manage to find out that two files in the Program Files\Ratbag\Powerslide folder were causing the issue, store.pf & store.pfb. Best solution I could find was to copy the two files after a fresh install into a folder named backups in the same directory and then rewrite before each time running the game. I automated this with a batch file. In notepad type

DEL store.pf
DEL store.pfb
COPY "%CD%\backups\store.pf" "%CD%\store.pf"
COPY "%CD%\backups\store.pfb" "%CD%\store.pfb"
START powerslide.exe

file -> save as -> all types -> powerslide.bat. Save this in your Program Files\Ratbag\Powerslide folder and change your desktop icon to reflect this file instead of the powerslide.exe. It would appear powerslide edits these two files after every race so you'll have to close the game and run again or you'll get another error at the end of your second race. While I haven't tested this, it may be possible to make a looping batch file. Also, this wont work with 1.04. Not sure about 1.01. I just left mine at 1.00. Since you can't save, might as well use the MegaSaxon cheat (hope I spelled that right). Lastly, you'll have to take the same steps as with an xp install

(1) Installed the game (used all defaults except "compact"; used "complete" installation instead)
(2) Once installed, right-clicked the Powerslide icon, clicked Properties, Compatibility tab, checked the "Run in compatibility mode ..." box and chose "Windows 98 / Windows ME"
(3) OK

That was the first bit. The second one (that caused the "HRESULT ERROR" crash in XP) had to be handled this ([first] the hard) way;

(4) Open Windows Explorer
(5) Go to the folder the game was installed into (C:\Program Files\Ratbag\Powerslide)
(6) Run the OTHER executable file called "ps_clo.exe" (it is a config options program)
(7) Check the "-nopollsound" box/option
(8) OK

Hopefully someone smarter than I can come up with a better solution. This one is not exactly eloquent. A better method would be to use a virtual pc or even dual boot. Even Wine on linux will supposedly run this game with the same steps as xp, which is where I'll probably go from here.
Thanks for posting in case others get into the windows 7 stuff also - Thanks.
Quote
Like
Share

Joined: January 9th, 2010, 11:15 pm

January 10th, 2010, 4:44 am #4

Well, I felt like this should be documented in case it might help others and this forums seemed like the most appropriate place. After running the game two times on Windows 7, it returned a nasty error "Call to GetTempFileName()" failed. This is obviously a problem with the games source code. Not really sure what the issue is, but I did manage to find out that two files in the Program Files\Ratbag\Powerslide folder were causing the issue, store.pf & store.pfb. Best solution I could find was to copy the two files after a fresh install into a folder named backups in the same directory and then rewrite before each time running the game. I automated this with a batch file. In notepad type

DEL store.pf
DEL store.pfb
COPY "%CD%\backups\store.pf" "%CD%\store.pf"
COPY "%CD%\backups\store.pfb" "%CD%\store.pfb"
START powerslide.exe

file -> save as -> all types -> powerslide.bat. Save this in your Program Files\Ratbag\Powerslide folder and change your desktop icon to reflect this file instead of the powerslide.exe. It would appear powerslide edits these two files after every race so you'll have to close the game and run again or you'll get another error at the end of your second race. While I haven't tested this, it may be possible to make a looping batch file. Also, this wont work with 1.04. Not sure about 1.01. I just left mine at 1.00. Since you can't save, might as well use the MegaSaxon cheat (hope I spelled that right). Lastly, you'll have to take the same steps as with an xp install

(1) Installed the game (used all defaults except "compact"; used "complete" installation instead)
(2) Once installed, right-clicked the Powerslide icon, clicked Properties, Compatibility tab, checked the "Run in compatibility mode ..." box and chose "Windows 98 / Windows ME"
(3) OK

That was the first bit. The second one (that caused the "HRESULT ERROR" crash in XP) had to be handled this ([first] the hard) way;

(4) Open Windows Explorer
(5) Go to the folder the game was installed into (C:\Program Files\Ratbag\Powerslide)
(6) Run the OTHER executable file called "ps_clo.exe" (it is a config options program)
(7) Check the "-nopollsound" box/option
(8) OK

Hopefully someone smarter than I can come up with a better solution. This one is not exactly eloquent. A better method would be to use a virtual pc or even dual boot. Even Wine on linux will supposedly run this game with the same steps as xp, which is where I'll probably go from here.
Tried making a bat file which loops and replaces the two files while the game is running, thereby bypassing the one race limit of my current method. Unfortunately, it would appear PowerSlide locks fast i/o on these files while the game is running. I also tried a batch file which made the files read only a short time after the game started but then the game returned errors that it could not access the files. It looks like a dual boot or a virtual machine is the best option for Windows 7 users, but this is here as an alternative.

Also, I mentioned in my earlier post that this problem was obviously related to the games source code. Here's a couple interesting links.

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

http://msdn.microsoft.com/en-us/library ... ename.aspx

The game is probably written in C or C++. Unfortunately, only a really great programmer could fix this issue without source code access. Something low level would have to be used, like assembly or (gulp) hex editing. I've exhausted my knowledge here. Hopefully someone else can find a better solution.
Quote
Like
Share

Joined: June 5th, 2007, 10:22 pm

January 10th, 2010, 11:34 am #5

keep the fires burning and keep us informed if any break throughs happen.
Quote
Like
Share

Joined: December 24th, 2007, 6:26 am

January 11th, 2010, 7:46 pm #6

Tried making a bat file which loops and replaces the two files while the game is running, thereby bypassing the one race limit of my current method. Unfortunately, it would appear PowerSlide locks fast i/o on these files while the game is running. I also tried a batch file which made the files read only a short time after the game started but then the game returned errors that it could not access the files. It looks like a dual boot or a virtual machine is the best option for Windows 7 users, but this is here as an alternative.

Also, I mentioned in my earlier post that this problem was obviously related to the games source code. Here's a couple interesting links.

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

http://msdn.microsoft.com/en-us/library ... ename.aspx

The game is probably written in C or C++. Unfortunately, only a really great programmer could fix this issue without source code access. Something low level would have to be used, like assembly or (gulp) hex editing. I've exhausted my knowledge here. Hopefully someone else can find a better solution.
So I`ve made small research over powerslide.exe, there 2 places with using of GetTempFileName kernel32.dll function (490d97 and 490dc9 adresses). during launching of powerslide (ps) it attemps to create temp files in it`s(ps) lunch directory, file names are pow[random_number].tmp. If everything ok conditional command (jnz) leads to success exit, else call of function which shows message box with error message ("call to GetTempFileName() failed").

Have no idea what`s wrong with win 7, make sure you are not install ps in win dir or system32 dir or so, dir has read/write permission.

Anyway if nothing helps I suggest to change conditional command (jnz) to notconditional (jmp). if you have hex editor and know how to use it do so: find binary string in powerslide.exe: "75 0D 68 EC 3A 4F" and change first byte to EB, gonna have "EB 0D 68 EC 3A 4F". There will be 2 places so repeat search and change it once again. If you havn`t hex or smth else, just mail me exe file. Should inform you, that using of changed exe might damage your hdd info.
Quote
Like
Share

Joined: June 5th, 2007, 10:22 pm

January 11th, 2010, 10:09 pm #7

Mighty dang nice and keep in touch !
Quote
Like
Share

Joined: January 9th, 2010, 11:15 pm

January 12th, 2010, 11:22 pm #8

Well, I felt like this should be documented in case it might help others and this forums seemed like the most appropriate place. After running the game two times on Windows 7, it returned a nasty error "Call to GetTempFileName()" failed. This is obviously a problem with the games source code. Not really sure what the issue is, but I did manage to find out that two files in the Program Files\Ratbag\Powerslide folder were causing the issue, store.pf & store.pfb. Best solution I could find was to copy the two files after a fresh install into a folder named backups in the same directory and then rewrite before each time running the game. I automated this with a batch file. In notepad type

DEL store.pf
DEL store.pfb
COPY "%CD%\backups\store.pf" "%CD%\store.pf"
COPY "%CD%\backups\store.pfb" "%CD%\store.pfb"
START powerslide.exe

file -> save as -> all types -> powerslide.bat. Save this in your Program Files\Ratbag\Powerslide folder and change your desktop icon to reflect this file instead of the powerslide.exe. It would appear powerslide edits these two files after every race so you'll have to close the game and run again or you'll get another error at the end of your second race. While I haven't tested this, it may be possible to make a looping batch file. Also, this wont work with 1.04. Not sure about 1.01. I just left mine at 1.00. Since you can't save, might as well use the MegaSaxon cheat (hope I spelled that right). Lastly, you'll have to take the same steps as with an xp install

(1) Installed the game (used all defaults except "compact"; used "complete" installation instead)
(2) Once installed, right-clicked the Powerslide icon, clicked Properties, Compatibility tab, checked the "Run in compatibility mode ..." box and chose "Windows 98 / Windows ME"
(3) OK

That was the first bit. The second one (that caused the "HRESULT ERROR" crash in XP) had to be handled this ([first] the hard) way;

(4) Open Windows Explorer
(5) Go to the folder the game was installed into (C:\Program Files\Ratbag\Powerslide)
(6) Run the OTHER executable file called "ps_clo.exe" (it is a config options program)
(7) Check the "-nopollsound" box/option
(8) OK

Hopefully someone smarter than I can come up with a better solution. This one is not exactly eloquent. A better method would be to use a virtual pc or even dual boot. Even Wine on linux will supposedly run this game with the same steps as xp, which is where I'll probably go from here.
Thanks for the tip Dima! I had actually opened the exe in both hxd and win32 disassembler Saturday after posting the batch files but couldn't make a lot of sense of it. It was only like the third time I used win32dsm. I did manage to find the two kernel32.GetTempFileNameA calls, but didn't know what to do. On a hunch I disabled the jump by replacing that hex address with F. This simply rendered the exe unusable. I may have tried changing the jne to a non-conditional jump, but I didn't know how. Was going look into it deeper, but schools been tough lately. I am curios, what does the jne reference (or does it, I'm reading a hex code beside it which I assume is the test value) 0048994E (win32dsm by the way). I thought perhaps it was the hex address of the result of the above test in ram. That test confuses me as well. It compares eax, eax. The same value! From what I read online, this seems to just test for null. Perhaps Win7 returns a value where previous os's left null? Thanks again Dima!

I uploaded the hacked powerslide.exe to my box account. I'd get it while you still can if there's any interest. I'll try to keep it up but there's no promises. Had this account expire on me before. Feel free to redistribute to keep this file alive!

http://www.box.net/shared/ehkd6n3q2z

Just extract to your powerslide folder under ratbag in program files and overwrite the existing file. Note that this is the 1.0 unpatched file. If you've patched you'll need to reinstall or overwrite your store.pf files with originals. Have not tested this file extensively but seems to work perfect. Use at own risk. Don't know whether this same issue exists in Vista but it wouldn't surprise me as their kernels are similar. If so this file may work there as well. Happy PowerSliding!
Quote
Like
Share

Joined: December 24th, 2007, 6:26 am

January 13th, 2010, 6:55 am #9

I have no win7 but your exe works on xp, at least I could run it and navigate in main menu, have no cd at the moment so can`t run race and test it.

using test command is a small trick of asm, works little faster then cmp. other similar trick is xor eax,eax works same as mov eax,0 but also little faster. anyway test and cmp change flag/s;
jz, jnz, jne, je, jl, jb and other jumps just check flag/s and then jump (or not) to other part of code. 0048994E adress in your exe is an offset, which jnz folows if ZF (zero flag) is equal to 0 (jnz totaly same as jne, machine code - 75).

If you`ll check out msdn about GetTempFileName there will be info about return value, same for this function from win98 till win7, as suppose to be. 0 means error, other values - success. According C lang syntax it will be something like
if(!GetTempFileName(....))
MessageBox(....,"error");

why this error ocurred - suppose to be no write acess permition on your hdd in powerslide folder, or some prog blocks it, or something else. who knows, I`ve heard lots of wonderful storys about bugs appearing.

happy sliding to all good old sliders!
Quote
Like
Share

Joined: January 9th, 2010, 11:15 pm

January 13th, 2010, 9:04 pm #10

Thanks again Dima. That's good information. Assembly is something I have been wanting to get into but I haven't really had a chance. Perhaps I'll be able to study it a bit this summer. Anyway, as far as why the function is returning an error, if you'll look at the msdn article below, there is a MAX_PATH associated with GetTempFileName(). If that length is exceeded, an error is returned. Perhaps this is causing the issue? I looked at my powerslide folder and temp folder. Both are read only, however, system and my account have special privileges (read/write/etc.). That being said, ProcessMonitor shows powerslide as creating its temp files in the temp folder rather than the powerslide folder. For example C:\Users\Daniel\AppData\Local\Temp\powDCAB.tmp If the programmers had intended for the temp files to be placed in the same directory as the powerslide exe, as I thought you said in your last post, the extra file length may cause MAX_PATH to be exceeded. Just a theory. Not really sure as I've never had to call a kernel method in my meager programs. Also, I noticed the 1.01 patch refused to patch my hacked exe. When I get some time, I'll patch the original file to 1.04 then mod it.

http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Quote
Like
Share