Understanding Development of GameServer Files and Main.exe

Page 1 of 2 12 LastLast
Results 1 to 25 of 29
  1. #1
    Account Upgraded | Title Enabled! CockMan is offline
    MemberRank
    Aug 2006 Join Date
    xor eax,eaxLocation
    746Posts

    Understanding Development of GameServer Files and Main.exe

    Frequently asked questions (+ Reliable Answers)

    Q. Why doesn't my server have full s3 items support, i mean i can wear the items, get the added def, but when it comes to viewing them by others, it shows up all wrong?

    A. You must first correct the gameservers errorwith the visual interaction bug for the items. Gameserver requires correct procedure and offsets to show the items correct to all.

    Q. Why do all the big named servers have all these cool features and when I look on RZ I cant find anything compared to that?

    A. They simply leech, buy files, or create them themselves. It is not hard to code, ppl are just too lazy to learn it.

    Q. I am running a server, but no one seems to be coming to it, what is the problem?

    A. You must advertise it widely, good example is alliance mu or zypher mu, no matter what the admins do bad to the game, its soo widely advertised more ppl will come to it.

    Q. I want to add more items to my game, how do i go about doing that?

    A. To make the items visible you must first study and understand Q. #1, and the second part is to call new .smd functions from a dll source to memory, then into the mains debugger.

    Q. I want Season 3 Server, How to obtain?

    A. Make it yourself, you can prolly learn to code and then make your own server perfect in less than 3 months.

    Is simple guide to answer basic questions without giving away too much information. Some leechers will understand and some dont, if you dont i suggest you leech files from rz and other forums.

    In the past I have released help for ppl to create their own 3d camera on older clients, but now I will release the fully functional 3d for newer s3 compliable servers.

    Credits? all go to Rz, this post is to show ppl what to think and how to think, is merely education guides on how to answer / obtain information.

    Truel, only a idiot wants fully customizable files without working for them. xD


  2. #2
    Account Upgraded | Title Enabled! shay2134 is offline
    MemberRank
    May 2005 Join Date
    123456Location
    525Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    plz you can learn me how to code i want to know and i dont find how to code i so want to code but i dont know if you help i thank you all my life plz learn me to code

  3. #3
    Apprentice hutzu is offline
    MemberRank
    Aug 2007 Join Date
    7Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    well.....many of us want to learn how to code those gameservers and mains and all other stuff, but we don't know where to start.

  4. #4
    Valued Member Marin_scp is offline
    MemberRank
    Mar 2006 Join Date
    Inside EAXLocation
    103Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Can you tell us a good start-point to learn devoloping GameServers? I am very interested in developing my own gameservers, but I just don't know where to start.


    (Sorry for bad english, I am brazilian).

    Marin

  5. #5
    Account Upgraded | Title Enabled! Nightwing7 is offline
    MemberRank
    Feb 2007 Join Date
    251Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    well here they are (these tutes are for those who have a basic knowledge of coding in any language)

    Iczelion's Win32 Assembly Homepage
    win32asm - Google Search
    masm32.com
    masm tutorials - Google Search

  6. #6
    Apprentice zimbred is offline
    MemberRank
    Apr 2005 Join Date
    12Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Lol, Assembler? Are you masochist?

    Learn C++, or different High-Level language, and a bit asm, only for debug (mov, ptrs, cmp, jxx, push, pop, add).

    You must know well Win32Api, understand pointers to datas or functions (because GameServer is simply Framework) in C++ and have PDB (GameServer 0.99.60 and 0.99.62 have it). Additional you can reverse some MuOnline protocol (NPC Talk, skills) and cryptography (C3 and C4 enc/dec).

    If you will know this, you can make with MuOnline everything. Simple ;).

    Look:
    YouTube - Kantru Event Alpha

    and look:
    YouTube - MuOnline Season 3 Mixes

    and look:
    YouTube - MuOnline Mu.Net

    This is a little piece of my work :).

    Salut,
    f1x

  7. #7
    Account Upgraded | Title Enabled! CockMan is offline
    MemberRank
    Aug 2006 Join Date
    xor eax,eaxLocation
    746Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    xD that 3d main looks similar to sobiehs full 3d main, but its still goo, any more bit of info to help out is greatful, do it for rz and spread a few good c++ tuts.

  8. #8
    Apprentice zimbred is offline
    MemberRank
    Apr 2005 Join Date
    12Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    No, it's not similar.

    If I remember well, sobieh steered his camera by mouse and screen edges.

    My camera using mouse gesture. If you click 3rd button and:
    -drag mouse int left or right: camera will rotate,
    -drag mouse in up or down: camera will zoom out or zoom in,
    -scroll steering camera perspective.

  9. #9
    Account Upgraded | Title Enabled! CockMan is offline
    MemberRank
    Aug 2006 Join Date
    xor eax,eaxLocation
    746Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    hmm correct. but its easy to manipulate camera, tho most teams us the 1.2n limited way. Also, I think I saw your compiled source of kanturu even pasted on CzF.

  10. #10
    Account Upgraded | Title Enabled! RisingKing2010 is offline
    MemberRank
    Feb 2006 Join Date
    loc( 'RisingKing', 'USA' );Location
    1,362Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    it also helps to look at any sources u can get your hands on, u can see examples of how a coder would add a simple option...

    like here is part of the /post cmd:

    Code:
    Command = szChatBuff;
    if(strcmpi(Command,"/ServerInfo")==0)
    {
    	 MyChat.ServerInfo(lpObj);
    }
    else if(strcmpi(Command,"/Post")==0)
    {
    	MyChat.SendPost(lpObj,Content);
    }
    		else if(strcmpi(Command,"/Test")==0)

    this was taken from a czf dll source i found perusing the i-net, but it is gone now :P, the czf added a few other options too, as u can see, i am still too nooby at C++, so i dont rly understand major parts source that much XD, and sry wont post the full source b/c it isnt my source :P

    so for this i will give credits to CzF :P

    this is a small part of the function...

  11. #11
    Enthusiast kazanliev is offline
    MemberRank
    Aug 2006 Join Date
    BulgariaLocation
    44Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    I am reading this thread for the third time and I just can't understand how much insanity it takes to write something like that. A Q&A pretending to be the masterpiece .... ultimate guide to the perfect private Mu server.
    Let me ask you this: If all the so called n00bs who want to create a decent private server and are staying here on RZ and read, test and post, learn how to code just following your guide, how many "Active supporters" of CzF would remain?
    Your whole post is so disrespectful to the community it leaves me speechless.
    Don't get me wrong!!! I do respect the work of CzF and all other coders and teams. They do all of their work for the credits ONLY and they do deserve respect. But you my friend are a hypocrite. You SHOUT as hard as you can how you support the coders and at the same time you are simply a leecher who leeches first hand.
    May be I am wrong, may be you are the best coder out there but if that is so why I can't see your name on the credit list of CzF. If you are supporting CzF so damn hard why didn't they put you on the list of credits they give?
    As these rows are growing another idea came to me: I haven't heard of CzF members looking for supporters. Really, show me just one post of a CzF member asking for supporters (fans) and I'll apologize.
    May be I am wrong again, but my curiosity still grows: Mate, how are you supporting CzF? What are you doing to support them? Really, I want to support them too, I am serious about it. I'd like to see my name in the list of their supporters when they publish it, if there is such a list at all.

  12. #12
    Enthusiast kazanliev is offline
    MemberRank
    Aug 2006 Join Date
    BulgariaLocation
    44Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    At the end I'll ask you another simple question: Read the two lines on my signature and tell me: Do they seem funny to you? Answer with a simple yes or no.

  13. #13
    Account Upgraded | Title Enabled! RisingKing2010 is offline
    MemberRank
    Feb 2006 Join Date
    loc( 'RisingKing', 'USA' );Location
    1,362Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Quote Originally Posted by kazanliev View Post
    I am reading this thread for the third time and I just can't understand how much insanity it takes to write something like that. A Q&A pretending to be the masterpiece .... ultimate guide to the perfect private Mu server.
    Let me ask you this: If all the so called n00bs who want to create a decent private server and are staying here on RZ and read, test and post, learn how to code just following your guide, how many "Active supporters" of CzF would remain?
    Your whole post is so disrespectful to the community it leaves me speechless.
    Don't get me wrong!!! I do respect the work of CzF and all other coders and teams. They do all of their work for the credits ONLY and they do deserve respect. But you my friend are a hypocrite. You SHOUT as hard as you can how you support the coders and at the same time you are simply a leecher who leeches first hand.
    May be I am wrong, may be you are the best coder out there but if that is so why I can't see your name on the credit list of CzF. If you are supporting CzF so damn hard why didn't they put you on the list of credits they give?
    As these rows are growing another idea came to me: I haven't heard of CzF members looking for supporters. Really, show me just one post of a CzF member asking for supporters (fans) and I'll apologize.
    May be I am wrong again, but my curiosity still grows: Mate, how are you supporting CzF? What are you doing to support them? Really, I want to support them too, I am serious about it. I'd like to see my name in the list of their supporters when they publish it, if there is such a list at all.
    omg, stfu, u take this too seriously, so wat if ppl are "CzF Supports" it doesnt make that much of a difference... and CockMan gots a very good point, most ppl just use files they find here rather than code themselves... most of the best server dont use files ragezone, they, like cockman said, either buy/code them

    the world isn't perfect, but you will just have to live with it

  14. #14
    Spewing Logic Since 93 RapidBlue is offline
    MemberRank
    May 2007 Join Date
    The CityLocation
    700Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    all i have to say on this is im not going into this but thx cock for the guide :D

  15. #15
    Account Upgraded | Title Enabled! FeN$x is offline
    MemberRank
    Sep 2005 Join Date
    you care?Location
    313Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Quote Originally Posted by CockMan View Post
    Frequently asked questions (+ Reliable Answers)

    Q. Why doesn't my server have full s3 items support, i mean i can wear the items, get the added def, but when it comes to viewing them by others, it shows up all wrong?

    A. You must first correct the gameservers errorwith the visual interaction bug for the items. Gameserver requires correct procedure and offsets to show the items correct to all.

    Q. Why do all the big named servers have all these cool features and when I look on RZ I cant find anything compared to that?

    A. They simply leech, buy files, or create them themselves. It is not hard to code, ppl are just too lazy to learn it.

    Q. I am running a server, but no one seems to be coming to it, what is the problem?

    A. You must advertise it widely, good example is alliance mu or zypher mu, no matter what the admins do bad to the game, its soo widely advertised more ppl will come to it.

    Q. I want to add more items to my game, how do i go about doing that?

    A. To make the items visible you must first study and understand Q. #1, and the second part is to call new .smd functions from a dll source to memory, then into the mains debugger.

    Q. I want Season 3 Server, How to obtain?

    A. Make it yourself, you can prolly learn to code and then make your own server perfect in less than 3 months.

    Is simple guide to answer basic questions without giving away too much information. Some leechers will understand and some dont, if you dont i suggest you leech files from rz and other forums.

    In the past I have released help for ppl to create their own 3d camera on older clients, but now I will release the fully functional 3d for newer s3 compliable servers.

    Credits? all go to Rz, this post is to show ppl what to think and how to think, is merely education guides on how to answer / obtain information.

    Truel, only a idiot wants fully customizable files without working for them. xD
    A. GS dont need to show visual things, its a little moron to say than GS show visual, in fact it only send a packet with the new items ID on other bytes and main show the animation, its just a packet send interaction nothing releated to offsets

    Lol, Assembler? Are you masochist?

    Learn C++, or different High-Level language, and a bit asm, only for debug (mov, ptrs, cmp, jxx, push, pop, add).

    You must know well Win32Api, understand pointers to datas or functions (because GameServer is simply Framework) in C++ and have PDB (GameServer 0.99.60 and 0.99.62 have it). Additional you can reverse some MuOnline protocol (NPC Talk, skills) and cryptography (C3 and C4 enc/dec).

    If you will know this, you can make with MuOnline everything. Simple ;).

    Look:
    YouTube - Kantru Event Alpha

    and look:
    YouTube - MuOnline Season 3 Mixes

    and look:
    YouTube - MuOnline Mu.Net

    This is a little piece of my work :).

    Salut,
    f1x
    In fact i code on ASM and my progress is much superior than to mod kantru event, i also got MU S3 mixs, golden fenrir, new class, new wings options and custom events...

    ASM its much superior than C++ on speed, it only take time to code it, but some lazy option its to learn C++ xD.

    Example of retard C++ code in compilation:

    C++:

    Code:
    mov eax, Local1
    add eax, 1
    mov Local1, eax
    ASM:

    Code:
    add Local1, 1
    MemCopy C++ can be used and most used has a API, on ASM you can produce your own proc less than 8 lines for do the same in a very superior way.

    PS: I code also PICs (robotic) and thats why i know most PICs coders use ASM for the compilation, less lines on compile and less resources used.

  16. #16
    Apprentice zimbred is offline
    MemberRank
    Apr 2005 Join Date
    12Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Quote Originally Posted by FeN$x View Post
    In fact i code on ASM and my progress is much superior than to mod kantru event, i also got MU S3 mixs, golden fenrir, new class, new wings options and custom events...
    And? You can make this shits using only funcions implemented in GameServer (ItemSerialCreateSend, ChaosBoxInit), sniffer, decryptor and some packets. My Season3 mixes had only ~15 lines code in C++.

    Quote Originally Posted by FeN$x View Post
    ASM its much superior than C++ on speed
    And it's the most bugless way to code something in mu. In C++ you have more advance mechanisms, like polymorphism, inheriting and predefine compile profiles. In ASM you have only procedural coding. In C++ your code is more clear than assembler and it's more receptive on changes, so you should learn C++. Now i know C++, ASM and some Delphi and coding in C++ is the most effective for me.

    C++:
    Code:
    typedef int(*pItemSerialCreateSend)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
    pItemSerialCreateSend ItemSerialCreateSend = (pItemSerialCreateSend)0x004036BB;
    ItemSerialCreateSend(aIndex, 0xFF, gObj_GetInt(aIndex, gObj_POSX), gObj_GetInt(aIndex, gObj_POSY), WingsId, 0, 255, 0, 0, 0, -1, 0, 0);
    ASM:
    Code:
    PUSH 0
    PUSH 0
    PUSH -1
    PUSH 0
    PUSH 0
    PUSH 0
    PUSH 255
    ...
    ...
    ...
    ...
    (and more)
    MOV EAX, 0x004036BB
    CALL EAX
    Show your code Kanturu Event in ASM and compare it with my Code in C++:
    .: Coderz Factory Network :. .

    Maybe some day I release my code for Illusion Temple Event and 3rd Level quest, of course in C++, so you can compare coding in ASM and C++ more in detail ;).

  17. #17
    Account Upgraded | Title Enabled! FeN$x is offline
    MemberRank
    Sep 2005 Join Date
    you care?Location
    313Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Quote Originally Posted by zimbred View Post
    And? You can make this shits using only funcions implemented in GameServer (ItemSerialCreateSend, ChaosBoxInit), sniffer, decryptor and some packets. My Season3 mixes had only ~15 lines code in C++.


    And it's the most bugless way to code something in mu. In C++ you have more advance mechanisms, like polymorphism, inheriting and predefine compile profiles. In ASM you have only procedural coding. In C++ your code is more clear than assembler and it's more receptive on changes, so you should learn C++. Now i know C++, ASM and some Delphi and coding in C++ is the most effective for me.

    C++:
    Code:
    typedef int(*pItemSerialCreateSend)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
    pItemSerialCreateSend ItemSerialCreateSend = (pItemSerialCreateSend)0x004036BB;
    ItemSerialCreateSend(aIndex, 0xFF, gObj_GetInt(aIndex, gObj_POSX), gObj_GetInt(aIndex, gObj_POSY), WingsId, 0, 255, 0, 0, 0, -1, 0, 0);
    ASM:
    Code:
    PUSH 0
    PUSH 0
    PUSH -1
    PUSH 0
    PUSH 0
    PUSH 0
    PUSH 255
    ...
    ...
    ...
    ...
    (and more)
    MOV EAX, 0x004036BB
    CALL EAX
    Show your code Kanturu Event in ASM and compare it with my Code in C++:
    .: Coderz Factory Network :. .
    Its very easy to know ItemSerialSend but do you know the arguments how they work???... i believe coding its not just copy and paste:

    Code:
    Push 0
     Push 0
     Push - 1
     Push 0
     Push 0
     Push 0
     Push 0FFH
     Push 0
     Mov Eax, WingsID
     Push Eax
     Push 0
     Push 0
     Push 0FFH
     Push Edx
     Call CreateItemSend
     Mov Eax, MixlpObj
     Mov Edx, DWord Ptr Ds:[Eax]
     Push Edx
     Call InvCommit
    Yeah you can some day end coding new class i mean 3 years more xD...

    Compare the my wings source code:

    Code:
    MixRecv Proc
    Local TypeMix:DWord
    Mov Eax, DWord Ptr Ss:[Ebp + 0CH]
    Mov TypeMix, Eax
    Xor Eax, Eax
    Switch TypeMix
    Case 25H
    Mov Edx, DWord Ptr Ss:[Ebp + 8]
    Invoke NewWingsMix, Edx
    Mov Eax, 1
    Case 26H
    Mov Edx, DWord Ptr Ss:[Ebp + 8]
    Invoke FinalMixWings, Edx
    Mov Eax, 1
    EndSw
    ret
    14 lines caused first 2 dont count, and only source code, C++ compiler make 15 lines of you to 30 meaby xD.

    Can i wonder whats Illusion temple type packet??? caused i got them all, but can you tell me just one?? xD

    In C++ your code is more clear than assembler and it's more receptive on changes, so you should learn C++. Now i know C++, ASM and some Delphi and coding in C++ is the most effective for me.
    SCF team code on C++, they got much more than to code easy wings mixs, i can bet they tell you ASM is superior xD.

    If not search on google the compilation, and polymorphism has nothing to do, meaby people think caused you say weird words you know more, but for be more sure, themida packer use polymorphism system on ASM and pholymorphism create much more lines on compilation and in source code, polymorph code it increase lag and speed, i wonder why you name it on MU?? meaby caused weird words make people think you know alot xD.

    C++ Retard compilation has we see:

    Code:
    MOV EAX, 0x004036BB
    CALL EAX
    ASM Compilation:

    Code:
    call 004036BB
    (1 line less and no EAX regist used)

    Code:
    PS: Hey sobieh if you reading this laugh a little, polymorph on C++ make the compilation faster hahahaha xDDD

  18. #18
    TitansTech / SCFMT bet0x is offline
    MemberRank
    Mar 2004 Join Date
    /dev/nullLocation
    840Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Quote Originally Posted by FeN$x View Post
    SCF team code on C++, they got much more than to code easy wings mixs, i can bet they tell you ASM is superior xD.
    I agree with FeN$x this time, but no always ;), ASM its fast and superior, but a pain of ass if you made for example 6 events, simples can be, but harder, you dont have Objects but its really fast.

  19. #19
    Apprentice zimbred is offline
    MemberRank
    Apr 2005 Join Date
    12Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    No, polymoprhism and others object oriented featues in C++ doesn't make C++ faster (in several cases) than ASM, but code is more regularized, besides code effectivity it's not only one point (see source of MANGoS emulator).

    I saw some your source (example Fenrir mix) and it's very chaotic.

    btw. Your source of season 3 miexes is incomplete, it's only protocol core hook ;). Show your mix functions...

    Ym, now i must finish code ELF MP3Player for My siemens CX65@70. See you later :).

  20. #20
    Account Upgraded | Title Enabled! FeN$x is offline
    MemberRank
    Sep 2005 Join Date
    you care?Location
    313Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Quote Originally Posted by zimbred View Post
    No, polymoprhism and others object oriented featues in C++ doesn't make C++ faster (in several cases) than ASM, but code is more regularized, besides code effectivity it's not only one point (see source of MANGoS emulator).

    I saw some your source (example Fenrir mix) and it's very chaotic.

    btw. Your source of season 3 miexes is incomplete, it's only protocol core hook ;). Show your mix functions and then we can compare our codes...
    LoL mix dont need protocol core hook hahahaha, they just need to be hook on looper of mixs proc, its not protocol core xD.

    And fenrir mix source was public, my source publics are coded on minutes, mine there its working and for you can test new class and golden fenrir with all working including mixs and custom things enter to my server:

    200.104.20.46

    Anyone than want to enter allowed, use the account:

    user test1
    pass test1

    New class workings, S3 mixs working, custom events working, golden fenrir full working with options, /Adds commands working, /Post and /ServerInfo, NPC Silent teleport working, S3 custom drops working also.

    You can see DeathWay source code GS on C++, and you can still ask him if ASM its more faster and much more complete on compilation than C++.

    Also ASM is more bug free, ASM also used for profecional packers like themida, armadillo, ASPack and others.

    PS: I need to end coding polymorphic methamorph hiper super dual quantum bathroom (sounds very weird, but people think this way i am pro xD)

  21. #21
    Apprentice zimbred is offline
    MemberRank
    Apr 2005 Join Date
    12Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    ProtocolCore call Mix Proc, so you can hook your MixFunctions from DLL into Mix proc or ProtocolCore. Hook in protocol core is more effective, because you can intercept mix packet earlier than mix call - when you intercept mix packet you can jump to end ProtocolCore function without requirements of interpreting packet by GameServer functions.

    I don't must test new classes and others Season 3 features on your server, because i test it on my own server :).

    Anyway - This logical, that ASM is faster than C++, because ASM is low-level language, BUT code Windows, Office or Mu Emulator in ASM - this is the point for me ;] ;).

  22. #22
    Account Upgraded | Title Enabled! Deathway is offline
    MemberRank
    Aug 2005 Join Date
    185Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    C++ can be faster as ASM, it depend of your compiler

    Code:
    CMsg::CMs>/$  55            PUSH EBP
    10001017  |.  8BEC          MOV EBP,ESP
    10001019  |.  83EC 08       SUB ESP,8
    1000101C  |.  C745 F8 CCCCC>MOV [LOCAL.2],CCCCCCCC
    10001023  |.  C745 FC CCCCC>MOV [LOCAL.1],CCCCCCCC
    1000102A  |.  894D F8       MOV [LOCAL.2],ECX
    1000102D  |.  C745 FC 30B00>MOV [LOCAL.1],MuMsg.1001B030             ;  ASCII "Msg error"
    10001034  |.  6A 34         PUSH 34                                  ; /n = 34 (52.)
    10001036  |.  6A 00         PUSH 0                                   ; |c = 00
    10001038  |.  8B45 F8       MOV EAX,[LOCAL.2]                        ; |
    1000103B  |.  05 24000200   ADD EAX,20024                            ; |
    10001040  |.  50            PUSH EAX                                 ; |s
    10001041  |.  E8 0A080000   CALL MuMsg.memset                        ; \memset
    10001046  |.  83C4 0C       ADD ESP,0C
    10001049  |.  8B4D F8       MOV ECX,[LOCAL.2]
    1000104C  |.  C701 00000000 MOV DWORD PTR DS:[ECX],0
    10001052  |.  8B55 FC       MOV EDX,[LOCAL.1]
    10001055  |.  52            PUSH EDX                                 ; /src
    10001056  |.  8B45 F8       MOV EAX,[LOCAL.2]                        ; |
    10001059  |.  05 24000200   ADD EAX,20024                            ; |
    1000105E  |.  50            PUSH EAX                                 ; |dest
    1000105F  |.  E8 FC060000   CALL MuMsg.strcpy                        ; \strcpy
    10001064  |.  83C4 08       ADD ESP,8
    10001067  |.  8B45 F8       MOV EAX,[LOCAL.2]
    1000106A  |.  83C4 08       ADD ESP,8
    1000106D  |.  3BEC          CMP EBP,ESP
    1000106F  |.  E8 3C080000   CALL MuMsg._chkesp
    10001074  |.  8BE5          MOV ESP,EBP
    10001076  |.  5D            POP EBP
    10001077  \.  C3            RETN

    Now Optimized , note that there aren't calls

    Code:
    CMsg::CMs>/$  8BD1          MOV EDX,ECX
    10001022  |.  53            PUSH EBX
    10001023  |.  56            PUSH ESI
    10001024  |.  57            PUSH EDI
    10001025  |.  8D9A 24000200 LEA EBX,DWORD PTR DS:[EDX+20024]
    1000102B  |.  B9 0D000000   MOV ECX,0D
    10001030  |.  33C0          XOR EAX,EAX
    10001032  |.  8BFB          MOV EDI,EBX
    10001034  |.  F3:AB         REP STOS DWORD PTR ES:[EDI]
    10001036  |.  BF 30800010   MOV EDI,MuMsg.10008030                   ;  ASCII "Msg error"
    1000103B  |.  83C9 FF       OR ECX,FFFFFFFF
    1000103E  |.  8902          MOV DWORD PTR DS:[EDX],EAX
    10001040  |.  F2:AE         REPNE SCAS BYTE PTR ES:[EDI]
    10001042  |.  F7D1          NOT ECX
    10001044  |.  2BF9          SUB EDI,ECX
    10001046  |.  8BC1          MOV EAX,ECX
    10001048  |.  8BF7          MOV ESI,EDI
    1000104A  |.  8BFB          MOV EDI,EBX
    1000104C  |.  C1E9 02       SHR ECX,2
    1000104F  |.  F3:A5         REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS>
    10001051  |.  8BC8          MOV ECX,EAX
    10001053  |.  8BC2          MOV EAX,EDX
    10001055  |.  83E1 03       AND ECX,3
    10001058  |.  F3:A4         REP MOVS BYTE PTR ES:[EDI],BYTE PTR DS:[>
    1000105A  |.  5F            POP EDI
    1000105B  |.  5E            POP ESI
    1000105C  |.  5B            POP EBX
    1000105D  \.  C3            RETN
    Original

    Code:
    CMsg::CMsg() // Correct
    {
    	char * szMessageError ="Msg error";
    
    	memset(&this->m_szMuMsgError  , 0, sizeof(this->m_szMuMsgError ) );
    	this->m_ListInit = 0;
    	strcpy(this->m_szMuMsgError , szMessageError);
    }
    Now i MUST remark that less lines don't means Better perfomance, Registers in ASM were made for increase the speed, thats why many c++ compilers use it on its routines, playing with code like INC DWORD PTR DS[XXXXXXX] is for reduce the code , playing with INC EAX is related with Speed, however ASM can be faster i think

    PD: some new compilers also Add an special feature related with Calling procedures, they avoid the classic PUSH , instead of that they reserve a space for the stack, adding the ESP value, and then they use the MOV instruction , this also increase even more the speed, at first look, this should look more "heavy", but it is faster

  23. #23
    Account Upgraded | Title Enabled! FeN$x is offline
    MemberRank
    Sep 2005 Join Date
    you care?Location
    313Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    Quote Originally Posted by Deathway View Post
    C++ can be faster as ASM, it depend of your compiler

    Code:
    CMsg::CMs>/$  55            PUSH EBP
    10001017  |.  8BEC          MOV EBP,ESP
    10001019  |.  83EC 08       SUB ESP,8
    1000101C  |.  C745 F8 CCCCC>MOV [LOCAL.2],CCCCCCCC
    10001023  |.  C745 FC CCCCC>MOV [LOCAL.1],CCCCCCCC
    1000102A  |.  894D F8       MOV [LOCAL.2],ECX
    1000102D  |.  C745 FC 30B00>MOV [LOCAL.1],MuMsg.1001B030             ;  ASCII "Msg error"
    10001034  |.  6A 34         PUSH 34                                  ; /n = 34 (52.)
    10001036  |.  6A 00         PUSH 0                                   ; |c = 00
    10001038  |.  8B45 F8       MOV EAX,[LOCAL.2]                        ; |
    1000103B  |.  05 24000200   ADD EAX,20024                            ; |
    10001040  |.  50            PUSH EAX                                 ; |s
    10001041  |.  E8 0A080000   CALL MuMsg.memset                        ; \memset
    10001046  |.  83C4 0C       ADD ESP,0C
    10001049  |.  8B4D F8       MOV ECX,[LOCAL.2]
    1000104C  |.  C701 00000000 MOV DWORD PTR DS:[ECX],0
    10001052  |.  8B55 FC       MOV EDX,[LOCAL.1]
    10001055  |.  52            PUSH EDX                                 ; /src
    10001056  |.  8B45 F8       MOV EAX,[LOCAL.2]                        ; |
    10001059  |.  05 24000200   ADD EAX,20024                            ; |
    1000105E  |.  50            PUSH EAX                                 ; |dest
    1000105F  |.  E8 FC060000   CALL MuMsg.strcpy                        ; \strcpy
    10001064  |.  83C4 08       ADD ESP,8
    10001067  |.  8B45 F8       MOV EAX,[LOCAL.2]
    1000106A  |.  83C4 08       ADD ESP,8
    1000106D  |.  3BEC          CMP EBP,ESP
    1000106F  |.  E8 3C080000   CALL MuMsg._chkesp
    10001074  |.  8BE5          MOV ESP,EBP
    10001076  |.  5D            POP EBP
    10001077  \.  C3            RETN

    Now Optimized , note that there aren't calls

    Code:
    CMsg::CMs>/$  8BD1          MOV EDX,ECX
    10001022  |.  53            PUSH EBX
    10001023  |.  56            PUSH ESI
    10001024  |.  57            PUSH EDI
    10001025  |.  8D9A 24000200 LEA EBX,DWORD PTR DS:[EDX+20024]
    1000102B  |.  B9 0D000000   MOV ECX,0D
    10001030  |.  33C0          XOR EAX,EAX
    10001032  |.  8BFB          MOV EDI,EBX
    10001034  |.  F3:AB         REP STOS DWORD PTR ES:[EDI]
    10001036  |.  BF 30800010   MOV EDI,MuMsg.10008030                   ;  ASCII "Msg error"
    1000103B  |.  83C9 FF       OR ECX,FFFFFFFF
    1000103E  |.  8902          MOV DWORD PTR DS:[EDX],EAX
    10001040  |.  F2:AE         REPNE SCAS BYTE PTR ES:[EDI]
    10001042  |.  F7D1          NOT ECX
    10001044  |.  2BF9          SUB EDI,ECX
    10001046  |.  8BC1          MOV EAX,ECX
    10001048  |.  8BF7          MOV ESI,EDI
    1000104A  |.  8BFB          MOV EDI,EBX
    1000104C  |.  C1E9 02       SHR ECX,2
    1000104F  |.  F3:A5         REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS>
    10001051  |.  8BC8          MOV ECX,EAX
    10001053  |.  8BC2          MOV EAX,EDX
    10001055  |.  83E1 03       AND ECX,3
    10001058  |.  F3:A4         REP MOVS BYTE PTR ES:[EDI],BYTE PTR DS:[>
    1000105A  |.  5F            POP EDI
    1000105B  |.  5E            POP ESI
    1000105C  |.  5B            POP EBX
    1000105D  \.  C3            RETN
    Original

    Code:
    CMsg::CMsg() // Correct
    {
    	char * szMessageError ="Msg error";
    
    	memset(&this->m_szMuMsgError  , 0, sizeof(this->m_szMuMsgError ) );
    	this->m_ListInit = 0;
    	strcpy(this->m_szMuMsgError , szMessageError);
    }
    Now i MUST remark that less lines don't means Better perfomance, Registers in ASM were made for increase the speed, thats why many c++ compilers use it own its routines, playint with code like INC DWORD PTR DS[XXXXXXX] is for reduce the code , playing with INC EAX is with Speed,
    C++ its not made for playing with regist, in fact its oriented to playing with structured coding, has you put there its a very good example of structured, it can be reduced with ASM much more.

    This is SSE scalar definition on VC++ compared with ASM:

    VC++ vs assembler code and how to write floating point code using scalar SSE

    A good document to see, more if some people think VC++ its superior on scalar fuctions SSEs fuctions and also it explain about FPUs.

  24. #24
    Valued Member -=Xane=- is offline
    MemberRank
    Jul 2006 Join Date
    canadaLocation
    110Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    I really wanted to learn c++ before. But it gets frustrating :S

  25. #25
    Apprentice Rmmntqo is offline
    MemberRank
    Apr 2007 Join Date
    18Posts

    Re: [Guide]Understanding Development of GameServer Files and Main.exe

    omg, i saw "[Guide]Understanding Development of GameServer Files and Main.exe"
    where is the guide?



Page 1 of 2 12 LastLast

Advertisement