Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Tue Apr 16, 2024 7:21 pm
All times are UTC + 0
Needing help with a hack please.
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [15 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Wed Dec 11, 2019 6:55 pm    Post subject:  Needing help with a hack please.
Subject description: freeunit_enhancements.asm
Reply with quote  Mark this post and the followings unread

I was humbly wondering if anyone had some insight on the (freeunit_enhancements.asm) from github. Is it by chance available in the form of exe hack?  Any help would be appreciated.

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Thu Dec 12, 2019 2:07 am    Post subject: Reply with quote  Mark this post and the followings unread

Exe hacks that you expect are just replacement of few bytes but those compilable hacks which don't fit in a few bytes, jump to a new location and perform its actions and come back to the main processing and that particular hack does a lot of it. Several of those hacks are also dependent on other patches.

It is not hard to build those hacks yourselves, just follow the instructions in the readme.

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Thu Dec 12, 2019 3:03 pm    Post subject: Reply with quote  Mark this post and the followings unread


Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Thu Dec 12, 2019 3:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes, install winbuild wherever you want. Then download ts-patches and set the correct path of the winbuild bin path in say build_TSClient.cmd and then run that .cmd file. It will generate the compiled exe which is made for TSClient. Inside ts-patches/src/mods/tsclient/tsclient.mk file, can modify the list of hacks that you want. Can look at TI or DTA files for examples.

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Thu Dec 12, 2019 4:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thank you for the help. I've been looking in on all the amazing work everyone has been contributing. For me, I have very limited knowledge of this and I've been wanting to start looking into it but it kinda overwhelming. I appreciate you getting me started

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Fri Dec 13, 2019 5:02 am    Post subject: Reply with quote  Mark this post and the followings unread

E1 Elite wrote:
Yes, install winbuild wherever you want. Then download ts-patches and set the correct path of the winbuild bin path in say build_TSClient.cmd and then run that .cmd file. It will generate the compiled exe which is made for TSClient. Inside ts-patches/src/mods/tsclient/tsclient.mk file, can modify the list of hacks that you want. Can look at TI or DTA files for examples.


So just so I'm clear, the hacks that I want to add (freeunit_enhancements.asm)... i need to add to the end list within the tsclient.mk file, run the build_TSClient.cmd and it complies into a useable exe?

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Fri Dec 13, 2019 5:50 am    Post subject: Reply with quote  Mark this post and the followings unread

That hack is already included in tsclient.mk file in the latest commit at github, just build it, copy the new tsclientgame.exe to TSClient installation, rename it to Game.exe (overwrite after backup) and use.

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Fri Dec 13, 2019 2:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

Dkeeton coded this a while back but it's still incomplete, so right now it only allows factories to provide the unit type they produce as a FreeUnit (so a barracks can provide infantry as a FreeUnit and a helipad can provide aircraft as a FreeUnit).

_________________

Back to top
View user's profile Send private message ModDB Profile ID YouTube User URL Facebook Profile URL
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Sat Dec 14, 2019 3:19 am    Post subject: Reply with quote  Mark this post and the followings unread

Thank you both for guiding me in the right direction. I accidentally downloaded a non master version of the patches without the latest additions. I did manage to run a patch but upon testing i could only get infantry to spawn successfully from the barracks. when i tried to add a FreeUnit=ORCA to the Helipad nothing will spawn. i verified it still had the correct tags (Factory=AircraftType). Did i maybe miss something?

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sat Dec 14, 2019 6:22 am    Post subject: Reply with quote  Mark this post and the followings unread

You are on right track. Looks like you have to add HoverPad=yes to helipads to spawn the free unit on the pad itself. Probably the hack could have included this info in the comments.

Without this hack if you give Orca as free unit to any building, it would have produced it by the side of the building. Now with this hack it crashes the game if you give it to wrong factorytype like giving Orca to barracks.

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Sat Dec 14, 2019 6:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

Nice! I did in fact overlook adding that tag. I was able to test out and apply a few other available patches successfully so thank you again for walking me through it all. Forgive my greediness for asking more questions out of my league, but while I was trying to learn all of this LKO referred me to as section of a thread where ollydbg debugger is used for patching. This method seems like it's a completely different approach.. if I was planning on implementing air to air combat example:

00409112                 call    dword ptr [edx+58h]

to

00409112                 jmp 0x00409127

Is this something that can be integrated for compiling using what ive learned or do i need to do it with the debug method mentioned?

Back to top
View user's profile Send private message
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sun Dec 15, 2019 3:17 am    Post subject: Reply with quote  Mark this post and the followings unread

If you are altering the game during runtime with a debugger, the same can be done as a hack that can be applied to the exe. It is not a different approach, you are only finding what you want to change by using the debugger.

Back to top
View user's profile Send private message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Mon Dec 16, 2019 12:14 am    Post subject: Reply with quote  Mark this post and the followings unread

E1 Elite! I managed to learn how to patch using both methods in only a few days and just a few posts with your help. Might not sound like much, but for someone with zero programming knowledge it feels great to be able to keep my game updated like the rest of you geniuses here.  My sincere thanks again good sir!

Back to top
View user's profile Send private message
A.Productions
Vehicle Drone


Joined: 17 Aug 2019

PostPosted: Sat May 30, 2020 10:25 am    Post subject: About allocating hacks in a different space. Reply with quote  Mark this post and the followings unread

I have seen in the EXE file that there seems to be empty space on the very top. Would it break the game to have the hacks there?



Hex empty..png
 Description:
 Filesize:  139.03 KB
 Viewed:  1699 Time(s)

Hex empty..png



Back to top
View user's profile Send private message
^Rampastein
Rampastring


Joined: 11 Oct 2008
Location: Gensokyo

PostPosted: Sat May 30, 2020 10:41 am    Post subject: Reply with quote  Mark this post and the followings unread

AFAIK the first 0x1000 bytes of the exe is the PE header, not a code section. Most likely it's marked as non-executable so code cannot be run from there, even if it was loaded to memory (I'm not sure if it is).

_________________
CnCNet Client | CnCNet TS patches | More Quality-of-Life Improvements for RA Remastered


Back to top
View user's profile Send private message ModDB Profile ID Facebook Profile URL
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [15 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1668s ][ Queries: 14 (0.0115s) ][ Debug on ]