Windows 8/10 Client Support Fix

Page 1 of 5 12345 LastLast
Results 1 to 15 of 72
  1. #1
    Moderator Eric is online now
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Windows 8/10 Client Support Fix

    After a few hours of debugging, some research, and digging heavily all throughout the client, I've managed to not only figure out (at least for myself) the causes behind the infamous "The parameter is incorrect" error seen on modern operating systems, but also how to effectively fix the issue for any and all client versions that the error occurs on (up to v13x~v14x iirc).

    Before I get started, I'd like to point out and note a few things. First, the issue and exception along with where it's located. So by now we all know it by "Parameter is incorrect", but the actual error code number is -2147024809. Let's take a look at the game application's initialization of DirectInput8.

    Code:
    v9 = DirectInput8Create(v8, 2048, "0€y¿:H¢Mª™]dí6—", v3 + 4, 0);
    if ( v9 < 0 )
    	_com_raise_error(v9, 0);
    Now let me fix it up for you:
    Code:
    hr = DirectInput8Create(hModule, 2048, &_IID_IDirectInput8A, &this->m_pDI, NULL);
    if ( hr < 0 )
    	_com_raise_error(hr, 0);
    All we see here is the client creating the m_pDI IDirectInput interface with a 2048 (2GB) minimum RAM requirement of the application. At first hand you'd think all is well until you actually debug and breakpoint this area. Well, with that in mind, we can remember that error code. We know it's -2147024809 which actually converts to 80070057 (base16/hexadecimal). With that said, knowing the client is going to use hexadecimal values and this one is likely to be pretty unique, we could always search the client for this exact AoB. We'll only find a limited amount of results (like we had hoped), however none of these actually throw the exception or come close to it when we trace and breakpoint the source of the issue. This leaves us right back where we started, with something wrong in CInputSystem::Init, specifically from DirectInput8Create.

    Well, what is DirectInput8 returning at "v9"? It's actually returning a HANDLE Result, and a commonly known HRESULT is in fact 0x80070057, or E_INVALIDARG. This means that the error involved actually has absolutely nothing to do with the physical application itself, as it is an external library call that returns an E_INVALIDARG result. Since the result is clearly < 0, it'll call to com_raise_error to trigger a CxxThrowException which will generate the StringPool that prints both the name and error code in the MapleStory OK window as it crashes. Now that we have some little information on the error, we know that the message and problem we're having is not specific to MapleStory like some of our other error codes.

    Next, the problem and the workarounds available. Well by now we know the issue is specific to DirectX, and by some quick searching of the error 80070057 we'll find that the issue is actually seen throughout many other games and applications. Keeping in mind that the issue only occurs on Windows 8 and above, we know it's some newer platform affecting it. It turns out that around August 2012, Microsoft had officially deprecated the external calls to all of the DirectX 9 functions that the client utilizes, and upon doing so killed the compatibility on a lot of these older game clients that use them. At the same time, all new modern operating systems (since the start of the official release of Windows 8) had started using DirectX 11.1 and above. Well, the issue that had been brought up a few times was that it's just a multi-threading problem, and running it a few more times would generally fix whatever problem people were having. This is where the use of the current workaround released is involved. What we did to simply ignore and throw away the error ever occurring was simply call a code-caved function to cause the thread to sleep for two seconds, and jump back. Upon doing so, we assemble over the conditional call to the DirectInput's COM error exception. This means that we'll indeed get rid of the parameter is incorrect error, but doesn't mean that we took care of the issue.

    So I tested out the client with just simply sleeping and jumping back, removing the COM error exceptions. It seems to work most of the time, but very commonly the client will continue to fault and terminate. However, since we have removed the COM error exceptions, we don't see any "parameter is incorrect" anymore; the client process just ends and you have to re-run the game. It's because of this that I needed to look more into this myself so that I could find a fix that would for sure make the client no longer have issues executing the external calls. Since I knew the cause was coming from DirectInput8Create, I traced the function to it's import at dinput8.dll which was the first thing I thought of. I already had olly open so all I needed to confirm was where the module for dinput8.dll was located, and since it was in system32 I knew that definitely had to be the issue. So using the File Versions to compare the two, we'll notice that all of us Windows 7 users where the game runs just fine use DirectX 6.01.7600.16385. From there, I compared that to the other OS's, where people on 8 had 6.02.9200.16384 and people on 10 had 10.00.10240.16384.

    To confirm if this were the source of the problem, I made a backup of my current build of DirectX and replaced it in system32 with the working version of 6.01.7600.16385. After executing a clean barebones client with no checks that would constantly parameter me, it worked flawlessly. However, we clearly don't want to be replacing system32 files in order to play the game! After restoring my original dinput8.dll and trying the same client again after success, it began to parameter error me again and again. So, I confirmed that dinput8.dll was the issue and by using an older build of DirectX with non-deprecated calls the client would launch just fine on any OS.

    How can we implement or fix it then? Very simple actually. The same dinput8.dll that we replaced in our system32 to confirm if it worked or not, we'll just place it inside of our MapleStory folder. This way, when we execute the client, it'll use the one in the current directory and ignore the one in system32 upon runtime. Sure, this is indeed the fix for it all, BUT Nexon hates making life easy for us! If all you do is paste in the dinput8.dll file into your MapleStory folder, you'll get a korean (if you're on the codepage) error like this:

    In translation, this just means that the client has detected a "hack program" on the directory. Yep, Nexon has hard-coded checks in the client for the list of modules they use, and if they find any of those files within your directory the client will display a MessageBox with this error.

    Alright, so down to the fix. First, you might as well download dinput8.dll to place into your MapleStory folder. You can download it here. Next, we're going to need to do some client editing. One thing I can say is that the client modification done here is extremely simple and anyone can do it.

    Finding the function is easy but I'll provide addys for the common versions anyways.

    Code:
    v62 -> 00672F10 (JE to JMP)
    v75 -> 006DF82D (JE to JMP)
    v83 -> 00796357 (JE to JMP)
    v111 -> 0085EC08 (JMP 0085EE88)
    How to find it? Using IDA, open the Strings window and sort it by String. Go to the very bottom and you'll find the following string:


    Double-click on it to go to the dword value in IDA-View:


    Notice on the right there's a DATA XREF that says ZAPILoader? For you it'll be sub_XXXXXX, but double-click on it. It'll lead you to the ZAPILoader function with the checks. I would've included v117, but the sub is virtualized so you won't have any XREF's available to find it. If you want it anyways, the address of the function in v117 is 0089ECA0. You'll have to debug and find the address to jump yourself for that one :P

    aaand that's it! Simply put, we add the working non-deprecated dinput8.dll into our MapleStory folder and bypass the client checks that prevent it.

    Enjoy!

    - Eric
    Last edited by Eric; 17-02-17 at 06:12 AM.


  2. #2
    Account Upgraded | Title Enabled! Halcyon is online now
    MemberRank
    Mar 2011 Join Date
    1,102Posts

    Re: Windows 8/10 Client Support Fix

    Damn fine read.

  3. #3
    Valued Member Diverge is offline
    MemberRank
    Aug 2011 Join Date
    132Posts

    Re: Windows 8/10 Client Support Fix

    I really enjoy reading about the journey you take to arrive at your solutions lol.
    I suspected it might be something like this, but I didn't care enough to go as deep as you did. :')
    Thank you for the documentation and fix. ^_^

  4. #4
    Master of lurking Kimberly is offline
    ModeratorRank
    Jul 2012 Join Date
    The NetherlandsLocation
    1,092Posts

    Re: Windows 8/10 Client Support Fix

    I am still curious but how come in v0.62 the error doesn't occur in Windows 98/me compatibility mode? What exactly is different over the other ones (where it still happens) compared to 98/me? Also how come this only works on v0.62 where in v0.75+ it still happens (Parameter is Incorrect) even in 98/me mode?

    Probably no answer on that but things like that make me always curious =P

    Great job once again. Solutions like this is what keeps this game (Private Server scene) alive, seeing Microsoft is not willing to fix it.

  5. #5
    Valued Member Quack is offline
    MemberRank
    Sep 2015 Join Date
    133Posts

    Re: Windows 8/10 Client Support Fix

    If someone who knows how to use client editing and may release common versions clients with this release it will be highly appreciated.

    Good job as always, Eric. You excel in everything. :P

  6. #6
    Enthusiast Chriss is offline
    MemberRank
    Aug 2016 Join Date
    AmcLocation
    32Posts

    Re: Windows 8/10 Client Support Fix

    Good Job, Eric :) Immediately i have tried v111 with win10.
    Unfortunately. it keeps throws 0xC0000005 error rather than the invalid parameter error and does not get in game at all.
    And the dinput8.dll you attached is 64bit ,MapleStory will not actually load it Would you show me a way how to fix it? @Eric

  7. #7
    Moderator Eric is online now
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Re: Windows 8/10 Client Support Fix

    Quote Originally Posted by Kimberly View Post
    I am still curious but how come in v0.62 the error doesn't occur in Windows 98/me compatibility mode? What exactly is different over the other ones (where it still happens) compared to 98/me? Also how come this only works on v0.62 where in v0.75+ it still happens (Parameter is Incorrect) even in 98/me mode?

    Probably no answer on that but things like that make me always curious =P

    Great job once again. Solutions like this is what keeps this game (Private Server scene) alive, seeing Microsoft is not willing to fix it.
    Good question. I've been wondering this myself and if it has some client checks for something with privileges or compatibility. I haven't seen anything major changed in v62 versus 75+ when it comes to any actual functions, so it may be something hidden that I'm not directly finding..

    Quote Originally Posted by Chriss View Post
    Good Job, Eric :) Immediately i have tried v111 with win10.
    Unfortunately. it keeps throws 0xC0000005 error rather than the invalid parameter error and does not get in game at all.
    And the dinput8.dll you attached is 64bit ,MapleStory will not actually load it Would you show me a way how to fix it? @Eric
    Not sure because after v100+ the game client's API loader functions had changes. All clients up until then follow the same code and instructions that needed to be modified, but when I checked v111 it didn't. The error thrown has to be because of when/where I jumped though. You can trial and error it, but I have no v111 besides an IDB so I have nothing to test/confirm for that version :P. Indeed it is, but if you'd like the 32bit version of the DLL, I have that one uploaded on my MEGA too. You can download it here.

  8. #8
    Account Upgraded | Title Enabled! PrinceReborn is offline
    MemberRank
    Jul 2008 Join Date
    United KingdomLocation
    261Posts

    Re: Windows 8/10 Client Support Fix

    This is really interesting, thank you for spending time researching the issue. Unfortunately the fix doesn't seem to be working for me with a v0.83 client.

    Adding the .dll into the MapleStory folder does cause for the Korean error message to appear, and editing the client in Ollydbg at the location mentioned makes the error message go away... However the client still produces 'The Parameter Is Incorrect' error. I've tried both x64 and x86 versions of the .dll file.

    I've also tried starting the client with SimpleProgramDebugger attached to make sure it is loading the dinput8.dll file from the MapleStory folder - which it is. Including the times when the client throws 'The Parameter Is Incorrect' error.

  9. #9
    Moderator Eric is online now
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Re: Windows 8/10 Client Support Fix

    Quote Originally Posted by PrinceReborn View Post
    This is really interesting, thank you for spending time researching the issue. Unfortunately the fix doesn't seem to be working for me with a v0.83 client.

    Adding the .dll into the MapleStory folder does cause for the Korean error message to appear, and editing the client in Ollydbg at the location mentioned makes the error message go away... However the client still produces 'The Parameter Is Incorrect' error. I've tried both x64 and x86 versions of the .dll file.

    I've also tried starting the client with SimpleProgramDebugger attached to make sure it is loading the dinput8.dll file from the MapleStory folder - which it is. Including the times when the client throws 'The Parameter Is Incorrect' error.
    Hmm weird.. I have yet to get this error. What OS are you using, and is it x86 or x64? What localhost are you using, and did you do any other changes to it? I'll see if I can trace or replicate the error on whatever localhost you're using so that I can figure it out and fix it.

  10. #10
    Account Upgraded | Title Enabled! PrinceReborn is offline
    MemberRank
    Jul 2008 Join Date
    United KingdomLocation
    261Posts

    Re: Windows 8/10 Client Support Fix

    Quote Originally Posted by Eric View Post
    Hmm weird.. I have yet to get this error. What OS are you using, and is it x86 or x64? What localhost are you using, and did you do any other changes to it? I'll see if I can trace or replicate the error on whatever localhost you're using so that I can figure it out and fix it.
    I'm using Windows 10 Home x64 (Build 14393), and I've also tried it on Windows 8.1 x64. I am attempting this fix with the clean v0.83 localhost from http://forum.ragezone.com/f425/maple...eborn-1101897/ with the .dll linked in this thread. I've tried both the x86 and x64 versions of the .dll, and have tried even older versions of the .dll with no success thus far. Would be great if you don't mind having a look into it, as this issue is the bane of v0.83 servers right now for modern OS's, and any help is greatly appreciated.

  11. #11
    Account Upgraded | Title Enabled! br1337 is offline
    MemberRank
    Apr 2015 Join Date
    295Posts

    Re: Windows 8/10 Client Support Fix

    Quote Originally Posted by PrinceReborn View Post
    I'm using Windows 10 Home x64 (Build 14393), and I've also tried it on Windows 8.1 x64. I am attempting this fix with the clean v0.83 localhost from http://forum.ragezone.com/f425/maple...eborn-1101897/ with the .dll linked in this thread. I've tried both the x86 and x64 versions of the .dll, and have tried even older versions of the .dll with no success thus far. Would be great if you don't mind having a look into it, as this issue is the bane of v0.83 servers right now for modern OS's, and any help is greatly appreciated.
    Did you try to hook the call to DirectInput8Create and add a Sleep Windows API call of some seconds before calling it?

    It solved the problem on my v90 localhost and also v83.

  12. #12
    Valued Member Umbreon is offline
    MemberRank
    Apr 2012 Join Date
    100Posts

    Re: Windows 8/10 Client Support Fix

    Quote Originally Posted by br1337 View Post
    Did you try to hook the call to DirectInput8Create and add a Sleep Windows API call of some seconds before calling it?

    It solved the problem on my v90 localhost and also v83.
    I've also tried Eric's proposed fix on a "clean" v83 client and it didn't work; from my understanding the sleep call is a workaround, not a fix (albeit an effective one). I could do some troubleshooting if anyone else has had success.

  13. #13
    Moderator Eric is online now
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Re: Windows 8/10 Client Support Fix

    Quote Originally Posted by PrinceReborn View Post
    I'm using Windows 10 Home x64 (Build 14393), and I've also tried it on Windows 8.1 x64. I am attempting this fix with the clean v0.83 localhost from http://forum.ragezone.com/f425/maple...eborn-1101897/ with the .dll linked in this thread. I've tried both the x86 and x64 versions of the .dll, and have tried even older versions of the .dll with no success thus far. Would be great if you don't mind having a look into it, as this issue is the bane of v0.83 servers right now for modern OS's, and any help is greatly appreciated.
    Alright, may I ask how often you get the parameter error thrown? Is it every time? I used the same client and tried to achieve the parameter error, yet I never get it.

    However, I think I might possibly know why it's occurring. By preference (and an easier way for me to debug), I modify DirectX's flags so that I can initially launch the application in a Window Mode setting. This is the only other modification I've done to the client which is why I believe it is what helps fix it. After thinking about it, @br1337 pointed out the commonly used Sleep delay that will thread sleep the client for about 2 seconds or so. If we think about this, the 2 second duration that we are doing a Sleep on is around the same time it takes for your graphics card to transition your computer's resolution into the 800x600 and ready it before the Gr2D starts drawing and such. Well, because I'm always opening my test client(s) inside of windows mode, the graphics never have to be adjusted before Gr2D creates it's DirectInput. Instead, the application immediatly loads after being executed and uses the new dinput8.dll file for the fixed calls. I'm guessing that because I do that, I guarantee the client to always launch before the calls to DirectInput have been made, and this is why I don't get parameter.

    I didn't think that could actually be the problem, but seeing as a delay between when the client switches your resolution to when it calls a DirectInput8 is where things will often fail, it might be. That'd also be funny if this was why Nexon began always initializing the client in a window mode upon startup, and after the client has initialized the Gr2D user's can then ALT+Enter into Full Screen.

    Aaanyways, you can try and confirm my theory and see if that's actually the cause or not. Assuming you have the dinpu8.dll checks JMP'd in the clean client already, go to address 009F7A9B in your v83 localhost and modify the instruction to MOV EAX, 0. Save those changes and try it out again, see if it works or not.

  14. #14
    Account Upgraded | Title Enabled! PrinceReborn is offline
    MemberRank
    Jul 2008 Join Date
    United KingdomLocation
    261Posts

    Re: Windows 8/10 Client Support Fix

    Quote Originally Posted by Eric View Post
    Alright, may I ask how often you get the parameter error thrown? Is it every time? I used the same client and tried to achieve the parameter error, yet I never get it.

    However, I think I might possibly know why it's occurring. By preference (and an easier way for me to debug), I modify DirectX's flags so that I can initially launch the application in a Window Mode setting. This is the only other modification I've done to the client which is why I believe it is what helps fix it. After thinking about it, @br1337 pointed out the commonly used Sleep delay that will thread sleep the client for about 2 seconds or so. If we think about this, the 2 second duration that we are doing a Sleep on is around the same time it takes for your graphics card to transition your computer's resolution into the 800x600 and ready it before the Gr2D starts drawing and such. Well, because I'm always opening my test client(s) inside of windows mode, the graphics never have to be adjusted before Gr2D creates it's DirectInput. Instead, the application immediatly loads after being executed and uses the new dinput8.dll file for the fixed calls. I'm guessing that because I do that, I guarantee the client to always launch before the calls to DirectInput have been made, and this is why I don't get parameter.

    I didn't think that could actually be the problem, but seeing as a delay between when the client switches your resolution to when it calls a DirectInput8 is where things will often fail, it might be. That'd also be funny if this was why Nexon began always initializing the client in a window mode upon startup, and after the client has initialized the Gr2D user's can then ALT+Enter into Full Screen.

    Aaanyways, you can try and confirm my theory and see if that's actually the cause or not. Assuming you have the dinpu8.dll checks JMP'd in the clean client already, go to address 009F7A9B in your v83 localhost and modify the instruction to MOV EAX, 0. Save those changes and try it out again, see if it works or not.
    Thank you both for your replies,

    To answer your questions; The parameter error gets thrown just as many times as before, although admittedly it is hard to compare due to the randomness of the error in the first place. I've been able to open a clean v0.83 client 50 or so times in a row without getting it, but then can go 50 times in a row and get the error every single time, but of course this is quite rare and you would be out of your mind to continue trying to open it after that many attempts without trying something like rebooting your computer. As you probably know, there seems to be correlation between the error and what other applications you have open on your computer. Closing Skype, Steam and Chrome can often cause the error to go away. However I would say on average I would get the error about 20% of the time with a clean client, and with the fix provided, I would say I have still been getting the error about the same percentage of the time.

    I have now tried your and @br1337's suggestion and changed 009F7A9B to MOV EAX,0 within the client, and unfortunately I still get the parameter error. Again this has been tried on both Windows 10 x64 and Windows 8.1 x64.

    I have uploaded the client and .dll that I have been using if you wish to investigate further:

    v0.83 clean client with dinput.dll JMP & windowed mode hack: https://mega.nz/#!O0hiTbyL!Dm9WsRTOJ...Ndo-wNxqYPemdQ
    dinput.dll: https://mega.nz/#!6xBg2bgS!4UFijkeia...ky2AB_OmFS_5Dw

  15. #15
    Account Upgraded | Title Enabled! br1337 is offline
    MemberRank
    Apr 2015 Join Date
    295Posts

    Re: Windows 8/10 Client Support Fix

    Quote Originally Posted by PrinceReborn View Post
    Thank you both for your replies,

    To answer your questions; The parameter error gets thrown just as many times as before, although admittedly it is hard to compare due to the randomness of the error in the first place. I've been able to open a clean v0.83 client 50 or so times in a row without getting it, but then can go 50 times in a row and get the error every single time, but of course this is quite rare and you would be out of your mind to continue trying to open it after that many attempts without trying something like rebooting your computer. As you probably know, there seems to be correlation between the error and what other applications you have open on your computer. Closing Skype, Steam and Chrome can often cause the error to go away. However I would say on average I would get the error about 20% of the time with a clean client, and with the fix provided, I would say I have still been getting the error about the same percentage of the time.

    I have now tried your and @br1337's suggestion and changed 009F7A9B to MOV EAX,0 within the client, and unfortunately I still get the parameter error. Again this has been tried on both Windows 10 x64 and Windows 8.1 x64.

    I have uploaded the client and .dll that I have been using if you wish to investigate further:

    v0.83 clean client with dinput.dll JMP & windowed mode hack: https://mega.nz/#!O0hiTbyL!Dm9WsRTOJ...Ndo-wNxqYPemdQ
    dinput.dll: https://mega.nz/#!6xBg2bgS!4UFijkeia...ky2AB_OmFS_5Dw
    Mind sharing this windowed mode hack?

    When I arrive in home I will try to check what exactly I've done to fix the problem in v83.



Page 1 of 5 12345 LastLast

Advertisement