Renegade Projects Network Forums
Patching extra functionality into <gamemd.exe> - Printable Version

+- Renegade Projects Network Forums (https://forums.renegadeprojects.com)
+-- Forum: Inject the Battlefield (https://forums.renegadeprojects.com/forumdisplay.php?fid=60)
+--- Forum: Ares General Discussion (https://forums.renegadeprojects.com/forumdisplay.php?fid=19)
+--- Thread: Patching extra functionality into <gamemd.exe> (/showthread.php?tid=16)



- Renegade - 28.03.2005

Thoughts?
I will not touch RA2's registry. Period. I'm not gonna reinstall this game again.
Plus, how would we add this flag to a victi-- err, user's computer?


- pd - 28.03.2005

1)
Adding a registry entry cannot destroy anything.
If you want I can even write you a tool which sets the value to 1 or 0.
A window with a checkbox "Activate log file writing".

2)
Know a better way?
Note that INIs and commands aren't possible.

The last possibility would be disabling the log again, or living with a baaad game performance.


- Bobingabout - 28.03.2005

my mod adds a registry key, currently it does nothing....

command line would be the best option imo...


EDIT: Also, note from PD. log from command line is possible, just disable it after the first few entries.


- pd - 28.03.2005

ra2md.exe -log Wink

Happy now, Renegade? Big Grin


- Marshall - 29.03.2005

So ommitting -log means that a log file will be written but only the first few lines.
Adding -log to the YR shortcut will enable full log file writing.

yes?


- pd - 29.03.2005

If "-log" is not given, thelog file including the first few lines written at the beginning will be deleted.
If "-log" is given, the log will be written until you end the game.

All in all: yes Wink


Besides, I'm quite ready to release the next patch version.
Ah wait, CellSpread.
I'm about to limit it to about 30. I think it should be enough.


- Renegade - 30.03.2005

I've just played a wonderful, hours-long game of TD: SE's Alpha. Without the patch. It was the exact same version that gave me reconnection errors all over the place while the patch was active.

Yet, I have yesterday killed a trojan that camped on my HD. Since it can only have been there for two days at max, it is highly unlikely that it generated the REs, but it is still possible. I will do new tests with a new version of the mod later.


- pd - 30.03.2005

:huh: Huh?
So you also got the same REs without my patch, did I understand it right?
If so, okay LOL
Well, at least some problem that is not caused by my patch.

Due to the "unfindability" of the mysterious IEs, I decided to restlre the original exe and rewrite all my code again from scratch.
That may get a lot of work, as I also plan to improve all my codes, but I think it's worth it.
I don't know what the next version will include (v1.04 is released in case you didn't notice), but I know that it could take some time until it's going to be released.


- Renegade - 30.03.2005

Sorry dude, but it's the other way round Tongue

I've just played a wonderful, hours-long game of TD: SE's Alpha. Without the patch.
It was several hours long. i.e. it was not interrupted by some weird-ass error. And it was with your patch deactivated.

It was the exact same version that gave me reconnection errors all over the place while the patch was active.
However, the exact same version did give me errors while the patch was activated.

Yet, I have yesterday killed a trojan that camped on my HD.
i.e. my testing environment was not clean, therefore I cannot say whether the results are conclusive.

Since it can only have been there for two days at max, it is highly unlikely that it generated the REs, but it is still possible.
The intervall between the kill-the-trojan test and the test before, which showed no virus, was minimal. In fact I'm not even sure if I played in that intervall at all. Therefore, I'm pretty sure those errors were not caused by the trojan, but by something related to the game (either my code or your patch). Unfortunately, I cannot exclude the possibility that the trojan generated the errors. So I have to test again.

I will do new tests with a new version of the mod later.
I will play today's build of the mod online as well, again testing if more errors occur with the patch enabled or not. Probably tomorrow afternoon.


- pd - 31.03.2005

OK then.

Well, news, bad news...
As you know, I restored the original EXE in order to rewrite my hack.

I created my segments, coded MenuColors and CellSpread,
and the error is back again,
EXACTLY the same one.

So it's not my lack of knowledge about coding.
I used completely different addresses this time, so the error would have to point to somewhere else.
But no. Exactly the same one.

So there must be something else raising the error.
As the gamemd.exe couldn't check for it's own size,
I'm thinking of an anti-copy-protection thingy: ra2md.exe.
But as ra2md.exe was built months BEFORE gamemd.exe, this is weird again.

I tried to enable gamemd.exe to run without ra2md.exe.
It runs DirectX, I got a black screen, and nothin seemed to happen.
So this won't work, or it requires more things to do.

All in all, I'm in a messed up situation, no idea what I should do, or where to begin. Plus, my disassembler keeps having errors as well and I can't use it at the moment.
:angry:


- Renegade - 31.03.2005

Highly unlikely. As we all know, RA2 has one of the most creative copy-protection-mechanisms ever invented: Let you into the game, make it seem like everything is fine, and then...BOOM. Game lost.

If ra2md was really checking gamemd for modifications, you'd get something else. Like "game corrupted, please reinstall" or something. But not something as generic as an Internal Error. As far as I'm concerned, IEs are part of the engine, not of the copy-protection, aren't they? Plus, as if every no-CD-crack would generate a carpet-bombing of IEs...

Are you 100% sure the errors don't occur when your patch is deactivated?
What do you know about the address that's giving you headaches?
Perhaps, as mentioned on DeeZire, try a compatiblity mode? 'cause actually, IEs are less or a problem for me...it's the REs that bit my ass again and again (the point being that I'm using 98SE, while you use XP).

In addition, you said there's a lot of unused space that could be deleted in the exe - if everything else fails, how about not extending the exe, but rather use the space that's free anyway?


- pd - 31.03.2005

I'm about 99% sure that I don't get that error when playing the original game.
Plus, other people get the error, too, but probably only when using my patch.

Everything I know about the address is that it's invalid (non-existing) and always the same.

There is a lot of free space, yes, but I noticed that it's only virtual space.
Plus, it's in the data segment, I couldn't write any code in there.
The new segments are the best solution, so everything made by me is in my segments, and I don't need to modify existing stuff.
Besides, they work.

I'm going to try the unpatched + unmodded game now, to be 100% sure I don't get the error.
If I don't get it again, I'll try to run my patch with a compability mode.
*Checking YR box* Win98 should be the best one.

I had a look at the ra2md.exe.
Actually it does nothing but run gamemd.exe.
I wonder what it is for then anyway.


- Guest - 31.03.2005

It's for the safedisc copy protection.


- pd - 31.03.2005

Good news... very good news...

I just played a game with the original gamemd.exe a few minutes ago.
Result: Internal Error.

What is good news with that?
The error was my "mysterious IE"!!

That means, my patch doesn't cause anything Big Grin

EDIT:
Argh, now I'll reinstall YR.


- Marshall - 31.03.2005

That is a relief.
It may well be that Internal Errors can occur obscurely when using XP.
I saw the first ever IE in RA2 the other day and I was playing against someone who was running XP.

RA2/YR was not designed for XP and so problems may ensue.
However, my opponent was not running with compatibility mode and, now that they are, we have not had a problem since.

compatibility mode may be the key to keeping Internal Errors at bay (at least, any not caused by modding/hacking)

Bah! I think I'll stick to ME. I've had almost no problems with that.



Don't know about Reconnection Errors though...