🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Untitled

posted in DruinkJournal
Published April 07, 2009
Advertisement
My girlfriend and I made sushi (Maki) at the weekend. It went surprisingly well, considering neither of us have made sushi before. We did however make too much rice (3 cup fulls), and put the rice down too thickly, and we made far too much overall, but it was awesome.
We made salmon, tuna, spicy salmon, spicy tuna (Spice being chili paste and wasabi), and ginger.

PICTARZ (Click to enlarge):
All of it
A close up

In other news; I tried to get Tiberian Sun to work over a LAN last night, so I can play multiplayer games. I was trying to network the retro PC (Windows 98 SE), and my laptop (Vista Home Premium). That doesn't go so well.
The problem is that Tiberian Sun uses the IPX/SPX protocol for networking. That's fine on Windows 98 and even on XP, since you can install the IPX protocol. However, there's no IPX protocol available on Vista (And I don't blame anyone for it - it's an ancient and mostly unused protocol). There's a "fix" where you copy the IPX/SPX driver files from a XP machine to Vista, and then install them from there, but that doesn't actually work - there's hundreds of copies of this same post on the Internet, and it turns out that all it does is makes IPX/SPX show up in the network protocols list, it doesn't actually work (As verified with a quick test app, WinSock says the protocol isn't available).
One of the suggested solutions online is to use Hamachi to tunnel IPX/SPX through TCP/IP, which I'm sure works great on Vista - but Hamachi doesn't work on Win9x because it needs a virtual network connection that isn't available on Win9x.
The only solution I did manage to find was someone who made a new wsock32.dll file which proxies all IPX calls through UDP. That would be perfect, except this also doesn't work on Windows 98 - I get "This module requires a newer version of Windows". I spent half an hour messing around with editbin and dumpbin from the platform SDK, trying to change the OS version required in the PE header, but that didn't work. I got a little further, the dialog box didn't pop up, but the game hung at startup. Which isn't surprising really.

I fired up my disassembler and looked at the proxy DLL, and it seems extremely simple; a few hundred lines of assembly in total, and about 10 functions (Bizarrely that includes ntohl, ntohs, htonl and htons for some reason), the rest are forwarding to ws2_32.dll in the exports table (Something I didn't know you could do until now - see below).
So, I'm writing my own version of this proxy DLL. So far I've got the forwarding working for the functions I don't care about; if I proxy all of the functions, then I can place the DLL in Firefox's directory and it all works fine. I've also got the WSAStartup() hook coded, which loads the real wsock32.dll file and gets the address of the real functions, and I've got stubs for the functions I need to forward, and some debug logging (Logging to OutputDebugString and a file). That also works when I chuck the DLL in with Firefox.

So, this is an unfortunate little distraction, but I should be done by tonight. And in theory this could be used with any IPX/SPX game out there, and I could also expand it to hook other traffic for... "reasons" >_>.


As I mentioned, the forwarding is something I didn't know you could do. In the DLL exports table, instead of having the address of the function to call, there's the name of a DLL and function to proxy to. If you open up wsock32.dll in Dependency Walker, you'll see a lot of the exports are shims to ws2_32.FunctionName. You can do that with a module definition file like so:
EXPORTS   accept = ws2_32.accept @ 1   bind = ws2_32.bind @ 2; Etc

There's two minor annoyances here:
1. The ordinal numbers are needed since ws2_32.lib seems to link by ordinal rather than name (At least when I removed the ordinals, Firefox said "The function with ordinal 151 could not be found in the module WSOCK32.DLL").
2. For some odd reason, you still need to provide an implementation for the functions that you're forwarding, even though they'll never actually be called. That involves a lot of annoying copy and paste work from winsock2.h. That might be so the .lib file can be generated, I don't really know.

So I hope to get the functions I need to patch patched on the bus on the way home, and then I just need to spend this evening getting my DLL to work on Windows 98 (If anyone has any tips beyond _WINNT_VERSION or whatever the preprocessor token is called, please let me know - I'm using Visual Studio 2008 Professional).
Previous Entry Untitled
Next Entry Untitled
0 likes 1 comments

Comments

andwan0
Firefox? The web browser??
August 14, 2009 04:24 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement