Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Wayfarer

Fake Dlls

This topic is 6909 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anybody have any "fake" DirectX Dlls handy? I just happen to be reading some winsock programming articles and came across this one site at http://users.neca.com/vmis/roll.htm which says you can created your own wsock32.dll, which browsers like Netscape use, substitute it with the real wsock32.dll found in the system directory, and be able to intercept the browser's calls to it. This gave me the idea, why not create a fake ddraw.dll and run a DirectX game like Starcraft or something, and see what it's doing. You could print out where it calls Blts, all of its passed parameters, and other neat stuff. But, I don't even know if it will work, since you might have to recreate a bunch of empty functions. Wayfarer Edited by - Wayfarer on 5/19/00 1:58:49 AM

Share this post


Link to post
Share on other sites
Advertisement
Yeah, this is possible and not that hard to do also. But who wants to? I mean, I don''t think Warcrafts calls to directX are very interesting.

It would be a lot of work too, implementing lots and lots of functions you won''t need. Ofcourse you stub them, but still you have to type lots of useless stuff

Anyway, if you want to do it, you don''t even have to replace the DLL. Just write your own DLL''s with the same interface support and register your COMponents in the windows registry under the correct GUIDs. Then all will be done.

How about an Direct3Dim implementation using OpenGL?
HAHA

Jaap Suter

Share this post


Link to post
Share on other sites
Any game using your stubs, will probably not get very far. It won''t get past the very first line of DirectX setup!
You will log one call every time.

Unless of course, you pass the parameters on to the real (renamed?) DLL...

Share this post


Link to post
Share on other sites
I think that there is a point in doing it, and I think it is a good idea. If your trying to learn how a game works it could be helpful too. It wight also be good for optimizing (you could look for slowdown in a game, and compare the calls in the .dlls. To do this, you simply create your dll with every funtion, put a brief bit of code to log the call, and then call the function in the regular .dll. (This will definately be slower though) You could also debug with it.

What is a man without goals? A dead man.

Share this post


Link to post
Share on other sites
Ummmm... Warcraft II runs under DOS...

- DarkMage139
"Real game developers don't change the rules. Real game developers don't break the rules. Real game developers make the rules!"
"Originality (in games) is the spice of life!"

Share this post


Link to post
Share on other sites
Just seeing the calls to DirectX is not going to show you anything about the game, other than in what order they blit things.

Even then, you''re only going to get a big list of pointers, not the actual graphical data.

Besides, what are you going to do when they try to check the result of their blit? Are you going to write the engine that supplies the proper return values for every single call they make?

My guess is that you''re looking at 100k-200k lines of code. You might as well go hit the books and learn the stuff yourself.

Share this post


Link to post
Share on other sites
I'm just using Warcraft as an example to my post. Any DirectX game
will do.

(oops that should have been Starcraft as in the DirectX version
running under Windows in my first post. Not Warcraft or Warcraft II.
I'm all mixed up today.)


Buster,

Wrappers can pass the parameters to the real dll (which I can load
myself) and can also return any result from the real dll, unless you're
thinking of something else.

And Pointers POINT to the actual data. What makes you think I can't
use them myself? Shit, I could put in some write-surface-to-bitmap-file
code and grab all the graphics I want.

But really, all I am interested in is seeing how much I can find out
about some game. I could look at a printout of rect coords. to
determine if they use some kind of dirty rectangle scheme, or maybe
see the actual screen coords. where they blt their data onto the
screen, etc..

Wayfarer

Edited by - Wayfarer on May 19, 2000 3:00:42 AM

Share this post


Link to post
Share on other sites
Sounds kind of interesting... and there is the Battle.net edition of Warcraft...

if you can reroute requests to the real dll, then all you need is a bunch of stubs that call some generic logging function and then "return call_to_real_dll_function();"

I think most of the interesting stuff in 2d games is in custom ASM though. Just rerouting ddraw.dll calls might not be that imformative... but interesting never the less.

keep in mind, you''re dealing with COM... who knows which interface these older games are requesting... the version of DX it requires could affect what functions you need to catch.

- n8



nathany.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hmm. The last time I checked there was both a DOS and Windows version of Warcraft II. The Windows version is called "Warcraft II Batte.net Edition." It does indeed use DirectDraw (I would know, because DirectDraw runs a lot smoother on my system than VESA).

But I am intrigued by the idea of your directdraw replacement. It would be easier to understand than decompiled sourcecode (but you couldn''t see the underlying math or anything). I''m not sure on the legality of it. Does Microsoft have patents on their DirectX technology? If so you might catch hell (not that it really matters, especially if you don''t plan to make money on it). Then again all attempts to sue the programmer of a wrapper or an emulator (written from scratch, of course) have basically failed.

Of course, feel free to disagree with me on anything. I really don''t know what I''m talking about.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!