Setting a detour at MClientSocket::Connect incorrectly ?

Results 1 to 3 of 3
  1. #1
    Browser. Nova is offline
    MemberRank
    Nov 2008 Join Date
    --Location
    400Posts

    Setting a detour at MClientSocket::Connect incorrectly ?

    So I decided to boot up Visual Studio tonight and look at some old stuff, and then remembered thsis cool thing Wizkid did, getting the GunZ socket from MClientSocket::Connect. So I thought I'd take a look at detouring it.

    Setting up the detour went fine, getting the socket from the routine went fine, but right after clicking Connect, GunZ crashes.

    With nothing inside the detour routine, it still crashes. Even with no parameters. I can only guess it's the datatype I'm associating to the routine ?
    I'm detouring MClientSocket::Connect as a boolean at the moment. Which is what it should be I believe.

    Anywho, here's my mlog.

    Code:
    GUNZ 1,0,0,290 launched. build (Jun 13 2007 10:25:37) 
    Log time (04/10/13 00:50:37)
    NON-Skip XTrapPatch
    CPU ID = GenuineIntel ( family = 262 , model = 7 , stepping = 10 ) @ 2333 MHz
    Display Device = NVIDIA GeForce 8400 GS     ( vendor=10de device=6e4 subsys=0 revision=a1 )
    Display Driver Version = 9.18.0013.0697
    Windows = 6.1 Build 7601 , Service Pack 1 (4192760KB) :  ..
    Load XML from memory : system/locale.xml- SUCCESS
    Country : (INTERNATIONAL), Language : (INTERNATIONAL)
    Load XML from memory : system/gametypecfg.xml 
    Load Config from file : config.xml- SUCCESS
    Load XML from memory : system/system.xml- SUCCESS
    Load XML from memory : system/strings.xml(0x0009) - SUCCESS
    Load XML from memory : system/cserror.xml(0x0009) - SUCCESS
    Load XML from memory : system/messages.xml(0x0009) - SUCCESS
    InitializeNotify ok.
    WFog Enabled Device.
    device created.
    Video memory 1141.000000 
    main : RGetLenzFlare()->Initialize() 
    InitialLoading success.
    interface Initialize success
    ZApplication::OnCreate : begin
    0(Primary Sound Driver): Hardware Mixing Not Supported
    1(Speakers (Realtek High Definition Audio)): Hardware Mixing Not Supported
    [[[getMaxChannel32]]]]
    LoadWave: Error loading file
    
    -------------------> Sound Engine Create : 2.823000 
    
    sound engine create.
    Load XML from memory : System/tips.xml(0x0009)- SUCCESS
    start log bipmap
    end of load bitmaps2
    loading pictures : 1.384000 
    warning : bitmap slot_head.tga not found.
    warning : bitmap slot_head.tga not found.
    warning : bitmap icon_gameroom.tga not found.
    IDLResource Loading Success!!
    IDL resources : 0.206000 
    start InitInterface option
    Number of Display mode : 40
    Number of Display mode : 40
    end of InitInterface option ok
    Init maps : no Current ChannelRule 
    Screen Effect Manager Create : 0.092000 
    Screen effect manager create success.
    Effect manager create success.
    Client create success.
    game interface create success.
    
    -------------------> GameInterface Create : 1.961000 
    
    Load character.xml success,
    
    -------------------> Character Loading : 1.525000 
    
    
    -------------------> WeaponMesh Loading : 0.249000 
    
    Load weapon.xml success. 
    
    -------------------> Worlditem Loading : 0.019000 
    
    Load zitem info success.
    Init effect manager success.
    Init world item manager success.
    Init channel rule manager success.
    Init abuse manager success.
    Init chatting filter. success
    
    -------------------> ETC .. : 0.365000 
    
    BspObject open : begin interface/login/login.rs 
    RBspObject::Open : Open_MaterialList
    RBspObject::Open : Open_LightList
    BspObject open object list : begin
    RBspObject::Open_ObjectList : size 13 
    RBspObject::Open_ObjectList : end
    RBspObject::Open : OpenDescription
    RBspObject::OpenRs : file.Open 
    RBspObject::OpenRs : file.Read(&header) 
    RBspObject::OpenRs : file.Read(&nMaterial) 
    RBspObject::OpenRs : Open_Nodes begin 
    RBspObject::OpenRs : Open_Nodes end 
    RBspObject::Open : OpenRs 
    RBspObject::Open : OpenBsp 
    BspObject load lightmap : file.Read(&header)
    BspObject load lightmap nCount = 1
    BspObject load lightmap 0
    BspObject load lightmap : file.Read(&m_nLightmap) done
    BspObject load lightmap : end 
    RBspObject::Open : done
    Load smoke description mesh.
    main : OnCreate() done
    Crash ( 00:50:59 )
    Build Jun 12 2007 11:36:39
    
    
    [Exception]
    Address	:	0018d4ac
    ExpCode	:	c0000096
    Flags	:	00000000
    #Param	:	00000000
    other	:	00000000
    
    [Context]
    GS : 0000002b  FS : 00000053  ES : 0000002b  DS : 0000002b
    EDI: 04aabba8  ESI: 04aabba8  EBX: 7ad9d277  EDX: 0018d6a4
    ECX: 00000000  EAX: 00000000  EBP: 0018f238  EIP: 0018d4ac
    CS : 00000023  Flg: 00210247  ESP: 0018d480  SS : 0000002b
    
    [Stack]
    06517580 0018d4a0 0018d6a4 00001770 1a8b7e70 0018f238 04aabba8 00001770 
    77bbe38c 687ad9d2 06517580 062e01f4 062e0000 1c1922c8 77bbe38c 1db40029 
    00000002 062e023c 062e0000 2c8000fb 00000001 1da6002a 00000002 1c1922c0 
    0018d798 0655f1d0 00000001 00000063 00000003 00000000 0f5ef318 0655eec0 
    0655f004 1c026d80 0655f730 00000000 0018d4a4 0655eec0 0018ebc0 77c071d5 
    1fd9dea2 fffffffe 77bbe38c 77bbe0f2 06517580 06516e00 00000063 fffffffe 
    77bbe38c 77bbe0f2 1c13ee00 1c13f0c0 000000ab a96575a2 642b9161 a96575a2 
    a2d08f85 00020000 00000000 00000000 00000000 7f4a7c13 9e3779b9 06517580 
    07647e40 07647e40 0018d5bc 63f9568a 0018d5a8 00000010 07647e40 00000030 
    1c026dc0 2e373231 2e302e30 30363a31 00003030 00000000 1c026dc0 0018d5d0 
    63f87cfb 07647e40 06516e00 07647e40 0018d654 63f95bfc 07647e40 07647e40 
    07704380 07647380 0018db2c 00000000 00000001 00000003 00000003 00000000 
    78101000 00000000 ffffffff ffffffff 0018d648 63f8fef2 0018d67c 0018d680 
    07647e40 00000000 00010000 00000000 40001580 00000000 00000000 00000000 
    0018db2c 0018d680 0018d858 63f94801 0018d67c 0018d680 07647e40 00000000 
    00010000 00000000 00000000 00000000 07704380 1c026d40 0018db2c 1c1965c0 
    
    SymLoadModule failed 0 ( module =  ) 
    SymGetSymFromAddr error 126
    frame : (01) : PC Address : 0018d4ac
         Param[0] : 1a8b7e70
         Param[1] : 00000004
         Param[2] : 04a9bd10
         Param[3] : 00441f59
    SymGetModuleInfo error 126
    SymGetLineFromAddr error 126
         Function Name : <nosymbols>
    SymGetSymFromAddr error 487
    frame : (02) : PC Address : 0051366c
         Param[0] : 00000000
         Param[1] : 00000000
         Param[2] : 00000000
         Param[3] : 00000000
         ModuleName : theduel
    SymGetLineFromAddr error 487
         Function Name : <nosymbols>
    Many thanks to the one who can figure it out.

    Cheers!


  2. #2
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: Setting a detour at MClientSocket::Connect incorrectly ?

    Return type doesn't really matter, void would do fine, it's not like it would make any difference.

    Your best bet is attaching OllyDBG and figure out where the exception is raised. (Breakpoint the MClientSocket::Connect address)

    Also, the socket is somewhere in ZGetGameClient, might as well grab it from there.

    On a serious note, first English thread in this forums for over years now. Congrats!

  3. #3
    Browser. Nova is offline
    MemberRank
    Nov 2008 Join Date
    --Location
    400Posts

    Re: Setting a detour at MClientSocket::Connect incorrectly ?

    Oh wow, didn't take the time to look around.
    This place is worse than the Mexican border with immigrant whores.

    Back to the topic-
    I haven't looked at it further, but after a nights sleep, I think the detour is corrupting the stack somewhere, which is strange, cause GunZ crashes in a very elegant way (no "unresponsive exe", or stack corruption messages).
    But I guess it was kinda precipitated, attempting to fetch the socket at the earliest stage possible.
    I'll have another look later on, thanks for the reply though!



Advertisement