The Black Wyrm Lair Forums
The Black Wyrm's Lair Terms of Use Help Search Members Calendar

Welcome Guest ( Log In | Register )

> Hex editing BGMAIN.EXE, Eureka!
Chevar
post Dec 30 2004, 01:52 AM
Post #1


The oak's first root


Retired team member
Posts: 297
Joined: 24-August 04




Okay, I've found the offending hard coded starting EXP for the TOB side of the interface.

I also seem to have found where the TOB side start area is coded, however I screwed up something else in the process.. I should have a working EXE soon.. Hopefully I'll find someone that can write a program to patch it instead of having to redistribute the exe
Go to the top of the page
 
Quote Post
 
Start new topic
Replies (1 - 17)
Awake
post Dec 30 2004, 02:17 AM
Post #2


The Raven
Group Icon

Mod Developer
Posts: 590
Joined: 4-September 04
From: California, USA




YAY!!!! Let me be the first to congratulate you in hard type, rather than IRC. Perhaps while your at it you could add subraces, more than 5 NPC's, and... yeah, this'll do fine. tongue.gif


--------------------
And can we finally say that the bhaal spawn idea has had the final nail hammered in its coffin?


Member of the World Transition Project

And the raven, never flitting, still is sitting, still is sitting
On the pallid bust of Pallas just above my chamber door;
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor;
And my soul from out that shadow that lies floating on the floor
Shall be lifted - nevermore!


Like dealing with terrorists by giving them explosives
Go to the top of the page
 
Quote Post
Chevar
post Dec 30 2004, 02:29 AM
Post #3


The oak's first root


Retired team member
Posts: 297
Joined: 24-August 04




QUOTE(Awake @ Dec 30 2004, 02:17 AM)
YAY!!!! Let me be the first to congratulate you in hard type, rather than IRC. Perhaps while your at it you could add subraces, more than 5 NPC's, and... yeah, this'll do fine. tongue.gif

Bite my ass Awake smile.gif..

I have other work to do.. just doing what needs doing for WTP..
Go to the top of the page
 
Quote Post
dragon_lord
post Dec 30 2004, 06:01 AM
Post #4


The original one


Retired team member
Posts: 789
Joined: 9-September 04
From: WA, Australia




Wohoo. Nice work Chevar, glad to see someones doing some work around here instead of loitering around in IRC happy.gif.
*dragon_lord looks in awake's direction and then realises the hypocrisy of doing so tongue.gif


--------------------
Maintainer of the Dragon's Hoard Download Center
Member of the World Transition Project
The Items Mart - A comprehensive guide to item locations with maps for BG2
Portrait City - The largest collection of portraits for BG2 on the net.
Go to the top of the page
 
Quote Post
Awake
post Dec 30 2004, 06:26 AM
Post #5


The Raven
Group Icon

Mod Developer
Posts: 590
Joined: 4-September 04
From: California, USA




Oh, real nice, dragon_lord. It's more than hypocrisy, considering you're on more than I am. tongue.gif

I have done a little bit of work... I have, really!

Anyways, so, who are we going to ask to make this patcher program. Like I said already, it's not a HUGE file, but like you said, it would be better to just distribute a patcher. Unless of course the patcher ended up being larger than the .exe.... Umm...yeah. OK, so now we all need to go into the ideas thread and see what we're going to do about the start area. I'm still for the idea that we put our guy in the room with no doors or windows and the guy teleports in. Anyways.... w00t.


--------------------
And can we finally say that the bhaal spawn idea has had the final nail hammered in its coffin?


Member of the World Transition Project

And the raven, never flitting, still is sitting, still is sitting
On the pallid bust of Pallas just above my chamber door;
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor;
And my soul from out that shadow that lies floating on the floor
Shall be lifted - nevermore!


Like dealing with terrorists by giving them explosives
Go to the top of the page
 
Quote Post
igi
post Dec 30 2004, 09:25 AM
Post #6


IESDP Guardian


Forum Member
Posts: 175
Joined: 22-July 04




The ToB starting area offset is already known.
I'd be grateful if you could post the ToB starting xp offset.

Weidu can handle .exe patching. You could also use a tiny nsis 'installer' to do the patching.


--------------------
Go to the top of the page
 
Quote Post
egm
post Dec 30 2004, 03:31 PM
Post #7


Eminence Grise Machiavelic
Group Icon

Mod Developer
Posts: 244
Joined: 12-November 04
From: Monthléry




I have a question: is the starting XP of BGII alone hardcoded???
Go to the top of the page
 
Quote Post
igi
post Dec 30 2004, 04:23 PM
Post #8


IESDP Guardian


Forum Member
Posts: 175
Joined: 22-July 04




BG2 as in BG2: Soa (ie. without ToB), or BG2 as in "not the other IE games"?

Either way, the starting XP for normal BG2 (without ToB) is hard-coded, but the offset is known, so we can edit the .exe file to change it.

The starting XP is probably hard-coded in the other IE games as well, but, iirc, they all start at 0, so... theres no point in changing it down, and it's probably easier to change it up via script or some such.


--------------------
Go to the top of the page
 
Quote Post
Chevar
post Dec 31 2004, 12:55 AM
Post #9


The oak's first root


Retired team member
Posts: 297
Joined: 24-August 04




QUOTE(igi @ Dec 30 2004, 09:25 AM)
The ToB starting area offset is already known.
I'd be grateful if you could post the ToB starting xp offset.

Weidu can handle .exe patching. You could also use a tiny nsis 'installer' to do the patching.

Sorry Igi, but my other computer (the one with the hex editor) is all tied up at the moment, so I can't get you the offset offhand. I'd love to trade info, however.. run a search for (hex) A02526 It's the third occurence. It's written in reverse of course. so if you change it to A0 00 00 you end up with 160 starting exp.. A02526 is the 2,500,000 starting exp (2625A0 in hex)

WEIDU can patch the exe? How?

This post has been edited by Chevar: Dec 31 2004, 12:58 AM
Go to the top of the page
 
Quote Post
Awake
post Dec 31 2004, 01:24 AM
Post #10


The Raven
Group Icon

Mod Developer
Posts: 590
Joined: 4-September 04
From: California, USA




My guess is probably one of the commands such as WRITE_SHORT or WRITE_BYTE, but I don't know much about that sort of thing, but it would make sense.


--------------------
And can we finally say that the bhaal spawn idea has had the final nail hammered in its coffin?


Member of the World Transition Project

And the raven, never flitting, still is sitting, still is sitting
On the pallid bust of Pallas just above my chamber door;
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor;
And my soul from out that shadow that lies floating on the floor
Shall be lifted - nevermore!


Like dealing with terrorists by giving them explosives
Go to the top of the page
 
Quote Post
CamDawg
post Dec 31 2004, 02:51 AM
Post #11





Forum Member
Posts: 59
Joined: 22-July 04




QUOTE(Chevar @ Dec 30 2004, 08:55 PM)
WEIDU can patch the exe? How?

WeiDU Documentation. Read it. Love it. Memorize it. (In this case specifically read, love and memorize WRITE_BYTE, WRITE_SHORT, and WRITE_LONG.)


--------------------
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.
Go to the top of the page
 
Quote Post
egm
post Jan 3 2005, 03:54 PM
Post #12


Eminence Grise Machiavelic
Group Icon

Mod Developer
Posts: 244
Joined: 12-November 04
From: Monthléry




Okay then, I have a last question: what is exactly the offset which set the starting XP in BGII: SoA?
Go to the top of the page
 
Quote Post
Vlasák
post Jan 4 2005, 11:33 AM
Post #13


Mathematical poet


Retired team member
Posts: 159
Joined: 9-July 04
From: Prague, Czech Republic




Egm:
the offset differs for the different length of the .exe. According readme included with xppatcher:

lenght - offset
-----------------------
7381038 - 0x64f8b0
7385134 - 0x6508b8
7417902 - 0x658970
7831598 - 0x6b5258
7839790 - 0x6b7258
7843886 - 0x6b6270


--------------------
Baldur's Gate II add-on CZ - TC from Dalelands
http://addoncz.gamestar.cz

English forums are opened!
Go to the top of the page
 
Quote Post
egm
post Jan 4 2005, 02:56 PM
Post #14


Eminence Grise Machiavelic
Group Icon

Mod Developer
Posts: 244
Joined: 12-November 04
From: Monthléry




THANKS!
Go to the top of the page
 
Quote Post
SimDing0
post Jan 10 2005, 10:30 PM
Post #15





Forum Member
Posts: 106
Joined: 14-August 04




This was useful, thanks, but does anyone know the ToB starting XP offsets for the various sizes of the EXE?
Go to the top of the page
 
Quote Post
Vlasák
post Jan 12 2005, 10:31 AM
Post #16


Mathematical poet


Retired team member
Posts: 159
Joined: 9-July 04
From: Prague, Czech Republic




According Chevar's notice that it is the third occurence of 0xA02526 it is the offset 0x6B7264 for my bgmain.exe version (lenght 7839790).

BTW on 0x6B7258 is the SoA starting XP as we already now, but following dword (0x6B725C) has the value 161000 and another following (0x6B7260) 2950000 - these values are suspicious too... what is 161000 XP? I can't remember and not enough time for experiments with it... highest amount of XP for imported character? 2950000 is xpcap that can be removed by .2da... any ideas what can these values mean? (does the starting XPs in Tob differ for import from save game, character file and for the whole new game? I think that it does, at least in the case of starting XP for imports and new game).


--------------------
Baldur's Gate II add-on CZ - TC from Dalelands
http://addoncz.gamestar.cz

English forums are opened!
Go to the top of the page
 
Quote Post
Baronius
post Jan 12 2005, 10:57 AM
Post #17


Master of energies
Group Icon

Council Member
Posts: 3324
Joined: 9-July 04
From: Magyarország




161000 is the experience cap of Tales of the Sword Coast...
If you start a new character in SoA, (s)he will have 89000 XP, however if you import a BG1 character having more than 161000 XP, his/her experience will be decreased to 161000.


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
SimDing0
post Jan 12 2005, 06:31 PM
Post #18





Forum Member
Posts: 106
Joined: 14-August 04




I suspect that similarly, 2950000 is the maximum for an imported ToB character, while newly created characters are granted 2500000.

QUOTE
According Chevar's notice that it is the third occurence of 0xA02526 it is the offset 0x6B7264 for my bgmain.exe version (lenght 7839790).

Right, that's what I've got, yeh... I guess it changes for versions other than 26498 though.
Go to the top of the page
 
Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:



- Lo-Fi Version Time is now: 22nd August 2025 - 03:05 PM