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 31 32 33 34 ... 40 42 · «PREV / NEXT»
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted October 29, 2022 07:58 PM
Edited by AlexSpl at 20:15, 29 Oct 2022.

You can get adjusted defense right in your current hook.

.text:00442234 018 call    long army::get_adjusted_defense(army *,bool) ; Call Procedure
.text:00442239 010 mov     [ebp+0Ch], eax


As you place your hook at 0x442239, it is in c->eax (it is the result returned by long army::get_adjusted_defense(army *,bool) in the eax register).

Although, to modify army's defense you have to hook the very above function, so that it would take into consideration the Frenzy spell hanging on that army. Now the function army::get_adjusted_defense() has already a check for Frenzy, and sets defense to 0 for damage calculations. Look at 0x4422BD. You have to implement your own logic if you want defense to have a different value.

To change duration, return new value in c->eax before jump at 0x444679. Actually, you may place a hook at 0x44463B and skip the original code, then return to 0x44467E with your new duration in c->eax.

To implement a bonus for Frenzy specialty, add a case for Frenzy to hero::GetHeroSpellBonus() (0x4E6260). Then you will be able to call this function for Frenzy whenever you want that bonus to have an effect.

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


Adventuring Hero
posted October 29, 2022 10:30 PM

Hello AlexSpl,

thanks for your quick reply. And it was a smash! Attack-calculation -> check, Defence-calculation -> check, hook for duration -> check!

I asume that this knowledge is eather in the IDB database or in you brain ... both stimulating a little bit envy

For me the only opn pont to finish my "pimp my frenzy" is to calculate the duration only if the hero has a speciality in frency spell. Do you know how I can find the speciality information of a hero? as I mentioned I canÄt find the link between a hero and his speciality and also found no other likely usage of the H3HeroSpecialty structure.

Best regards

Parascus
____________

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


Responsible
Supreme Hero
posted October 30, 2022 06:30 AM

Quote:
Do you know how I can find the speciality information of a hero?


Try the following:

#define H3HeroSpecialties ((h3::H3HeroSpecialty*)0x679C80)
h3::H3Hero* hero = /* pointer to hero */;
h3::H3HeroSpecialty* heroSpecialty = &H3HeroSpecialties[hero->id];


The specialty of a hero is an element of the array of h3::H3HeroSpecialty structures, hero->id being an index.

Quote:
For me the only opn pont to finish my "pimp my frenzy" is to calculate the duration only if the hero has a speciality in frency spell.

Don't forget to add +1 to duration of Frenzy, if you are not casting Frenzy on an active army (to match its original mechanics). For example, if you cast Frenzy on a waiting army, duration of Frenzy will be 2 rounds, not 1!

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


Adventuring Hero
posted October 30, 2022 02:43 PM

Hi AlexSpl,

thanks for all your help. My Frenzy does now the following:
1. Attack is always doubled, except when the orb of tempterous fire is equipped, than it is 2.5 times the attack.
2. Defense is set ot 0, 0.25, 0.5 or 0.75 times the original defense depending on the level of fire magic (none, bais, advanced, expert)
3. The duration is depending on the level of fire magic two (1, 2, 3, 5 rounds) but only if the hero has speciality on the spell frenzy.

Thanks for all your help and have a nice weekend.

Parascus
____________

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


Famous Hero
Moist & Creamy
posted October 31, 2022 09:32 AM

Not really sure if I should make a new thread about it or not since most of what I share is coding instead of graphical, but I've whipped up some fourth-level mage guilds for Fortress and Stronghold.

https://cdn.discordapp.com/attachments/692895170722660434/1036558244698656838/313425594_142400885205504_871809623514935053_n.jpg

https://cdn.discordapp.com/attachments/692895170722660434/1036558258716028988/312640105_142400881872171_403750598937270691_n.jpg

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


Adventuring Hero
posted October 31, 2022 09:39 AM

Hey BTB,

that looks great. How can I activate them? If making a new thread please share a link.

Best Regards

Parascus
____________

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


Famous Hero
Moist & Creamy
posted October 31, 2022 09:56 AM

Parascus said:
Hey BTB,

that looks great. How can I activate them? If making a new thread please share a link.

Best Regards

Parascus


Well, the graphics are included in my mod, which you can just download and extract.

As for the coding required... surprisingly simple.

060FA4~ED ; Allow Mage Guild Lv. 4 for Stronghold and Fortress + Lv. 5 for Castle

74 0F je 460FB5
8B 4D 08 mov ecx,[ebp+08]
8B 75 FC mov esi,[ebp-04]
C681C04E690003 mov byte ptr [ecx+694EC0],03
EB 76 jmp 46102B
8B 86 58010000 mov eax,[esi+158]
8B 1D B0CD6600 mov ebx,[66CDB0]
8B 8E 5C010000 mov ecx,[esi+15C]
8B 3D B4CD6600 mov edi,[66CDB4]
21 D8 and eax,ebx
21 F9 and ecx,edi
09 C8 or eax,ecx
74 50 je 461025
8A 46 04 mov al,[esi+04]
8B 75 FC mov esi,[ebp-04]
8B 4D 08 mov ecx,[ebp+08]
84 C0 test al,al
74 0C je 460FEE
3C 06 cmp al,06
74 08 je 460FEE
3C 07 cmp al,07
74 04 je 460FEE
42 inc edx
90 90 90 nop

Fortress Guild

24301D > 03 ; include in town's build list
28A8B8 > 10 95 4D ; add pointer to outline
D9518~20 > 544F464D6167344100 ; outline (uses free space from optimizing Blacksmith code)
28B156 > 15 00 00 00 6B 00 ; add coordinates
28B154 > 98 ; update lv.3 coordinates

Stronghold Guild

242FF0 > 03 ; include in build list
28A808 > 10 95 4D ; add pointer to outline
28B04E > 00 00 86 01 03 00 ; add coordinates
D9510~7 > 544F534D61673400 ; outline (uses free space from optimizing Blacksmith code)

28B03E > 86 ; update lv. 3 coordinates
28B040 > 5D ; ""
28B044 > 86 ; update lv. 2 coordinates
28B046 > 3A ; ""
28B04A > 86 ; update lv. 1 coordinates
28B04C > 1F ; ""

You'll also have to go to the Stronghold/Fortress building requirements and add the guild 3 requirement for level 4.

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


Adventuring Hero
posted October 31, 2022 10:03 AM

Hi BTB,

as I'm still new here sorry for the supid question. Where can I download this?

Best Regards

Parascus
____________

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


Famous Hero
Moist & Creamy
posted October 31, 2022 10:04 AM

Parascus said:
Hi BTB,

as I'm still new here sorry for the supid question. Where can I download this?

Best Regards

Parascus


http://heroescommunity.com/viewthread.php3?TID=46065&pagenumber=1

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


Adventuring Hero
posted October 31, 2022 11:23 AM

Hi BTB,

thanks for the links. But the game is crashing using multi player hot seat. Any idea? Interested in the crash report? If yes, where can I upload it?

Best regards

Parascus
____________

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


Famous Hero
Moist & Creamy
posted October 31, 2022 11:26 AM

Parascus said:
Hi BTB,

thanks for the links. But the game is crashing using multi player hot seat. Any idea? Interested in the crash report? If yes, where can I upload it?

Best regards

Parascus


I can have a look, but given that I'm not replicating it (and also not something my mod even touches) I suspect it's something on your end.

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


Adventuring Hero
posted October 31, 2022 11:36 AM

Hi BTB,

reproduction is a difficult task. You never know the situation at the user's end. In my case there might be some additional topics because I have an installation of Version 5.4, than I installed AH3M over it and afterwards the mods of your link. So it's a special situation and I think I stay with my first adaptions.

I might use your way mentioned above, take the images and your code and path it in the hope that it will work.

@AlexSpl:
Is there another way to get to the information of Hooks and returns? I still get no response regarding IDA 7.7 + Hex-Rays decompiler. I'd like to change some more:
* finding the index of the pictures of morale and luck (having expanded it to +5 and +6.
* Boosting Hypnotize
* Changing speciality descriptions, creature stacks, spells descriptions, bios

Best regards

Parascus
____________

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


Responsible
Supreme Hero
posted October 31, 2022 12:30 PM
Edited by AlexSpl at 16:17, 31 Oct 2022.

Quote:
Is there another way to get to the information of Hooks and returns?

The database only helps you to find places for hooks, it doesn't provide ready-to-use addresses.

Quote:
I still get no response regarding IDA 7.7 + Hex-Rays decompiler.

You can download IDA Free and then disassemble the game executable by yourself. You need the Hex-Rays decompiler only to open the database with signatures.

Btw, see if this text dump is of any help for you. A bit old though.

As an option, you can use Ghidra decompiler in IDA Free. You just need Yagi.

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


Adventuring Hero
posted November 01, 2022 09:59 AM

Hi AlexSpl,

thanks for the info. I now have IDA running and might have found an interesting spot: E19CF (and following). It seems that this routine calculates the image offset of luck (and morale?) I tried to modify it in Cheat Engine but had no luck by increasing the value of E1A01 to 5. It still shows the 7th picture and not my 9th. Any experience with this?

I also tried to do a hook, starting at 0x4E19Cf, setting eax to 5 and returning to 0x4E1A02. But with that the game crashes. Can you tell me what the code does more between the jumped lines?

Best regards

Parascus
____________

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


Responsible
Supreme Hero
posted November 01, 2022 11:11 AM
Edited by AlexSpl at 11:16, 01 Nov 2022.

Quote:
I also tried to do a hook, starting at 0x4E19Cf, setting eax to 5 and returning to 0x4E1A02. But with that the game crashes.

If you have enough frames for Luck, try to change Luck boundaries:

// mov dword ptr [ebp-8], 3 -> mov dword ptr [ebp-8], 5
_PI->WriteDword(0x4E19D2, 5); // High
// mov esi, -3 -> mov esi, -5
_PI->WriteDword(0x4E19DC, -5); // Low


Make sure to correct +3 "shift" at 0x4E19FF if you added cadres for -5 and -4 Luck before the original Luck cadres.

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


Adventuring Hero
posted November 01, 2022 11:14 AM

Hallo BTB,

I just tried to change Orrins Archery skill. But it does not matter how I try (changing address order, adding 400000, overpowering, I get no increased damage on the archers. I tried the following:
24 44 E4 00     EB 04     00 00 44 7A     D8 45

What do I miss?

Best Regards

Parascus
____________

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


Adventuring Hero
posted November 01, 2022 11:33 AM

Hi AlexSpl,

no luck with that (pun intended). Interesting fact is that with the right or left mouse button the Luck dialog always shows the image of "1 luck". But in the hero dialog I got the "3 Luck" image.

Best regards

Parascus
____________

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


Responsible
Supreme Hero
posted November 01, 2022 11:46 AM
Edited by AlexSpl at 11:59, 01 Nov 2022.

Well, there are several places you need to take care of. For example, to adjust indexes of Luck frames from ilck22.def look at 0x451B52 and 0x52F3FE.

According to MMArchive output, there are, at least, 6 defs (ilck22/30/42/82/b/S) you have to take care of (both in graphics and coding department).

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


Famous Hero
Moist & Creamy
posted November 01, 2022 11:47 AM

Parascus said:
Hallo BTB,

I just tried to change Orrins Archery skill. But it does not matter how I try (changing address order, adding 400000, overpowering, I get no increased damage on the archers. I tried the following:
24 44 E4 00     EB 04     00 00 44 7A     D8 45

What do I miss?

Best Regards

Parascus


What are you trying to do?

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


Adventuring Hero
posted November 01, 2022 12:07 PM

Hi BTB,

I try to adjust the Skill Speciality according to your guide. I refer to the text which tells me the amount of damage when shooting with archers (not the damage in the stats). It does not matter what percentage I apply, it is always the same range.

Best regards

Parascus
____________

 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 31 32 33 34 ... 40 42 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0602 seconds