Small Tool - Debug Window

Results 1 to 14 of 14
  1. #1
    Member anh7codon is offline
    MemberRank
    Mar 2012 Join Date
    42Posts

    Small Tool - Debug Window


    RaGEZONE Recommends

    RaGEZONE Recommends

    Hi there
    This a really small tool to display debug text from client and server
    Hope this could help your debuging progress

    Visual 2013 Solution, just build it yourself
    DebugWindow.rar

    Just a small script that handle message sent from masang
    g_dbgOutwindowClassName and g_dbgOut was defined on selection build
    Last edited by anh7codon; 30-08-16 at 04:04 AM.


  2. #2
    Retired (Goddamn idiots) DragonLord is offline
    True MemberRank
    Dec 2003 Join Date
    /dev/urandomLocation
    553Posts

    Re: Small Tool - Debug Window

    Insanity - Doing the same thing over and over again, expecting different results - Albert Einstein


    R.I.P. Akaruz - We miss ya buddy

  3. #3
    Small Tool - Debug Window St34lth4ng3l is offline
    True MemberRank
    Apr 2013 Join Date
    __FILE__Location
    820Posts

    Re: Small Tool - Debug Window

    Quote Originally Posted by DragonLord View Post
    Well, this would work with normal DbgOut messages, as written in the article.
    But as you may know masang uses their "own" debug output method:

    Code:
    inline void DbgOutA (LPCSTR p){
        COPYDATASTRUCT cd; 
        HWND hWnd = ::FindWindow (g_dbgOutwindowClassName, g_dbgOut); 
        if (hWnd)
        {  
            cd.dwData = 0;
            cd.cbData = (strlen(p)+1)*sizeof(char);
            cd.lpData = (void *)p; 
            ::SendMessage (hWnd, WM_COPYDATA, 0, (LPARAM)&cd);  
        } 
    }
    It's sending messages to a window with the name: Client DebugOutput 20020805 and registered Windowclass: Client DebugOut Window

    My problem now is: i can't download ther attachement, so i can't see if this release is useless or not :D

  4. #4
    Member anh7codon is offline
    MemberRank
    Mar 2012 Join Date
    42Posts

    Re: Small Tool - Debug Window

    Sorry, because I don't know how to use the program from microsoft

    Just a small script that handle message send from masang
    Masang send message to a window with specific Class name and Title name.

    I'll learn how to config the debugview from Microsoft, but I'm not sure it has a option to change the window and title name

  5. #5
    struct { int:-!!(1); } Aesir is offline
    SubscriberRank
    May 2015 Join Date
    MadnessLocation
    262Posts

    Re: Small Tool - Debug Window

    It's funny how actually somebody still have to put some efforts for make such things working...



  6. #6
    Member anh7codon is offline
    MemberRank
    Mar 2012 Join Date
    42Posts

    Re: Small Tool - Debug Window

    Haha, dont rage bro.
    if it's not help your case, just GTFO.
    Ton of people out there even don't know how to compile the source code. It's just a little tool can help them.
    I just review some of your posts and I can not find any helpful reply, just rage and scold.
    Try to gentle and helpful bro.

  7. #7
    struct { int:-!!(1); } Aesir is offline
    SubscriberRank
    May 2015 Join Date
    MadnessLocation
    262Posts

    Re: Small Tool - Debug Window

    Quote Originally Posted by anh7codon View Post
    Haha, dont rage bro.
    Nobody is raging, i'm always chilled.

    Quote Originally Posted by anh7codon View Post
    Ton of people out there even don't know how to compile the source code.
    This is the main reason for them to stop dealing with it.

    Quote Originally Posted by anh7codon View Post
    I just review some of your posts and I can not find any helpful reply, just rage and scold.
    Gonna cry in a corner then (still, i'm not raging).

    Quote Originally Posted by anh7codon View Post
    Try to gentle and helpful bro.
    I help a lot of people usually, just you don't see it because all the leechers and server bitches here aren't my help target.

    Have a good day.



  8. #8
    Account Upgraded | Title Enabled! inetpub is offline
    True MemberRank
    Oct 2012 Join Date
    204Posts

    Re: Small Tool - Debug Window

    OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!

    Anyway you did smth yourself so its ok that you're able to use your brain.
    Cheers

  9. #9
    Retired (Goddamn idiots) DragonLord is offline
    True MemberRank
    Dec 2003 Join Date
    /dev/urandomLocation
    553Posts

    Re: Small Tool - Debug Window

    Quote Originally Posted by inetpub View Post
    OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!
    That is an absolutely stupid question.
    Logging purposes, to say the least, let alone timestamping and not having to deal with some cheap hack-y method.

    A better idea would be to use OutputDebugString(), but that is beyond the scope of this thread.
    Insanity - Doing the same thing over and over again, expecting different results - Albert Einstein


    R.I.P. Akaruz - We miss ya buddy

  10. #10
    struct { int:-!!(1); } Aesir is offline
    SubscriberRank
    May 2015 Join Date
    MadnessLocation
    262Posts

    Re: Small Tool - Debug Window

    Quote Originally Posted by inetpub View Post
    OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!

    Anyway you did smth yourself so its ok that you're able to use your brain.
    Cheers
    You can trash the console if your client crashes at boot.

    Quote Originally Posted by DragonLord View Post
    That is an absolutely stupid question.
    Logging purposes, to say the least, let alone timestamping and not having to deal with some cheap hack-y method.

    A better idea would be to use OutputDebugString(), but that is beyond the scope of this thread.
    I think that are more my hand's fingers than the guys which knows what this function does.
    Last edited by Aesir; 31-08-16 at 12:07 PM.



  11. #11
    Small Tool - Debug Window Future is offline
    SupervisorRank
    Dec 2011 Join Date
    1,906Posts

    Re: Small Tool - Debug Window

    About one and a half year ago (before I kindly got the tip from Dragon to use Sysinternals) I wrote a similar tool in MFC... Sadly I can't find the full code for this right now but I found the C++ part of it that took care of handling the strings output by the DbgOut underlying function:

    Code:
    // Window Proc override
    LRESULT CClientDebugOutDlg::WindowProc(UINT msg, WPARAM wParam, LPARAM lParam)
    {
    	switch (msg)
    	{
    		case WM_COPYDATA:
    		{
    			// Dispatch client Message
    			COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)lParam;
    			if (pcds->dwData == 0)
    			{
    				// convert 8-byte char to 16-byte wchar_t
    				LPCSTR msg = (LPCSTR)pcds->lpData;
    				LPCWSTR w_msg = CA2W(msg);
    				handleClientDbgMessage(w_msg);
    			}
    			else if (pcds->dwData == 0xFEFF)
    			{
    				// 16-byte char
    				LPCWSTR msg = (LPCWSTR)pcds->lpData;
    				handleClientDbgMessage(msg);
    			}
    		}
    		break;
    	}
    
    	// Default Return
    	return CDialogEx::WindowProc(msg, wParam, lParam);
    }
    
    void CClientDebugOutDlg::handleClientDbgMessage(std::wstring message /*alternatively: const wchar_t* message*/)
    {
    	// Handle the message here
    }
    Be aware that this code was used within a Unicode MFC environment. You can copy paste this into any MFC Unicode project by overriding this WndProc handler in your Dialog class.

    You can easily make a standalone version of that using MultiByteToWideChar() WINAPI function and implement the case switch into your custom WndProc. If you're using MBSC instead of Unicode you'd need WideCharToMultiByte() for the other case.

    If you prefer C# you could also do this via unmanged code.

    Might help someone to make tools...

    Edit:
    And ofc the window handle must be created with the wnd class "Client DebugOut Window" and the wnd caption "Client DebugOutput 20020805"


    Quote Originally Posted by A Wise Man
    P-Servers are NOT dead. Bugs need squishing. Quests need fixing. Unfortunately, majority of people don't know the difference between a computer and a toaster so...

  12. #12
    struct { int:-!!(1); } Aesir is offline
    SubscriberRank
    May 2015 Join Date
    MadnessLocation
    262Posts

    Re: Small Tool - Debug Window

    Or i can release official masang ones, but all the leechers here are too far away from deserve that.



  13. #13
    Small Tool - Debug Window Future is offline
    SupervisorRank
    Dec 2011 Join Date
    1,906Posts

    Re: Small Tool - Debug Window

    Quote Originally Posted by Aesir View Post
    Or i can release official masang ones, but all the leechers here are too far away from deserve that.
    By the level of "tools" released by masang I am kinda confident that everyone here would deserve them... You can't get much lower than masang level.


    Quote Originally Posted by A Wise Man
    P-Servers are NOT dead. Bugs need squishing. Quests need fixing. Unfortunately, majority of people don't know the difference between a computer and a toaster so...

  14. #14
    struct { int:-!!(1); } Aesir is offline
    SubscriberRank
    May 2015 Join Date
    MadnessLocation
    262Posts

    Re: Small Tool - Debug Window

    Quote Originally Posted by Future View Post
    By the level of "tools" released by masang I am kinda confident that everyone here would deserve them... You can't get much lower than masang level.
    Then i guess this week i will release them ;)






Advertisement