Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: Heroes 3 Hacking Reference Guide
Thread: Heroes 3 Hacking Reference Guide This thread is 42 pages long: 1 10 20 30 ... 35 36 37 38 39 ... 40 42 · «PREV / NEXT»
Parascus
Parascus


Adventuring Hero
posted December 06, 2022 07:44 PM
Edited by Parascus at 22:44, 06 Dec 2022.

Hi BTB,

I tried now really hard to get the Mage Guildes. I'll explain what I did so far:

1. I rewrote the tables of dependency, I sorted them by building and added the guilds. I've done that in C and wrote the address of my variables into the addresses you mentioned in the guide. This seems to work because after I removed the dependencies of the dwellings I instantly could build all seven levels. I changed the addresses at: 0x4EB816 (Castle), 0x4EBA70 (Stronghold), 0x4EBA84 (Fortress).
By the way, could it be that the Tower starts at 23EF34 instead of 23EFE4?

2. I patched the code at 0x460FA4 with the code of your guide.

3. I replaced 0xFF at 0x642EEA with 0x04. The same for 0x642EEA and 0x64301D with 0x03 instead of 0xFF. (Generally is this a list of buildings that could be build and is searched by the program and in the dependency list?)

4. I wrote the name TOCSM501 to 0x004E41F7, TOSMag4 to 0x004E4201 and TOFMag4A to 0x004E420C (free space after Mysticism speciality mod) As I understood, these are the names of the outline files for the Mage Guild. I've put the files into the H3Bitmap.lod. Additionally I have put the addresses of the names into 0x68A3EC (F7 41 4E 00), 0x68A808 (10 42 4E 00) and 0x68A808 (0C 42 4E 00). As I understood this is the place the outline image should be placed.

5. As for the TZ files I didn't change anything in the code, I just put the images TZCSM501, TZSMAG4 and TZFMag4A into the H3bitmap.lod as well.

6. For the coordinates I didn't changed anything but the code you described: C0024C into 0x68AA26, D90101 into 0x68B050 and 008700 into 0x68B158.

7. The next step was to create the town images. I copied the def files and added some design elements. I didn't change the size of the image. I named them TBCSMAG5, TBSTMAG4 and TBFRMAG4 and put them into H3Sprite.lod.

8. Last but not least I created The images for window view: BoCsMag5, BoSMage4 and BoFMage4. These I've put into H3Bitmap.lod.

9. Last but not least I inserted some propabilites into SPTRAITS.TXT. I didn't pay attantion on the overal sum (neither per Town nor per spell).

I tried this now two times. The first attemp was without step 9 (so there was no propability that a level 4 or level 5 spell can be chosen) and the second with propabilities for the corresponding level.

The results for the first attemp are:
1. Castle has no changes. The fourth build can be build and after that the build button is golden in the Build Window (Hall with all buildings to select the structure to create). In the Mage Guild itself there is also the scroll of the fifth level presented furled.
2. Fortress can build 3 mage Guildes as usual but the 4th is not not presented. In the Build Window it is gray with the hint that this structure can not be build in this town (like a restriction in the map). The image presented is the one of the first level Mage Guild. The scrolls in the Mage guild are missing.
3. In Stronghold I can build the 4th level but it is not displayed in the town view. The Build Window shows it golden but with the image of the first level mage guild. efore the Mage Guild vanishes by building the 4th level it presents the furled scrolls of the 4th level.

The results for the second attemp are the same with the difference that building the Stronghold level 4 Mage Guild (as a last step) the Game crashes.

Can you please help me where I made my mistake?

Kind regards

Parascus

@LGBT_Lover_Boy: I'm far away from a knowing person or specialist. But if you are able to do some C-coding I think there might be a chance with a hook at 0x4C8631. As I understand it, at this point HOMM 3 has determined the week type (normal, +5 or Imp-Week) and the growth is also calculated. There it starts iterating over the towns and calling a subroutine which adds the creatures (located at 0x5C01D0). When you do a hook and manage to get the current week you could return at the same spot or jump forward 0x4C8687 right after the town loop. It might be that you still get the growth/week type displayed in the dialog but there is a chance that you omit the growth itself. It seems that the following example code might help:

   DWORD GameMgr = *(DWORD*)0x699538;
   short Day = *(short*)(GameMgr + 0x1F63E);
   short Week = *(short*)(GameMgr + 0x1F640);
   short Month = *(short*)(GameMgr + 0x1F642);

Hope this helps.




____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
BTB
BTB


Famous Hero
Moist & Creamy
posted December 08, 2022 03:50 PM

From what you're writing it seems like a problem with the dependency table. The injection method you're using doesn't seem to be working properly, but I can't really advise on that since I just use free space.

You should be able to rewrite the tables in-line since a lot of the dependencies don't seem to be needed on an actual coding level, namely any building with a direct upgrade. For exaple, this is what my Castle dependency table looks like:

07 00 00 00 FF FF FF FF
08 00 00 00 FF FF FF FF
09 00 00 00 FF FF FF FF
0B 00 00 00 05 00 00 00 0E 00 00 00 FF FF FF FF
0C 00 00 00 10 00 00 00 00 00 00 00 FF FF FF FF
0D 00 00 00 FF FF FF FF
00 00 00 00 FF FF FF FF
01 00 00 00 FF FF FF FF
02 00 00 00 FF FF FF FF
03 00 00 00 FF FF FF FF
04 00 00 00 FF FF FF FF
05 00 00 00 FF FF FF FF
0E 00 00 00 FF FF FF FF
10 00 00 00 FF FF FF FF
06 00 00 00 FF FF FF FF
11 00 00 00 06 00 00 00 FF FF FF FF
15 00 00 00 05 00 00 00 FF FF FF FF
16 00 00 00 05 00 00 00 FF FF FF FF
1E 00 00 00 07 00 00 00 FF FF FF FF
1F 00 00 00 1E 00 00 00 10 00 00 00 FF FF FF FF
20 00 00 00 1E 00 00 00 FF FF FF FF
21 00 00 00 1E 00 00 00 10 00 00 00 FF FF FF FF
22 00 00 00 20 00 00 00 00 00 00 00 FF FF FF FF
23 00 00 00 21 00 00 00 15 00 00 00 FF FF FF FF
24 00 00 00 29 00 00 00 FF FF FF FF
25 00 00 00 10 00 00 00 FF FF FF FF
26 00 00 00 FF FF FF FF
27 00 00 00 FF FF FF FF
28 00 00 00 16 00 00 00 FF FF FF FF
29 00 00 00 01 00 00 00 FF FF FF FF
2A 00 00 00 28 00 00 00 FF FF FF FF
2B 00 00 00 FF FF FF FF
12 00 00 00 27 00 00 00 FF FF FF FF
13 00 00 00 27 00 00 00 FF FF FF FF
1A 00 00 00 FF FF FF FF 9C FF FF FF

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Parascus
Parascus


Adventuring Hero
posted December 08, 2022 05:51 PM

Hi BTB,

thanks for your answer. I now have tried the castle directly with a hex editor but with the same result. The 4th level can be build and than the button is golden and there is nothing further I can do.

I think, that's it because I'm at my wits end.

Thanks for all

Parascus
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
deathstare
deathstare


Adventuring Hero
posted December 10, 2022 03:19 AM
Edited by deathstare at 03:22, 10 Dec 2022.

Hello? I have a question. Can I edit it so that I can clone multiple copies of the same unit again while there are already cloned units?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LGBT_Lover_Boy
LGBT_Lover_Boy

Tavern Dweller
posted January 06, 2023 04:29 AM

Is there any way to lower AI income in gold or maybe in other resourses?
Only for AI.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Parascus
Parascus


Adventuring Hero
posted January 30, 2023 03:20 PM

Hi AlexSpl,

I'm trieng to generalize the NewCrBanks mod you created because I also want to reqard with creatures in other banks. Alls seams fine as long as I attack a creature bank with my hero. But having the computer the same the game crashes. The reason is that i try to look into the hero, ig there is a free slot and if not if there is the base creature or the upgraded ones. This way it should react the same way like necrmany where I get normal skeletons as long as there is a corresponding slot and if not there it looks for a slot with skeleton warriors.

How can I determine the army of the receiving hero when I'm at 0x4ABBFA? I tried different registers but can't figure it out.

Best regards

Parascus
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted January 30, 2023 03:43 PM

Quote:
How can I determine the army of the receiving hero when I'm at 0x4ABBFA? I tried different registers but can't figure it out.

Try hero* Hero = *(hero**)(c->ebp + 8);

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Parascus
Parascus


Adventuring Hero
posted January 30, 2023 05:29 PM
Edited by Parascus at 17:57, 30 Jan 2023.

Hi AlexSpl,

thank you for your real quick answer. I don't know how you find this so easily. It works! Now the computer also can raid creature banks and take all the rewards without crashing the game.

Am I right that you can only have 255 creatures as a reward because the ebx + 58 just spends an Int8 for the number of creatures? In this case I do not only need your lower border (at least 1 creature) but also an upper one in case the number of creatures calculated by the hit point ratio is over 255?

Edit: I have just seen that the top might be 127 creatures because it's a signed char ... ist there any way to pump up those rookie numbers?

Thank you

Parascus
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted January 30, 2023 09:38 PM

Quote:

Edit: I have just seen that the top might be 127 creatures because it's a signed char ... ist there any way to pump up those rookie numbers?


This is a shot int he dark, but you could try to make the reward trigger several times in succession?

Easier way I think is hardcoding it to say, 10x times trigger reward.

That will need other adjustments tho...
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Parascus
Parascus


Adventuring Hero
posted January 30, 2023 09:56 PM

Hi NimoStar,

your idea is really good. Instead of giving back the amount I could build a table of values and return the index of the amount in the table. Having this I could write the indizes in the crbanks.txt e.g. for angels the 1, 2, 3, 4, for Wyvers 2, 4, 6, 8 and for my stock pil of suppressed Pixies (500 pieces) if you come past the 100 Vampires.

But for this as you indicated it, I would need the next hook. I think this should be somewhere in the function 004ABAB0. But right now I have no clue how to proceed and the day was long enough. Maybe tomorrow-me will find a solution.

Have a nice evening

Parascus
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Gandalf196
Gandalf196


Disgraceful
Supreme Hero
posted January 31, 2023 04:58 AM

I wonder whether Chat GPT won't be able, in a few months, to generate a fully functional source code with hexdumps and a bit of context.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
DarkAtom
DarkAtom


Adventuring Hero
posted January 31, 2023 11:30 AM

Gandalf196 said:
I wonder whether Chat GPT won't be able, in a few months, to generate a fully functional source code with hexdumps and a bit of context.


If it could do it for Heroes III, than it could also do it for any other program and AFAIK it's massively illegal to recreate the source code of a program without the owner's consent. Therefore, it will probably get limited (just like it's limited so that it doesn't tell you how to make bombs or write malware). Keep in mind that H3 hacking would only be a very minor use of such a tool.

A better question is probably about the Heroes III AI...
____________
"If you get scared of doing what's right you might as well lay down and die" - Wulfstan, Heroes of Might and Magic V: Hammers of Fate

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
BTB
BTB


Famous Hero
Moist & Creamy
posted February 01, 2023 03:04 AM

Well, I said that last time I updated the guide I had done everything I really ever wanted to do with it, so I won't tell the same lie again. But for the moment, at least, I really don't see anything more that can be added.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted February 01, 2023 05:26 PM

Quote:
AFAIK it's massively illegal to recreate the source code of a program without the owner's consent

Where did you get that idea? It's illegal to steal or copy existing code, but certainly not to try writing something similiar - blindly.

Besides, the "source code" generating exactly the same output for the user can differ vastly, and there are infinitely many ways to create it.

So yes, in real world developers do copy each other's ideas and try to rewrite it on their own.
____________
The future of Heroes 3 is here!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Parascus
Parascus


Adventuring Hero
posted February 01, 2023 06:36 PM

Hi AlexSpl,

Hmpf, I thought I got it working but the army data of the hero is weird.

I tried to get the army like this:
h3::H3Hero* currentHero = (h3::H3Hero*)(c->ebp + 8);
h3::H3Army currentArmy = (h3::H3Army)(currentHero->army);

Afterwards I iterated like this:
for (int i = 0; i < 7; i++) {
if (currentArmy.type == -1) hasEmptySlot = true;
       ...

But lookingat the values I got some 0, 27000000 and other funny stuff allthough I just have every slot filled with Gold Dragons and Pixies.

What I'm trying to do is to detect, if the hero has a free army slot, a slot with the base creature or a slot with the upgraded ones. So I can decide if the hero will get the base or the upgraded creatures as it does with the Necromancy skill (Skeletons or Skeleton Warriors).

By the way I managed to overrule the char dependend number of rewarded creatures. If the number of creatures is below 0 I take the number without 128 e.g. with -88 I will come to the number 40. And this is the number I multiply with a factor 10. This way I can reward with up to 1270 creatures in steps of 10.

If you have an idea way the army analysis is not working please let me know.

Best regards

Parascus
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted February 01, 2023 06:44 PM

Quote:
h3::H3Hero* currentHero = (h3::H3Hero*)(c->ebp + 8);

Maybe this is a culprit?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
DarkAtom
DarkAtom


Adventuring Hero
posted February 02, 2023 10:17 AM
Edited by DarkAtom at 10:33, 02 Feb 2023.

Warmonger said:
Quote:
AFAIK it's massively illegal to recreate the source code of a program without the owner's consent

Where did you get that idea? It's illegal to steal or copy existing code, but certainly not to try writing something similiar - blindly.

Besides, the "source code" generating exactly the same output for the user can differ vastly, and there are infinitely many ways to create it.

So yes, in real world developers do copy each other's ideas and try to rewrite it on their own.


There are laws that prevent reverse engineering (both US and EU laws allow interoperability purposes as an exception, which is not our case). In some jurisdictions you are not even allowed to disassemble an executable file. And rewriting the source code "blindly" as you say is impossible - it just isn't possible to get the logic to do the same thing. Could you recreate the same H3 AI from scratch without looking at the SC first?

We are not talking about creating a "similar" game based on what you see when you play. We are talking about taking the original EXE and creating a SC that behaves the same as the original (but is in now way required to look even remotely similar to the original SC). It is illegal to do that, because you are not allowed to look inside that EXE file to see what it does.

Now I'm not saying Ubi will suddenly come out with lawsuits for all modders out there. If they wanted to do that they could have tried it a long time ago. Modding brings them money since people need to buy the original game (this would probably be a different story if they released another game, but as everyone can see they don't). But having ChatGPT able to reverse engineer, while probably not damaging to Ubi's interests in the case of the HoMM franchise, will most likely be damaging to a lot of other companies' interests.
____________
"If you get scared of doing what's right you might as well lay down and die" - Wulfstan, Heroes of Might and Magic V: Hammers of Fate

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Parascus
Parascus


Adventuring Hero
posted February 02, 2023 07:02 PM

Hi AlexSpl,

that might be indeed the source of all evil ;-) or my lack of understanding pointers. I have now spread some more * into my code and, voila, everything is better than expected.

Thanks for your help and have a nice evening

Parascus
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
infinitekh
infinitekh

Tavern Dweller
posted February 07, 2023 10:08 AM

Where is first clone flag of Eovacius on hota

I try that find flags( or offsets) using 'gameconqueror'. (that is  cheat engine. )

I do "changed values " and "unchanged value" functions Many times,

But the location of the data may be changing, or the corresponding value could not be found.

How can I make Eovasious cast a double clone every time?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
portus
portus


Adventuring Hero
posted February 19, 2023 09:30 PM

@Infinitekh: I guess by now you will have found out, but there is a thread for hota-related hacking; this one is just about HD mod.

Does anybody know the offsets for puzzle and siege coordinates? I have tried searching the forum, to no avail. The only thing related to it is a post by Morglin (actually two of them) providing some oordinates for the puzzle, but either the data order is different from my version, or I just can’t find the patten behind those values (I mean, I expected the first piece of Castle’s puzzle to be at some sort of 00 00 00 00 since it is placed at that position, but nope. As for the siege walls coordinates, I haven’t even found that little.

Also, I’ve tried to install the Cheatengine in hopes of seeing the code in action and ideally not depending so much on asking you guys, but it won’t install! It just says that an error occurred while installing. I’ll try and get another version.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 42 pages long: 1 10 20 30 ... 35 36 37 38 39 ... 40 42 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1012 seconds