Jump to content


Photo

HyperOverride Tool (BETA)


  • Please log in to reply
12 replies to this topic

#1 Elys

Elys
  • Member
  • 4 posts

Posted 17 April 2011 - 06:25 PM

WARNING: Due to the way this program works by hooking dynamically various parts of the game executable in memory, it will be most probably detected as a suspicious file by your Antivirus software. You may have to exclude it from detection in your Antivirus options.

HyperOverride allows the user to optionally and dynamically setup (through game shortcut modification) an additional Override folder.
The content of this additional folder will have priority over the content inside the standard Override folder in case of file conflict.
I initially created this little tool so I could use an EasyTutu installation to play Baldur's Gate II campaign by "hyperOverriding" few files just by starting EasyTutu with a different shortcut. But I guess it can be used for other goals.

HyperOverride has been made and tested for "Baldur's Gate II: Throne of Bhall US patch 26498", but it should works as well for any Baldur's Gate I or II original or modded versions, and maybe for IceWind Dale too. Obviously -tabtoggle will be useless in Baldur's Gate I, since there is no highlight functionality in this last game.


Install:
-------

- Copy HOLoad.exe, HyperOverride.dll and the HyperOverride folder into your Baldur's Gate II folder (alongside BGMain.exe).

Use:
----

Just launch HOLoad.exe with the following optional parameters:

Load your custom additional override folder. The name needed by the following parameter is just the name of the folder you created inside the HyperOverride folder.
-ho:<folder name>

Turns the (Highlight) TAB key into a toggle.
-tabtoggle

Specify a different executable filename than 'BGMain.exe':
-exe:<filename>

Examples:
---------

HOLoad.exe -ho:Example_MaxAbiRoll -tabtoggle

HOLoad.exe -exe:BGMain2.exe -ho:MyBG1Files

Attached Files


Edited by Elys, 17 April 2011 - 06:29 PM.


#2 Azazello

Azazello

    The Anti-Spammer

  • Staff
  • 1914 posts

Posted 19 January 2012 - 06:57 AM

I'm kinda of surprised the lack of discussion on this tool. I guess the biggest issue--for the casual player--is 'why would I use this'?

Since most players, especially those using a mega-install, are being encouraged to biff their override folder, there might be even less need for your tool.

HOWEVER... I have a scenario perhaps you can consider: can you create a HyperCache modification?

Specifically, I'ld like to offload my cache folder to another drive, in order to save space on my main (game) drive, and even to 'junk' this offline cache folder (that is, simply delete it) in case I need to clear the cache due to some gameplaying problem.

(We could go even one step further: how's about a HyperData modif?)


btw I re-read your post several times, I still have no idea what 'Tab Toggle' is supposed to do different from the vanilla game. Posted Image

"I gladly simp for jastey" -- Aza
==========================================================
"You ever notice that "What the hell?!" is the answer to just about everything?"
==========================================================

"Girls are like phones, they like to be held and talked too, but if you press the wrong button, you will be disconnected!" DJ Nikodemus
================================================================
Community Contributions
* Level 1 NPCs * gMinion: expanded TP2 for MegaInstalls * PSM (PSQM): expanded scripts for Melanthium * Shar Nadal (DSotSC-BGT) revision * non-detectable Cloak of Non-Detection ?? * Weimer's-Tactics: revised TP2 for MegaInstalls * a directory of Mega-Installation Guides *

   
   
   


#3 10th

10th
  • Member
  • 621 posts

Posted 19 January 2012 - 11:39 AM

btw I re-read your post several times, I still have no idea what 'Tab Toggle' is supposed to do different from the vanilla game. Posted Image


Vanilla game:
You hold TAB, and containers, loot piles etc. are highlighted while you hold TAB. As soon as you no longer hold TAB, nothing is highlighted anymore.

HyperOverride Tool:
You press TAB once, and containers, loot etc. are always highlighted. Pressing TAB a second time disables this.

10th

Edited by 10th, 19 January 2012 - 11:39 AM.

Avast! You cannot defeat our titan-mounted submarine staffed by cannibal vikings! - Nodwick

"I grab his deceased spirit and piledrive it back into his body, duplicating raise dead." - Psyren Oots board

#4 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 20 January 2012 - 01:11 PM

Hmm, no source? I can't check compatibility with TobEx, and things are going to get messy with multiple dlls being injected...

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#5 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 20 January 2012 - 02:01 PM

Hmm, no source?

That's a shame, but let's hope with little time Elys will add that too.

Since most players, especially those using a mega-install, are being encouraged to biff their override folder, there might be even less need for your tool.

Well, what if someone could add in a HyperData add on to this... :D See we could use the same game for Tutu, BGT, Classic Adventures and Icewind Dale in BGII under the same game folder... now that's a megamoded game if anything. :lol: Hmm, WeiDU.exe might need a tiny adjustment to work with that, but a dreamer can always dream.

Deactivated account. The user today is known as The Imp.


#6 aqrit

aqrit
  • Member
  • 132 posts

Posted 20 January 2012 - 03:46 PM

without looking
One has to assume that Elys is hooking the IAT for CreateFile() and PeekMessage()

and possible anything else that would boil down to a call to NtOpenFile or NtCreateFile so ( GetFileAttributes, FindFileFirst, SearchPath, etc.)

when I wrote a hack to do this I just hooked the IAT of kernel32 for ntdll calls...

Edited by aqrit, 20 January 2012 - 04:02 PM.


#7 Sam.

Sam.
  • Administrator
  • 1352 posts

Posted 20 January 2012 - 04:36 PM

Since most players, especially those using a mega-install, are being encouraged to biff their override folder, there might be even less need for your tool.

Well, what if someone could add in a HyperData add on to this... :D See we could use the same game for Tutu, BGT, Classic Adventures and Icewind Dale in BGII under the same game folder... now that's a megamoded game if anything. :lol: Hmm, WeiDU.exe might need a tiny adjustment to work with that, but a dreamer can always dream.

Keeping all the .KEY files strait would be crazy :D . Their already is a hierarchy of override folders, in case you didn't know...

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#8 Azazello

Azazello

    The Anti-Spammer

  • Staff
  • 1914 posts

Posted 21 January 2012 - 01:41 AM

Glad to see more discussion on this...

Jarno, I remember from quite some time ago asking somewhere, maybe on PPG, about getting biggDU to redirect folders to different disks/volumes, but I think this was too bigg (haha, get it?) a request for the humble exe.

Nowadays, it's certainly more a consideration for TobEx, Taimon's or something similar like this contrib by Elys.

#9 Elys

Elys
  • Member
  • 4 posts

Posted 29 February 2012 - 09:33 PM

Wah. This topic is back from the dead one year after :crazy:

Yes I've done it using IAT hooks on FindFirstFileA, FindNextFileA, FindClose, CreateFileA and GetAsyncKeyState(for the toggle).
Nothing is modified inside the original game code besides these few IAT entries.

Anyway for those interested, here the code. (Delphi/Pascal with Unicode)


This is the code for HOLoader:


Spoiler


This is the code for HyperOverdrive.dll:

Spoiler

Edited by Elys, 29 February 2012 - 10:09 PM.


#10 Azazello

Azazello

    The Anti-Spammer

  • Staff
  • 1914 posts

Posted 01 March 2012 - 06:39 AM

Welcome back, and thanks for the contribution.

Are you willing to try at HyperCache / HyperData? I'm willing to help with the beta-testing (should have my game discs in a week or 2).

Edited by Azazello, 01 March 2012 - 06:40 AM.


#11 Elys

Elys
  • Member
  • 4 posts

Posted 01 March 2012 - 08:18 AM

For HyperCache it seems you are just interested into moving the Cache folder somewhere else. It's a different problem and one that only requires to change the Cache path used by the game. There is no "overriding" aspect of files.

If you are on Windows Vista/7, you can just create a directory junction by deleting the cache folder and typing the following line at command prompt (while having administrator privileges):

mklink /j "C:\Program Files\Baldur's Gate\data\cache" "D:\SomewhereElse\cache"

(Obviously replacing the paths with the one matching your configuration)

It's also possible to do the same on Windows 2000/XP, but it's a little more complicated.

About "HyperData", I'm not sure of what you want. The Override folder is by itself already sort of an extension of the Data folder.
So if you just want to be able to launch the game while choosing a different Data folder according to the shortcut used, you could just let the Data folder empty (or filled with files common to all your different "Data setup", and use various HyperOverride folders as Data folders.

Note: HyperOverride was not optimized for such "HyperData" use, although it would work it might eventually make loading time slighly slower on slow hardward configuration.

Edited by Elys, 01 March 2012 - 08:20 AM.


#12 Azazello

Azazello

    The Anti-Spammer

  • Staff
  • 1914 posts

Posted 02 March 2012 - 01:36 AM

For HyperCache it seems you are just interested into moving the Cache folder somewhere else. It's a different problem and one that only requires to change the Cache path used by the game. There is no "overriding" aspect of files.

If you are on Windows Vista/7, you can just create a directory junction by deleting the cache folder and typing the following line at command prompt (while having administrator privileges):

mklink /j "C:\Program Files\Baldur's Gate\data\cache" "D:\SomewhereElse\cache"

Directory junctions--interesting solution. I'll investigate this. Thanks.

btw This command needs to run every time the game is started, yes? So that means a batch file or other wrapper that includes the game EXE, for example BALDUR.BAT:
mklink /j "C:\Program Files\Baldur's Gate\data\cache" "D:\SomewhereElse\cache"
"C:\Program Files\Baldur's Gate\bgMain.exe"

About "HyperData", I'm not sure of what you want. The Override folder is by itself already sort of an extension of the Data folder.
So if you just want to be able to launch the game while choosing a different Data folder according to the shortcut used, you could just let the Data folder empty (or filled with files common to all your different "Data setup", and use various HyperOverride folders as Data folders.

Note: HyperOverride was not optimized for such "HyperData" use, although it would work it might eventually make loading time slighly slower on slow hardward configuration.

I think I see where the confusion is coming up: you originally created HyperOverride to override the default folder. My proposal is not to replace anything--I'ld like offload \override, \data maybe others from the game directory disk/volume to elsewhere. So are junctions the way-to-go to do this?

Offloading large data collections is of course going to increase load-times. It's a balance that the player has to decide for him/herself.


For the benefit of our viewing audience, why would someone want to do this--an example... you've installed the game to a laptop with limited storage, and you can't or don't want to put in another internal harddrive, then \data, \override, etc. could be placed on an external harddrive, usb pen, maybe even a remote drive (to a "cloud" drive perhaps?).


btw Elys, does your tool accept UNC paths?

Edited by Azazello, 03 March 2012 - 04:36 AM.


#13 Elys

Elys
  • Member
  • 4 posts

Posted 02 March 2012 - 01:27 PM

No, the mklink commands create a permanent Directory Junction.

Once created if you browse in your Baldur's Gate folder, you will see Cache directory. It works the same way that a normal directory. Excepted anything done inside is in fact done to the real folder you chose as target with mklink.
(PS: The target folder must exist before using mklink)

To delete a Directory Junction, just delete the "fake" directory using the rmdir command.
You can also use the Windows Explorer to delete the "fake" directory, but then unlike with the rmdir command, it will also delete all the files contained in the real target directory.

Ref: MKLINK


About the UNC, Any custom "HyperOverride directory" must be placed inside the HyperOverride directory.

Example: C:\Program Files\Baldur's Gate\HyperOverride\MySpecialOverride

with such shortcut to launch the game: HOLoad -ho:MySpecialOverride

HOLoad only accepts the final directory and automatically prefixes it with "C:\Program Files\Baldur's Gate\HyperOverride\" (or wherever your BG is installed) to find the full path.
HOLoad does not accept a full path. So you cannot specify a full path whatever the form including UNC.

Note, that if you are really about splitting stuff on various HD, and using HyperOverride you can still use a Direction Junction for the HyperOverride folders as well if needed. I don't know why would someone resort to such configuration but since you are interested, just pointing it out :P

Edited by Elys, 02 March 2012 - 01:34 PM.