Open tipun81 opened 3 years ago
I sent to you an invite for direct access to this repo. But I can make the change myself later.
Thanks. I am writing here again. The flashing of the portrait frame, as far as I understand, comes from the color of the selection circle. Therefore, when the cursor is hovering, it still blinks green (in EE in a different color, if the option by main color is selected). I will try to find this moment. Or you can ask Bubb. I am an amateur compared to him.
I found the offsets for BG2EE-mac 2.6.6.0 and BG2EE-win 2.5, 0x003b0f1d
and 0x00343dfa
respectively.
However it's a constant surrounded by some code. If we want this feature, we'll have to maintain a database of offsets for every binary.
I used this python script to find all 00fa0000
bytes (there weren't many, less than 10) and then checked each one in ghidra:
from pathlib import Path
import sys
input = Path(sys.argv[1])
data = bytearray(input.read_bytes())
a = 0
dt = data
res = -1
memoffset = 0x100000000 # for navigation in ghidra
while a != -1:
print(f'{res:08x} {res + memoffset:08x}')
a = dt.find(b"\x00\xfa\x00\x00")
res += a + 1
dt = dt[a + 1:]
EDIT: thinking back on it, it would've been easier to just modify the binary for each offset and test if it changes the marker color, no need for decompilers.
This is great!!! I think it's better to make a patch for different versions of the game. Because as you say, the offsets are different. With python, unfortunately, I'm tight. I'm more of a programmer on Delphi. But I understood the essence of the code! I will check the offset data in different exe.
And why do we like this portrait ))))
I see the Subrace mod is installed. There is an empty slot for the icon. Does it work fine with your GUI?
If you want, I can write a small command line utility that will work something like this:
# <search> <replace> <input> <output>
$ offsets.exe 00FA0000 FF000000 Baldur.exe Baldur.patched.exe
1] 0021066a
2] 00343dfa
3] 004adf2f
4] 004b52a8
5] 004b6b6c
6] 0053723f
Choose:
3
Done
This way it would be easy to find the right offset by testing one by one. Maybe also output md5 hashsum that can be later used for the database.
And why do we like this portrait ))))
=)
I see the Subrace mod is installed. There is an empty slot for the icon. Does it work fine with your GUI?
I haven't played much, but depending on the order of installation I either get the top (DUI then Subrace) or the bottom (Subrace then DUI) part of the screenshot:
I removed these effects from in 2.5. I'll check for 2.6
Can I see the full screen? I started making my GUI mod due to the fact that my permission did not allow using Dragonspear. Now the same thing, does not allow. But it would be nice if everything else works fine.
You didn't answer about the utility, but here's it anyway: https://github.com/anongit/binpatcher
Full screenshot: https://i.imgur.com/PsXGWg2.jpeg
For some reason, I cannot create a pull request. I'll write here.
bgmain.exe - for BG2 idmain.exe - for IWD iwd2.exe - for IWD2 I can't check the first part of BG. There the exe file is broken. BGT is installed from it, but the game itself does not start (( But there is bgmain2.exe for ToSC. I can't say about the original PST. I have not installed it now.