Very basic way of new commands

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Member Your_Mom is offline
    MemberRank
    Mar 2010 Join Date
    Where I want toLocation
    88Posts

    Very basic way of new commands

    Looks liked I did the wrong one
    I meant to do ChatCmd_AdminAnnounce, instead I did ChatCmd_CreateChatRoom.

    All I did was go to the ZChat::InitCmd function, change the string on "/admin_halt" and "admin_halt", change the PUSH from Admin_halt, to my "new custom" function.
    Then, went to the address 5E5A00, and re-added my edited function.

    Here's the text document I created, should be enough.
    Code:
    42D75C - /admin_test (Was /admin_halt)
    42D1A0 - ChatCmd_AdminAnnounce (This ain't ChatCmd_AdminAnnounce... It's ChatCmd_CreateChatRoom!!)
    
    5E5A00 - ChatCmd_AdminAnnounce2 (Where I added all this ASM.. XD)
    ;My 'custom' function
    SUB ESP,10C
    MOV EAX,DWORD PTR DS:[6569F0]
    MOV DWORD PTR SS:[ESP+108],EAX
    CMP DWORD PTR SS:[ESP+114],2
    PUSH ESI
    JGE SHORT 0042D217----------
    MOV EAX,DWORD PTR SS:[ESP+11C]
    MOV ESI,DWORD PTR DS:[EAX]
    MOV AL,0FF
    PUSH 3ED
    MOV BYTE PTR SS:[ESP+B],AL
    MOV BYTE PTR SS:[ESP+8],0
    MOV BYTE PTR SS:[ESP+9],AL
    MOV BYTE PTR SS:[ESP+A],0
    CALL 005084F0
    MOV ECX,EAX
    CALL 004CF670
    MOV ECX,DWORD PTR SS:[ESP+4]
    PUSH ECX
    PUSH 1
    PUSH 0
    PUSH EAX
    CALL 0042A230
    PUSH ESI
    CALL 0042AFD0
    ADD ESP,14
    POP ESI
    MOV ECX,DWORD PTR SS:[ESP+108]
    CALL 0057112E
    ADD ESP,10C
    RETN
    MOV EDX,DWORD PTR SS:[ESP+11C]
    MOV ESI,DWORD PTR DS:[EDX+4]
    PUSH ESI
    CALL 00429640
    MOV ECX,EAX
    CALL 00512910
    TEST AL,AL
    JNZ SHORT 0042D27B  --MOV AL,0FF
    CALL 00429640
    ADD EAX,50
    PUSH EAX
    PUSH 1
    LEA EAX,DWORD PTR SS:[ESP+14]
    PUSH 187CC
    PUSH EAX
    CALL 00403B10
    ADD ESP,10
    PUSH 187CC
    LEA ECX,DWORD PTR SS:[ESP+10]
    PUSH 0
    PUSH ECX
    CALL 004970C0
    MOV ECX,EAX
    CALL 00431F10
    POP ESI
    MOV ECX,DWORD PTR SS:[ESP+108]
    CALL 0057112E
    ADD ESP,10C
    RETN
    MOV AL,0FF
    PUSH 521
    MOV BYTE PTR SS:[ESP+B],AL
    MOV BYTE PTR SS:[ESP+8],0
    MOV BYTE PTR SS:[ESP+9],AL
    MOV BYTE PTR SS:[ESP+A],0
    CALL 005084F0
    MOV ECX,EAX
    CALL 004CF670
    MOV EDX,DWORD PTR SS:[ESP+4]
    PUSH EDX
    PUSH 0
    PUSH 1
    PUSH EAX
    CALL 0042A230
    ADD ESP,10
    LEA EAX,DWORD PTR SS:[ESP+4]
    PUSH ESI
    PUSH EAX
    CALL 004C2FC0
    ADD ESP,4
    PUSH EAX
    CALL 0042BF40
    MOV ECX,DWORD PTR SS:[ESP+114]
    ADD ESP,8
    POP ESI
    CALL 0057112E
    ADD ESP,10C
    RETN
    -Remember to fix the short jumps!

    If I get the time, I'll fix it up and make it an actual new function.
    Sorry, I'm pretty tired so yeah. Enjoy what I gave.

    Here, this will give you more information.
    Here's what I reversed, within 10 minutes of looking in ChatCmd_AdminAnnounce.
    1. A string is inputed (I.E: "/admin_announce ")
    2. An integer is inputed (Which is automatically 0 - Remember him talking bout PUSH 0?)
    3. Another string is inputed (I.E: "LOOL Hello World!")
    (By string, I mean char*/const char* ofc lol)

    It calls MMessenger::GetStr. I looked into it a bit, and found ZChat::InitCmds, which has a list of all the commands.
    On the part of Admin_Wall, it has this:
    Code:
    ;GunZ Old
    0042B162  |. 68 4C585B00    PUSH GunzOld.005B584C
    0042B167  |. 68 608C5B00    PUSH GunzOld.005B8C60
    0042B16C  |. 6A 01          PUSH 1
    0042B16E  |. 6A 01          PUSH 1
    0042B170  |. 6A FF          PUSH -1
    0042B172  |. 6A 08          PUSH 8
    0042B174  |. 68 F09B4200    PUSH GunzOld.00429BF0 ; ChatCmd_AdminAnnounce!
    0042B179  |. 68 548C5B00    PUSH GunzOld.005B8C54
    0042B17E  |. 6A 00          PUSH 0
    0042B180  |. 8BCE           MOV ECX,ESI 
    0042B182  |. E8 F9230000    CALL GunzOld.0042D580 ; ZChatCmdManager::AddCommand
    Last edited by Your_Mom; 22-03-10 at 11:56 AM.


  2. #2
    Member cartola is offline
    MemberRank
    Aug 2008 Join Date
    58Posts

    Re: Very basic way of new commands

    Realy i dont know @_@

    confused @__@

    THis is a new command ok?

    but your add in asm Runnable/matchserver? x)

    (why u make Admin_ban and use a Dll to ban in admin_ban? and Admin_test dc peoples? x)

  3. #3
    Account Upgraded | Title Enabled! hotgame is offline
    MemberRank
    Mar 2009 Join Date
    CanadaLocation
    305Posts

    Re: Very basic way of new commands

    thanks nice.

  4. #4

    Re: Very basic way of new commands

    Thanks, but there's an alternative way - Hooking ZChat::Input.

  5. #5
    Veni, Vidi, Vici Arcelor is offline
    MemberRank
    Jan 2010 Join Date
    Delhi, IndiaLocation
    1,763Posts

    Re: Very basic way of new commands

    Thanks Penguin :]

  6. #6
    Member Your_Mom is offline
    MemberRank
    Mar 2010 Join Date
    Where I want toLocation
    88Posts
    Linear ive released that... And why have another file? I know this isnt a new command but you can easily make a new one with the information i gave.
    Posted via Mobile Device

  7. #7
    Sharing is caring KillerStefan is offline
    MemberRank
    Feb 2007 Join Date
    NetherlandsLocation
    2,554Posts

    Re: Very basic way of new commands

    Why give if people only take?

  8. #8
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: Very basic way of new commands

    Quote Originally Posted by KillerStefan View Post
    Why give if people only take?
    What kind of repley is that from a Mod.

    Atleast some people are willing to share with the community, lots of people can take an example from that.

    Greetz Rotana

  9. #9
    Veni, Vidi, Vici Arcelor is offline
    MemberRank
    Jan 2010 Join Date
    Delhi, IndiaLocation
    1,763Posts

    Re: Very basic way of new commands

    Quote Originally Posted by Rotana View Post
    What kind of repley is that from a Mod.

    Atleast some people are willing to share with the community, lots of people can take an example from that.

    Greetz Rotana
    Damn. Owned.

  10. #10
    Member Your_Mom is offline
    MemberRank
    Mar 2010 Join Date
    Where I want toLocation
    88Posts

    Re: Very basic way of new commands

    Was in a good mood. Re-added original post back.
    Hit the little heart button if you find it useful. T_T

  11. #11
    Veni, Vidi, Vici Arcelor is offline
    MemberRank
    Jan 2010 Join Date
    Delhi, IndiaLocation
    1,763Posts

    Re: Very basic way of new commands

    Tell me when you make that websites of yours >.>;. I want some space too lol.

  12. #12
    GunZ Developer dacharles is offline
    MemberRank
    Oct 2006 Join Date
    476Posts

    Re: Very basic way of new commands

    what that "custom" function make?

  13. #13
    Member Your_Mom is offline
    MemberRank
    Mar 2010 Join Date
    Where I want toLocation
    88Posts

    Re: Very basic way of new commands

    Quote Originally Posted by dacharles View Post
    what that "custom" function make?
    I was just making an example on what you could do with it. It's not an actual 'custom' function, although you can create an custom function.

    Pretty much, if you input "/admin_test" (was /admin_halt), you will create a chat room. (Got mixed up, insomnia helped. >.>)

  14. #14
    Member `YellowBoy is offline
    MemberRank
    Dec 2009 Join Date
    78Posts

    Re: Very basic way of new commands

    Quote Originally Posted by Rotana View Post
    What kind of repley is that from a Mod.

    Atleast some people are willing to share with the community, lots of people can take an example from that.

    Greetz Rotana
    Why is he a mod anyways?

  15. #15
    Member Your_Mom is offline
    MemberRank
    Mar 2010 Join Date
    Where I want toLocation
    88Posts

    Re: Very basic way of new commands

    See this link? http://www.forum.ragezone.com/f311
    Yeah, if you're post won't be about this thread, click that link. Click "New Thread", and discuss in that thread.



Page 1 of 2 12 LastLast

Advertisement