pichorra Posted January 23, 2012 Share Posted January 23, 2012 If you change: [HKEY_LOCAL_MACHINE\Software\Westwood\Wchat\] "InstallPath"= to any other directory\filename, This can make C&C95 launch an external application trough the Internet button. So, i've done a script in C to kill C&C95.exe, and launch cncnet.exe after it. It is dirty, i know but then i made some more research in C&C95.EXE: in 00455A15, we get the Main menu switch. somewhere in 00455BEC, we get the Network button. Due my still poor skills, i'm not able to do it, but i'm sure that there's a way to link the Internet Button to the lan lobby. and more, if it needs to launch an external executable to hook into something, there is some code near of it. i'm not sure about the andresses, since i've put a lot of Breakpoints in it. Hope this is usefull to something. Link to comment Share on other sites More sharing options...
Nyerguds Posted January 25, 2012 Share Posted January 25, 2012 Changing where the menu choices go isn't hard... I've juggled those things around before. It's basically a matter of manipulating the values you get after the main menu function has been run. See, all menu functions in C&C run from the moment you see the menu, to the moment you select a menu choice. So unlike in most modern UIs, there is no "button handling code" that executes the next step. At the moment any choice is made, the function ends and returns the number associated with the chosen item. The code that called the menu function handles the next steps. For this specific case, you can just change the extra code I made to check the -LAN parameter thingy. Basically, instead of normally calling the game's main menu, v1.06 calls a new function which checks the -LAN thing, and only calls the actual main menu function if -LAN is not enabled. This, of course, makes it easy to also add extra checks after the main menu function Here's the code, with the added bit that changes Case #4 (internet) into Case #3 (multiplayer), and enables the -LAN status so the 'Multiplayer' choice menu screen is skipped too, moving straight on to Network: #eip=005C4600 ; mainmenu_choice cmp byte [00640012], 0 ; bStartupLAN jz .not_lan mov eax, 3 ; main menu case for Multiplayer Game jmp .end not_lan: call 004706F0 ; UIClass_MainMenu_Draw ; show main menu ; code to change Internet choice to Network cmp eax, 4 ; main menu case for Internet Game jnz .end dec eax ; decrease to 3 (Multiplayer) mov byte [00640012], 1 ; enable bStartupLAN to make Multiplayer skip to Network end: retn Practically: At address 10DC00, change the bytes to 80 3D 12 00 64 00 00 74 07 B8 03 00 00 00 EB 12 E8 DB C0 EA FF 83 F8 04 75 08 48 C6 05 12 00 64 00 01 C3 I'm not sure if it's useful to make this a permanent change in the game, though... btw, note that to prevent getting stuck in the Network menu, the -LAN status is immediately disabled when the actual Network UI is called. In fact, this code is 40 bytes under the start of the function I showed here Link to comment Share on other sites More sharing options...
pichorra Posted January 25, 2012 Author Share Posted January 25, 2012 I've already succeded in that. Just forgot to posting it. 00045e22 E9 53 05 00 00. Just a Jumper, nothing more than that. I've talked with Hyper yesterday, and he told me that if there is space left, there is a way to launch another DLL instead of Thipx32.dll (in this case, a cncnet.dll). There IS space left for coding if we remove the Westwood's chat launching, so we can probably use it for cncnet. I dunno if it will break WWchat support of C&C95. We still can use it if we launch C&C95, minimize it and launch WWChat after it. When the DDE is send, C&C95 will enter in Internet Mode. Heya! i'm just getting this thing! Link to comment Share on other sites More sharing options...
Nyerguds Posted January 25, 2012 Share Posted January 25, 2012 I assume you mean 00455E22? You're missing a "5" there. The jump doesn't make sense though...would go to 45637A from there, which is in the middle of an instruction :| Anyway, there is TONS of space left if you start using the expanded section. :3 My basic method, as I showed, is replacing a call to a function with a call to my own function, which then does the original function call and any extra steps I want to do before or after it. I prefer actually using the game's own flow and logic over using dirty jump hacks though. It keeps the whole thing cleaner and less confusing to look at. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now