Fixing Experience Bar Bug.

Page 1 of 3 123 LastLast
Results 1 to 15 of 37
  1. #1
    Hybrid Gembrid is offline
    MemberRank
    Mar 2006 Join Date
    1,121Posts

    Fixing Experience Bar Bug.

    This is not actually Experience Bar Bug, it's Experience Bug =)
    and usually u can meet it in servers with high rates, when Experience Bar overflows number 9, or doens't show exp progress, so u have to reselect character

    Why this happens? If you will take a look on Exp values in Char Info Window, when killing some mobs and making lvl up, you will notice that Obtained Exp is just added to the current Exp value and nothing else is done

    The point is that GS sends just obtained exp, and even when character levels up, main.exe uses calculated Value from Exp Table to set new value for New Needed Exp, so if you have different formulas in GS and Main of calcing Exp, you will have double Exp Bug :D, of course you can fix this 2 bugs by changing packets in main and GS, and it's not really hard, but we will fix just first bug, because not all of the servers change Exp formulas.

    How we gonna do it? First let's take a look how gs do all the work:

    1. Character obtains Exp
    2. GS Adds Obtained Exp to the Current Exp value
    3. Checks if Current Exp >= Needed Exp
    4. And if this comparation results TRUE,
    a. In Current Exp value GS moves Needed Exp value
    b. In Needed Exp value moves next Needed Exp value for next lvl, from the Exp table
    (and now attention)
    c.Sends Lvl up to main.exe
    5. Sends Obtained Exp to main.exe

    First i thought that if i will just make step 4a in main.exe it will solve all the problems, but i forgot that GS first sends Lvl up and then Obtained Exp. We don't need to ADD value of Obtained Exp after Lvl Ups in main.exe, because when we fix all in Lvl Up proc, first packet after Lvl up with Obtained Exp spoils all the things =)

    The solution is using a flag. When we receive Lvl Up in main.exe, we fix all the shit, Set Flag, and in Function that adds Obtained Exp we check if the flag is Set we don't need to add that value, we just skip this step and reset the flag. With this we will have fixed Exp in main.exe :D cool, no more character Reselection :D

    We won't use dll for this thing, because we will just add a little code in main.exe, of course people who understand codding and programming can use their own DLL


    Now i will try to explain how to find functions and what code to add


    1. Open main.exe in ollydbg and go to the end of it, u will find empty space there. Some mains through error "Unable to locate data in executbale file", when u try to add some code. To check if there is space, select 1 empty line -> RB -> View -> Executable file, there u will find real empty space, check the picture.


    This space might be not enough to add our code. Some mains have additional sections, may be there weren't delete after unpacking, or may be were added by someone, for example all 97 mains have this sections, there u have a lot of empty space. Other mains that i had to work with have enough space. But if u don't have empty sections and u don't have enough space at the end of the file, then you will have add additional sections =)

    2. Here is our section, your main may have just 1 JMP. If you will scroll down you will find a lot of empty space, a lifetime empty space :D



    But anyway we just need an empty space =)

    3. Now we will find switch for packet codes. RB -> Search for -> All switches
    Now with all your attention in appeared window find switch (cases 0..F4)
    http://img162.imageshack.us/img162/1292/03switchus1.jpg

    4. When you've found it - RB -> List switch cases and find there F3 value, and follow it.


    5. Below F3 case find first switch, select this line, RB -> Go to -> Case 3


    F3 03 - codes of Selected Char Info packet
    F3 05 - codes of Level Up packet

    In SelectedCharInfo proc we will find were is tored data of Current and Needed Exp

    6. Step into SelectedCharInfo proc. In that proc -> RB -> Go to -> Next Procedure. Then begin to scroll up until u find code like on the image


    Look at the underlined lines - EAX+10 and EAX+34, remember these offsets
    +10 and +34, +10 - for Current Exp, +34 - for needed Exp, these values may be different in different mains

    7. Now go back to the found procs SelectedCharInfo and LvlUp, and step into LvlUp function. RB -> go to -> next procedure. Once again scroll up until you find code like on the image


    Now look on the underlined line and remember what register you have there, i have EAX, remember it. Look below at the CALL, we will hook it. Now write somewhere this call command, or press SPACE and copy it.

    8. Now go to our empty space.
    We will need at list 1 register, but not the one that was mentioned in last step, EAX for is resereved (remember from last step?), i need value from it, so use another one(EBX, ECX, EDX). I used ECX. Since we gonna use it, we have to save data that this register contains, so we will use STACK, we will put value from ECX register and then we will restore it.
    Also we will need 1 byte memory for a flag, let's use our empty space =) I used offset 3 lines above of function, there I will store flag data. And don't forget to call the function that we have hooked =)
    Take a look on the code:


    Code:
    PUSH ECX ; save ECX data
    MOV ECX, [DWORD DS:EAX+34] ; get Needed Exp value (use your offset, mine is +34)
    MOV [DWORD DS:EAX+10], ECX ; set Current Exp value to Needed Exp value (use your offset, mine is +10)
    
    MOV [BYTE DS:8B690D5], 1 ; set flag
    POP ECX ; restore ECX data
    CALL 0047C040 ; we hooked that function, in step 7 you saved somewhere it, now you will have to write it here
    RETN ; return from the function
    Now remember the offset of the function beginning(0x08B690DD) and go to the place, that we have found in step 7(lvl up proc + hooked function, use "-" key =) )

    Now replace that call with the call to your function. Lvl up function is done, let's fix Obtained exp function =)

    9. Go to the first switch we have found and go to CASE 16 (22.)


    10. Step into the underlined function in the CASE 16 (22.), RB -> Go to -> Next procedure, and scroll up until u find code like on the image(You will meet 1 "Hash table full", it will help to find the code)



    Remember 2 lines marked with arrows.
    ADD ESI, ECX ; here obtained exp is added =)

    11. Go to the offset where we added our first function, and add second.
    First we have check our flag, if it's set, then we just skip ADD command, then reset flag, we will reset it no matter it was set or not =)
    Look at the code:


    Code:
    TEST [BYTE DS:8B690D5], 1 ; check flag
    JNZ SHORT 08B69102 ; if flag is set, then skip ADD command
    ADD ESI, ECX 
    MOV ECX, 55C4C20 ; these last 2 instructions we took from main, we remembered them in step 10
    MOV [BYTE DS:8B690D5], 0 ; reset flag
    RETN ; return from function
    Remember offset of second function(0x08B690F7).

    12. Go back to the function that adds Obtained Exp(step 10). Remember those 2 marked lines? NOP'em - select them -> Binary -> Fill with NOPs.
    Then Select first NOP and add there CALL to our second function.
    http://img237.imageshack.us/img237/350/12hookedob3.jpg

    And that's all, no more Exp Bar Bug =)

    Don't know about S3EP2 but for other mains will work

    Once again i used drakan mu server, thx them :D
    Last edited by Gembrid; 03-02-09 at 04:03 PM.


  2. #2
    Valued Member Postal is offline
    MemberRank
    Oct 2006 Join Date
    LithuaniaLocation
    124Posts

    Re: [Guide] Fixing Experience Bar Bug.

    Nice guide from you again. Thanks, it's fantastic. But 1 question, this guide for all versions?

  3. #3
    Let's do this... navossoc is offline
    MemberRank
    Sep 2004 Join Date
    BrazilLocation
    305Posts

    Re: [Guide] Fixing Experience Bar Bug.

    Tested and working on 1.02t...

    Just followed the guide...

    One problem only, olly2 don't have search of switches (yet)...

    Maybe has a better way, or a simple way to fix this...
    I don't have stopped to take a look at the code and analyse if has a better way!

    Anyway, works fine...
    Good work :)

    Ah!!! A tip:

    Alt+Shift+Number = Set Bookmark (very usefull)
    Alt+Number = Goto Bookmark

    []'s

  4. #4
    Valued Member levinthan9 is offline
    MemberRank
    May 2006 Join Date
    149Posts

    Re: [Guide] Fixing Experience Bar Bug.

    Tried on 1.04x main . It begin wrong when go to step 6.
    Anyway , I have 1 question. This's just fix the visual of exp bar only ?
    I have 1 problem . Cause of max level in my server is 800 900. So players usually gain to level 400 , 401 or more , they no get exp anymore . Some players pass all to lvl 800 , but some players stop at there. When that players kill mobs , they no get exp and mobs no drop anything. Can yours fix that ?

  5. #5
    Hybrid Gembrid is offline
    MemberRank
    Mar 2006 Join Date
    1,121Posts

    Re: [Guide] Fixing Experience Bar Bug.

    fisrt 1.04x is s3ep2 main
    second if u change max lvl in GS, you can't just change Max Lvl with just simple hexing, otherwise u will get bugs + if you have high rate server + some bugs with exp, and it's in GS

  6. #6
    Proficient Member eddydn is offline
    MemberRank
    May 2007 Join Date
    Arena CityLocation
    164Posts

    Re: [Guide] Fixing Experience Bar Bug.

    Quote Originally Posted by Gembrid View Post
    fisrt 1.04x is s3ep2 main
    second if u change max lvl in GS, you can't just change Max Lvl with just simple hexing, otherwise u will get bugs + if you have high rate server + some bugs with exp, and it's in GS
    Good Job pro ^^... Thanks for guides...... ;)...

    And the final... good luck to you.... ^^ You can next post guides of MuServer... Guides of you is best Guides ^^:poster_ss

  7. #7
    Hybrid Gembrid is offline
    MemberRank
    Mar 2006 Join Date
    1,121Posts

    Re: [Guide] Fixing Experience Bar Bug.

    guides for server, only if i'll upgrade my pc :D cause it's like in the hell: server + client + olly :D

  8. #8
    Proficient Member foveros is offline
    MemberRank
    Feb 2006 Join Date
    GreeceLocation
    195Posts

    Re: [Guide] Fixing Experience Bar Bug.

    when i secelct search for -> all switches i just get this http://www.imageshack.gr/view.php?fi...xmuj4lqkzt.png ? what is the problem? :S

  9. #9
    Hybrid Gembrid is offline
    MemberRank
    Mar 2006 Join Date
    1,121Posts

    Re: [Guide] Fixing Experience Bar Bug.

    open 'Executable modules' window and select there your main.exe, and search in main.exe, not in ntdll.dll =)

  10. #10
    Proficient Member foveros is offline
    MemberRank
    Feb 2006 Join Date
    GreeceLocation
    195Posts

    Re: [Guide] Fixing Experience Bar Bug.

    man i can't finish step 8! where did u find this empty space? is this one from the first page? cause i can't find this 08B6.....

  11. #11
    Hybrid Gembrid is offline
    MemberRank
    Mar 2006 Join Date
    1,121Posts

    Re: [Guide] Fixing Experience Bar Bug.

    press ctrl+end i your main

  12. #12
    Proficient Member foveros is offline
    MemberRank
    Feb 2006 Join Date
    GreeceLocation
    195Posts

    Re: [Guide] Fixing Experience Bar Bug.

    in step8 how did u write the code?
    Last edited by foveros; 30-05-08 at 06:30 AM.

  13. #13
    Hybrid Gembrid is offline
    MemberRank
    Mar 2006 Join Date
    1,121Posts

    Re: [Guide] Fixing Experience Bar Bug.

    use SPACE

  14. #14
    Proficient Member foveros is offline
    MemberRank
    Feb 2006 Join Date
    GreeceLocation
    195Posts

    Re: [Guide] Fixing Experience Bar Bug.


  15. #15
    Hybrid Gembrid is offline
    MemberRank
    Mar 2006 Join Date
    1,121Posts

    Re: [Guide] Fixing Experience Bar Bug.

    remove 'short'



Page 1 of 3 123 LastLast

Advertisement