:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Mon Aug 20, 2018 2:52 am
All times are UTC + 0
 Forum index » Modding Central » Tiberian Sun Editing Forum » HyperPatch
Engine Discoveries
Moderators: Global Moderators, HyperPatch Moderators, CCHyper
Post new topic   Reply to topic Page 1 of 1 [23 Posts] View previous topic :: View next topic
Author Message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Thu Jun 10, 2010 1:47 am    Post subject:  Engine Discoveries Reply with quote

Engine Discoveries

Ill use this topic to post any discoveries i come across about the games engine, mostly could be trivia information.

■ Campaign Scenarios and INI Files.
Seems this logic was left over from the olden days, and still works! But only on campaign scenarios, not multiplayer scenarios. If for example, we take GDI1A.MAP and we create a GDI1A.INI. If you open up your INI and add;

[GAPOWR]
Name=Foo Bar Voodoo!

The save and close your INI, run the game and start the GDI campaign! Its obvious what you shall see different... But this can be used for quick patching a scenario that might be in a MIX file, but these INIs can only contain data that would normally work in a MAP file!


■ LANGRULE.INI and LANGFS.INI
These files where only in non english versions of Tiberian Sun to rename the objects of the game without having to edit the RULES.INI. But, these dont just allow Name=, they act just like the RULES.INI, so you can put any data in these! Use them as patch files or whatever you like. Each file is respective to the game modes. NOTE, these files might need some type of [Digest] section, so you might need to grab one from a larger file or so.


■ Some MIX Files That Are Loaded
On Bootstrap (startup process) the game loads an additional MIX file called PCACHE.MIX, this file is loaded just like PATCH.MIX, so it should logically be able to take most files. Another MIX file that is loaded but we never see is MAIN.MIX, this is loaded from the "CD" media, or the game directory if you have a NoCD applied.


-Hyper

Last edited by CCHyper on Tue Oct 09, 2012 2:50 pm; edited 8 times in total

Back to top
View user's profile Send private message
Orac
President


Joined: 11 Jul 2008
Location: New Zealand

PostPosted: Thu Jun 10, 2010 2:34 am    Post subject: Reply with quote

What was BLOWFISH.DLL, anyway?

Back to top
View user's profile Send private message
DaRTzO
Laser Commando


Joined: 18 Jan 2006
Location: Country Swing

PostPosted: Thu Jun 10, 2010 4:23 am    Post subject: Reply with quote

Orac wrote:
What was BLOWFISH.DLL, anyway?


An encryption/decryption module?

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Joined: 15 Aug 2002
Location: Brazil

PostPosted: Thu Jun 10, 2010 11:59 am    Post subject: Reply with quote

I thought it was used to get data from files with encoded names inside .mix files. I guess the game might only do CRC in the unit name and use it to get the file data.

Back to top
View user's profile Send private message Visit poster's website Skype Account
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Fri Jun 11, 2010 4:20 pm    Post subject: Reply with quote

*Edited the first post, missed out a byte change.

Orac wrote:
What was BLOWFISH.DLL, anyway?

"Blowfish Block Cypher Engine", used for encryption and decryption of anything that uses the Blowfish format. Seems Westwood programmed the push and pull (straw and pipe) classes into the game itself.

Banshee wrote:
I thought it was used to get data from files with encoded names inside .mix files. I guess the game might only do CRC in the unit name and use it to get the file data.

The game has two functions for matching a filename to the CRC in the mix files, these are Obfuscate() and CRC_Calculate(). Obfuscate() takes a imputed string (filename from the INI, MIX file name, INI file name etc.) and does some voodoo on it before it gets passed onto CRC_Calculate() a few times, this will return the final CRC of the string, that then gets checked with the ones loaded from the array of mix files. Another bit of Trivia is that Red Alert 1 and C&C95 use this Obfuscate and CRC_Calculate logic to enable hidden settings.

Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Fri Jun 11, 2010 4:25 pm    Post subject: Reply with quote

*Added information about campaign scenarios and INIs.
*Added LANGFS and LANGRULE information.
*Added information on PCACHE.MIX and MAIN.MIX.

Back to top
View user's profile Send private message
Revolutionary
Commander


Joined: 19 May 2008
Location: Scotland, starting a Revolution Cameo: metricon. Posts:???

PostPosted: Thu Jul 22, 2010 2:33 pm    Post subject: Re: Engine Discoveries Reply with quote

CCHyper wrote:
Engine Discoveries
■ Campaign Scenarios and INI Files.
Seems this logic was left over from the olden days, and still works! But only on campaign scenarios, not multiplayer scenarios. If for example, we take GDI1A.MAP and we create a GDI1A.INI. If you open up your INI and add;

[GAPOWR]
Name=Foo Bar Voodoo!

The save and close your INI, run the game and start the GDI campaign! Its obvious what you shall see different... But this can be used for quick patching a scenario that might be in a MIX file, but these INIs can only contain data that would normally work in a MAP file!


Just a quick point, rather than being an old left over i belive this is infact intened to be there. When i looked threw the German version of Tiberian Sun's Mix files there were several .ini file with scrambled names which contained unit/object IDs and "Name=" in the same way LANGRULE.INI and LANGFS.INI do so. It apears the ini files were used to quickly patch missions where units names were changed for non-english versions of TS
_________________
Creator of TS:BoB and some other things that might be good when finnished.

Back to top
View user's profile Send private message Send e-mail Skype Account
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Fri Jul 23, 2010 8:57 am    Post subject: Reply with quote

Thats a interesting thing, never thought about that.

I would have to get a hold of some foreign language versions and work out the filenames.

Back to top
View user's profile Send private message
Bachsau
Civilian


Joined: 17 Dec 2006

PostPosted: Tue Mar 13, 2012 12:23 am    Post subject: Reply with quote

Blowfish is used to decrypt the headers of encrypted mix files.

Does anyone know about the digest in langrule.ini? It can't be changed without a new digest, and the engine doesn't accept it being removed.

Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Tue Mar 13, 2012 1:52 pm    Post subject: Reply with quote

Bachsau wrote:
Blowfish is used to decrypt the headers of encrypted mix files.

Correct, but the game executable also contains code that does the same. So the experiment was to see if it actually needed to external library.

Bachsau wrote:
Does anyone know about the digest in langrule.ini? It can't be changed without a new digest, and the engine doesn't accept it being removed.

Its just a digest system the game uses, for checking against other players went online.

Back to top
View user's profile Send private message
Bachsau
Civilian


Joined: 17 Dec 2006

PostPosted: Tue Mar 13, 2012 7:36 pm    Post subject: Reply with quote

When I try to apply your patch, it complains about missing DLLs, then crashes. Anyway, it's not important. But do you know how to generate that digest? I want to change something in langrule.ini.

Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Tue Mar 13, 2012 8:59 pm    Post subject: Reply with quote

Take a digest from a FinalSun map, i think they are ignored by the game. If not, then perhaps ill do something.

Back to top
View user's profile Send private message
^Rampastein
Rampastring


Joined: 11 Oct 2008
Location: Gensokyo

PostPosted: Tue Oct 09, 2012 2:30 pm    Post subject: Reply with quote

If I apply the BLOWFISH.DLL removal hack, the game loads to a black screen but crashes before getting to the menu. Tried it with a DTA 1.11 exe and with a DTA 1.07 exe (basically a normal TS exe with some slight changes like 32 facings). According to Bittah it doesn't break the game for him, but even if he'd send me an executable that has been edited by him it still causes the game to crash for me. Using executables without the hack the game works like it should.

Extract from logfile:
Quote:
Attempt to open non-removable volume for locking or ejection
LockCount on drive C is 0
Init Secondary Mixfiles..... CONQUER.MIX MIX\MISSIONS.MIX MAPS.MIX SOUNDS01.MIX SOUNDS.MIX SCORES.MIX
Exception!
Dump exception info
Found IMAGEHLP.DLL - linking to required functions
SymLoad failed with code 6 - (null)
Exception code is -529697949



except.txt
 Description:

Download
 Filename:  except.txt
 Filesize:  20.6 KB
 Downloaded:  107 Time(s)


_________________

Last edited by ^Rampastein on Tue Oct 09, 2012 3:12 pm; edited 1 time in total

Back to top
View user's profile Send private message ModDB Profile ID Facebook Profile URL
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Tue Oct 09, 2012 2:50 pm    Post subject: Reply with quote

I have since discovered that the BLOWFISH lib is needed, and that hack is stupid. (I wonder about my mental health sometimes...)

Back to top
View user's profile Send private message
Bachsau
Civilian


Joined: 17 Dec 2006

PostPosted: Tue Oct 09, 2012 2:56 pm    Post subject: Reply with quote

Very Happy

I also tried this in the meantime:
CCHyper wrote:
Take a digest from a FinalSun map, i think they are ignored by the game. If not, then perhaps ill do something.
Does not work. Wink
Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Tue Oct 09, 2012 3:46 pm    Post subject: Reply with quote

The only other person i know that could create them was CnCVK, perhaps ill see if i can create a tool to create them.

As for the BLOWFISH topic, the game does not always use the external lib, perhaps the external lib is for handling compression only, needs more research.

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Tue Oct 09, 2012 4:36 pm    Post subject: Reply with quote

From what I understand getting rid of BLOWFISH.DLL would improve TS' compatibility on systems with reduced permissions, so getting it to work would be nice.

Like Rampastring mentioned, applying the hack doesn't seem to change anything for me when I start the game, but then again I can't be sure whether it really doesn't load any BLOWFISH.DLL fine, since the game will just load any BLOWFISH.DLL file that exists on the system (so just removing the one in the folder I'm starting TS from doesn't make a difference) and I have too many of them to just remove or rename them all.
_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Bachsau
Civilian


Joined: 17 Dec 2006

PostPosted: Tue Oct 09, 2012 7:00 pm    Post subject: Reply with quote

Bittah Commander wrote:
From what I understand getting rid of BLOWFISH.DLL would improve TS' compatibility on systems with reduced permissions, so getting it to work would be nice.

Why should it? Its just an encryption / decryption library, so the programmer does not need to code the algorithms himself.

Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Tue Oct 09, 2012 7:27 pm    Post subject: Reply with quote

The problem with the BLOWFISH lib is that its referenced as a COM object and on newer systems you need to run TS under Admin rights to allow it to initialize the lib.

Back to top
View user's profile Send private message
MrTweek
Cyborg Soldier


Joined: 18 Jul 2012
Location: Germany

PostPosted: Wed Oct 10, 2012 3:27 pm    Post subject: Reply with quote

Yes, i need "Admin rights" only on the first Time (when i reinstalled my System Or when i create a Domain Account and playing TS under IT)

Back to top
View user's profile Send private message
Bachsau
Civilian


Joined: 17 Dec 2006

PostPosted: Wed Oct 10, 2012 4:02 pm    Post subject: Reply with quote

You could also run regsvr32 against blowfish.dll with admin rights before starting ts for the first time. That should work.

I never encountered problems like this, as I always run my Desktop with full privileges.

Back to top
View user's profile Send private message
^Rampastein
Rampastring


Joined: 11 Oct 2008
Location: Gensokyo

PostPosted: Wed Oct 10, 2012 4:31 pm    Post subject: Reply with quote

Bachsau wrote:
I never encountered problems like this, as I always run my Desktop with full privileges.

It's annoying for modders to constantly remind the players of their mods to run the mod's executable with admin rights, however. In addition, getting rid of BLOWFISH.DLL would make TS playable on places where one simply doesn't have admin rights (like on school computers).
_________________

Back to top
View user's profile Send private message ModDB Profile ID Facebook Profile URL
MrTweek
Cyborg Soldier


Joined: 18 Jul 2012
Location: Germany

PostPosted: Wed Oct 10, 2012 7:53 pm    Post subject: Reply with quote

[quote="^Rampastein"]
Bachsau wrote:
I In addition, getting rid of BLOWFISH.DLL would make TS playable on places where one simply doesn't have admin rights (like on school computers).


Hmm when i try to start the Game (on Windows 7, the first time) without Admin-Rights, the game shows an error like "cant find needed dll-files..., please reinstall"

after the first run with Admin-rigths i can start the game as normaly User (all the time) =)

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [23 Posts] View previous topic :: View next topic
 Forum index » Modding Central » Tiberian Sun Editing Forum » HyperPatch
Jump to:  
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

Wildcard SSL Certificates
[ Time: 0.1521s ][ Queries: 14 (0.0254s) ][ Debug on ]