The internet is a lawless place with knowledge and sarcastic wit the pistols of this wild frontier.
Don't go out without being sufficiently armed.

~Blade

Other places

Ares (Current version: 0.B)

Ares's primary facilities have been moved elsewhere:

  • If you wish to report a bug in Ares, please proceed to its bugtracker.
  • If you'd like to request a feature, register a blueprint.
  • If you have questions or can provide answers regarding Ares's usage, visit the Q&A section.
  • Before you post a new question, you should check the FAQ, though.

Behavior

  • Mind the forum rules.
  • Due to its documentedly horrible quality, we do not offer NPatch support.


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The DLL Project
Author Message
Corporal pd Offline
The Man with the Shock Rifle
****
STX Hostees

Posts: 731
Joined: 24 Jan 2005
Reputation: 10
Post: #1
The DLL Project
I'd like to start a discussion thread about this DLL project here.

Firstly, let me inform you about what the "package" contains:
  • A minimally edited gamemd.exe. It includes IcySon55's high resolution YR icon for the looks, as well as a disabled launcher notification (ie it can run without ra2md.exe) and, of course, some DLL loader code and required memory.
    The file is probably not going to be changed any further, since all the other edits are possible using the DLL system.
  • An application currently called "Debugger.exe". It is the new launcher of gamemd.exe that activates the DLL system (running gamemd.exe by itself will run the unmodified game).
    Its name will probably be changed (it's "Debugger" because the app technically acts like one).
    To make Debugger.exe work with gamemd.exe, it has to find a corresponding information file, "Debugger.pdo" (a pdo-file Big Grin 2 ) which is designed specifically for the target executable.
    I made it a raw data format instead of an INI so people will just leave it alone.
    Debugger.exe currently comes with the YR icon and passes any command line argument to gamemd.exe.
  • The C++ wrapper for YR 1.001. Put the files into some folder and add it to the include list in your compiler.
    #include <YRWrapper.h> and you have all you need. More on this later.

A thing we need to discuss is some coding conventions.
Naming shouldn't be a problem, you can simply adapt to my naming scheme I suppose (I will post a sample header/cpp soon which you can comment on).

Inline assembly is a more critical aspect.
It is essential at many parts, although I will try my best to keep it minimal.
Since I'm writing this on MS Visual C++ 6.0 (which is recommended since the game itself was programmed on it), but its way of implementing inline assembly is different to GCC's way (to name one example).

An example.
MSVCPP:
Code:
_asm{mov ecx, [eax+edx*4+0x3C]}
GCC:
Code:
asm("mov ecx, [eax+edx*4+0x3C]");
As you see, GCC uses just "asm" and uses it as a function taking a const char*, so there's no way to make one notation working for both compilers.
Does anyone know of a compiler-directive that can make out the compiler's internal name?

As you might also see, I use the Intel notation, GCC defaults to the AT&T notation.
The notation can be switched with some flag, will dig it out later.

Finally, as Blade proposed, there should be a central repository for DLLs that are considered authentic.
My current RP2 place can be turned into such a place, I think it would be the best idea.

[Image: jsfml.png]
26.12.2007 20:37:16
Visit this user's website Find all posts by this user Quote this message in a reply
Private TheMan Offline
Senior Member
****
Members

Posts: 271
Joined: 22 Apr 2006
Reputation: 0
Post: #2
RE: The DLL Project
hmm sounds very good Smile
I was wondering two smalls things.
Can you write almost everything in a dll file? exempel so voxels can be 2x2 instead of 1x1 and SW clones?
And also how mutch C++ skills is required to write a simple fuction like perma mind controll?
26.12.2007 22:34:40
Find all posts by this user Quote this message in a reply
Corporal pd Offline
The Man with the Shock Rifle
****
STX Hostees

Posts: 731
Joined: 24 Jan 2005
Reputation: 10
Post: #3
RE: The DLL Project
There is no "almost" everything, it is everything.

However, some things are not possible in just C++.
The voxel thing for example requires you to find the relevant code in the exe. The code itself can be done in C++ of course, but the place where to hook it you have to find first.
Those are things I will still have to care of.

For new SuperWeapon types and custom Weapons I will most likely deliver good templates.
Perma mind control sounds to me that it just changes the owner but still displays the "captured" anim, things like that will of course be doable.

[Image: jsfml.png]
26.12.2007 22:53:56
Visit this user's website Find all posts by this user Quote this message in a reply
Commander-in-Chief Renegade Offline
Lazy Modder
*****
Admins

Posts: 1 906
Joined: 21 Nov 2004
Reputation: 14
Post: #4
RE: The DLL Project
I'm still proposing to involve Subversion into this.

I could set up a repository that allows public reading but authenticated writing, so only "real" DLL developers could upload there. DLL source code also be tracked and managed by it.

I just need a few more days to update it, because I can't pull the update over the YaST, and the rpm is putting me into dependency hell -_-
After I updated it, I'll also try to install something like ViewCVS, so we get correct web-access to the repositories once and for all.

Forum Rules

(01.06.2011 05:43:25)kenosis Wrote:  Oh damn don't be disgraced again!

(25.06.2011 20:42:59)Nighthawk Wrote:  The proverbial bearded omni-bug may be dead, but the containment campaign is still being waged in the desert.
27.12.2007 21:37:39
Visit this user's website Find all posts by this user Quote this message in a reply
Corporal Marshall Offline
Ultimos Homo Statans
*****
STX Hostees

Posts: 1 033
Joined: 23 Jan 2005
Reputation: 12
Post: #5
RE: The DLL Project
pd Wrote:Perma mind control sounds to me that it just changes the owner but still displays the "captured" anim, things like that will of course be doable.
Maybe off topic, but perma mind control also makes the unit un-mind-controllable - so is slightly different to a simple 'change owner' weapon.

Ever wondered what the hell is going on?
Believe me friend you're not the only one.
--Lysdexia

Check out Launch Base for RA2/YR - http://marshall.strategy-x.com
Also home to the Purple Alert mod, 1.002 UMP, and the YR Playlist Manager.
28.12.2007 10:39:11
Visit this user's website Find all posts by this user Quote this message in a reply
Private MCV Offline
Junior Member
**
Members

Posts: 41
Joined: 4 Dec 2006
Reputation: 0
Post: #6
RE: The DLL Project
Now, I'm not too good with any file that doesn't end in *.txt or *.ini, but, since these Dynamic Link Libraries are extensions of the gamemd.exe, could all the previously implemeted features of RP/RP2 be, for the lack a bettery word, simply ported to a DLL? Without too much hassle? Or would it require a lot of rewriting?

Renegade - I pity the fools who moved on to Generals modding.
Guest - Because they can already do all of this?
Renegade - No, because they sold their soul to the devil instead of having faith and waiting for the messiah.
28.12.2007 20:47:59
Find all posts by this user Quote this message in a reply
Sergeant gordon-creAtive Offline
creAtive FreemAn
****
Moderators

Posts: 395
Joined: 15 Apr 2007
Reputation: 5
Post: #7
RE: The DLL Project
This is already planned by pd.

[Image: osen2o7mpmm4jg1fs0.jpg]
28.12.2007 23:11:24
Visit this user's website Find all posts by this user Quote this message in a reply
Corporal pd Offline
The Man with the Shock Rifle
****
STX Hostees

Posts: 731
Joined: 24 Jan 2005
Reputation: 10
Post: #8
RE: The DLL Project
OK, here's a first little sample (screenshot and source file Tongue )...

This is a way to print information on the screen, either using the MessageListClass (which prints messages similarly to the "LightningStorm created!" message) or using the general text printing routine, which, if hooked correctly, can be used to display always up-to-date information.

In this case I implemented both:
The "MasterKey" function gets triggered if I press whatever key I assigned to "Show Mouse Coords", it replaces that command.
The "PrintDebugInfo" function gets triggered every frame after the map etc. has been drawn.
It comes directly after the -MPDEBUG code, just it doesn't need -MPDEBUG to be enabled.


Attached File(s) Thumbnail(s)
   

.rar  cpp.rar (Size: 649 bytes / Downloads: 266)

[Image: jsfml.png]
29.12.2007 21:48:17
Visit this user's website Find all posts by this user Quote this message in a reply
Private TheMan Offline
Senior Member
****
Members

Posts: 271
Joined: 22 Apr 2006
Reputation: 0
Post: #9
RE: The DLL Project
Kinda cool. I did not understand a think in the source Big Grin
I was wondering how long time it took you to write this and how long would it take to write a LS Storm clone?
29.12.2007 22:26:11
Find all posts by this user Quote this message in a reply
Private Electro Offline
Member
***
Members

Posts: 182
Joined: 26 Nov 2006
Reputation: 6
Post: #10
RE: The DLL Project
That. Is. So. Awesome!

Albert Einstein Wrote:Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe.
29.12.2007 22:27:42
Visit this user's website Find all posts by this user Quote this message in a reply
Corporal Marshall Offline
Ultimos Homo Statans
*****
STX Hostees

Posts: 1 033
Joined: 23 Jan 2005
Reputation: 12
Post: #11
RE: The DLL Project
Are MasterKey and PrintDebugInfo wholly new routines, or do they replace pre-existing routines?
If the former, then how does the game know when to call them? Or is this part hardcoded by you?

Ever wondered what the hell is going on?
Believe me friend you're not the only one.
--Lysdexia

Check out Launch Base for RA2/YR - http://marshall.strategy-x.com
Also home to the Purple Alert mod, 1.002 UMP, and the YR Playlist Manager.
29.12.2007 22:57:40
Visit this user's website Find all posts by this user Quote this message in a reply
Corporal pd Offline
The Man with the Shock Rifle
****
STX Hostees

Posts: 731
Joined: 24 Jan 2005
Reputation: 10
Post: #12
RE: The DLL Project
Marshall Wrote:Are MasterKey and PrintDebugInfo wholly new routines, or do they replace pre-existing routines?
They're inside a DLL, ie not even in gamemd.exe, ie wholly new routines.
While you might point out "it replaces that command." from my previous post, that replacement I did on purpose to disable showing the mouse coords.

Marshall Wrote:how does the game know when to call them?
The game does not know, my Debugger does.
Every DLL will come with a control INI file, holding information about what DLL function to call when (ie when the game reaches a specified part of code).
If it reaches one, the Debugger makes gamemd.exe jump to a special piece of code I inserted, attaching the desired DLL to it and calling the desired function.
After that's finished, it will return to where it came from (unless you modify the place to return to using SET_RETURN_EIP).

I will release a long list of code places so you have plenty of options to hook your code.
Giving you new places will stay my job, as that requires exe research like before.

[Image: jsfml.png]
29.12.2007 23:06:56
Visit this user's website Find all posts by this user Quote this message in a reply
Sergeant gordon-creAtive Offline
creAtive FreemAn
****
Moderators

Posts: 395
Joined: 15 Apr 2007
Reputation: 5
Post: #13
Rather offtopic but...
[Image: 1190326286_f.jpg]

The source looks like you could get ready for Gordonpatch Tongue

[Image: osen2o7mpmm4jg1fs0.jpg]
(This post was last modified: 29.12.2007 23:42:42 by gordon-creAtive.)
29.12.2007 23:38:39
Visit this user's website Find all posts by this user Quote this message in a reply
Private TX1138 Offline
Junior Member
**
Members

Posts: 33
Joined: 23 May 2007
Reputation: 3
Post: #14
RE: The DLL Project
This is really epic Tongue

[Image: cabal_sig_2.png]
Proud supporter of Xeno, the Revora Juggernauts, and PDF
30.12.2007 00:54:11
Find all posts by this user Quote this message in a reply
~Guest~
Guest
Guests

No info available...
Post: #15
RE: The DLL Project
Dupl3xxx~ (I should become a member soon right?)

This is epic indeed! I cann't wait to see what you pd can creat to the game! This is simpely impressive!
30.12.2007 02:29:35
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)