How to remove the "BATTLE.NET" button.

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

0
No votes
 
Total votes: 0

User avatar
Elliot_009
Posts: 27
Joined: Tue Oct 17, 2006 7:43 am

How to remove the "BATTLE.NET" button.

Post by Elliot_009 » Wed Dec 20, 2006 4:18 pm

Blizzard did this one well. (It's at least easier than the panes in the game.)

See below.

/*
Always questions, am I... :mrgreen:

I'm looking to remove the "BATTLE.NET" button from the opening menu.

Has anyone done this before? I have looked through the code and searched on the forums but cannot find anything related to removing the buttons (though there are plenty of requests related to adding them to the 1.10s :D).

I could potentially find the LBUTTONCLICK event off the main page, but the drawing code really has me stumped.
*/


Thanks again,
Elliot_009
Last edited by Elliot_009 on Thu Dec 21, 2006 7:15 am, edited 5 times in total.

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12080
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: How could I remove the "BATTLE.NET" button?

Post by Myhrginoc » Thu Dec 21, 2006 2:29 am

I haven't done anything with disabling buttons, but that would be a useful trick! The menu button strings are towards the back of String.tbl: 0x13F3 for "BATTLE.NET" and 0x13FB for "OPEN BATTLE.NET" on the other multiplayer page. These index numbers would be called in d2launch.dll. The reason I suggest looking there is because the game already disables the CONVERT button (index 0x58CC) if you select an Expansion character (also in d2launch). If we knew how that was done, we should be able to do the same with either of these buttons.

These indexes are loaded into ECX and fed to d2lang.#10004 to get the actual string pointer.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: How could I remove the "BATTLE.NET" button?

Post by Nefarius » Thu Dec 21, 2006 4:44 am

I killed the button in 1.11b by tapping down the function that opens the closed-connection-dialog, and simply not calling it and returning false. Just removing the button doesnt prevent people from using -skiptobnet

The code is in D2Launch.dll in 1.11b
I dont want to post the offsets here, PM me, with the 1.11b layout you should be able to find it in 1.10 easily.
Last edited by Nefarius on Thu Dec 21, 2006 4:45 am, edited 1 time in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Elliot_009
Posts: 27
Joined: Tue Oct 17, 2006 7:43 am

Altering and/or removing menu screen buttons

Post by Elliot_009 » Thu Dec 21, 2006 6:42 am

I'm definitely going to have to take you up on that offer, Nefarius. Even with the buttons gone, that parameter would be a problem. :D

Also, a big thanks to Myhrginoc - I'd still be digging through D2Win trying to figure out where the D2Gfx.#10072 calls were coming from if you hadn't mentioned looking in D2Launch. :mrgreen:

For those interested, here's how blizzard put together the main menu(s).
__________________________________

The buttons are registered in hardcoded sequences in D2Launch using D2Win.#10017. D2Win.#10017 takes one parameter on the stack, a pointer to the following structure:

Code: Select all

ptBtnData (size:30)
+00	eType     (6 = D2WIN_BUTTON)
+04	Left
+08	Top
+0C	Width
+10	Height
+18	StringIndex
+1C	graphics table
     (not explored fully, but looks goofy if the width/height don't match this entry)
+20	Callback
This function is used to register many things besides buttons, however the nature of the other types is unknown to me at this time.

Breaking on 10017 usually yields the menu registration routine that is being switched to (the routine is only called when the menu is being changed, namely on button clicks), however, here is the main menu registration code:

Code: Select all

6FA1934A  |. 0F84 03010000  JE D2Launch.6FA19453                     ;  //- Begin Lod-specific (if no jump)
6FA19350     3BC3           CMP EAX,EBX                              ;  /- Miniroutine - Registers Gateway: %s Button
6FA19352     7C 1E          JL SHORT D2Launch.6FA19372               ;  |
6FA19354     68 24060000    PUSH 624                                 ;  |
6FA19359     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA1935E     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA19363     E8 C2F00000    CALL <JMP.&Fog.#10023>                   ;  |
6FA19368     83C4 0C        ADD ESP,0C                               ;  |
6FA1936B     6A FF          PUSH -1                                  ;  |
6FA1936D     E8 33F20000    CALL D2Launch.6FA285A5                   ;  |
6FA19372     68 003AA36F    PUSH D2Launch.6FA33A00                   ;  |
6FA19377     E8 DCEF0000    CALL <JMP.&D2Win.#10017>                 ;  |
6FA1937C     8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]          ;  |/- Text?
6FA19382     A3 08CDA36F    MOV DWORD PTR DS:[6FA3CD08],EAX          ;  ||
6FA19387     89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX    ;  ||
6FA1938E     41             INC ECX                                  ;  ||
6FA1938F     890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX          ;  ||
6FA19395     E8 26940000    CALL D2Launch.6FA227C0                   ;  \\
6FA1939A     391D B8D0A36F  CMP DWORD PTR DS:[6FA3D0B8],EBX          ;  /- Miniroutine - Registers Battle.net Button
6FA193A0     7C 1E          JL SHORT D2Launch.6FA193C0               ;  |
6FA193A2     68 24060000    PUSH 624                                 ;  |
6FA193A7     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA193AC     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA193B1     E8 74F00000    CALL <JMP.&Fog.#10023>                   ;  |
6FA193B6     83C4 0C        ADD ESP,0C                               ;  |
6FA193B9     6A FF          PUSH -1                                  ;  |
6FA193BB     E8 E5F10000    CALL D2Launch.6FA285A5                   ;  |
6FA193C0     68 D039A36F    PUSH D2Launch.6FA339D0                   ;  |
6FA193C5     E8 8EEF0000    CALL <JMP.&D2Win.#10017>                 ;  \-
6FA193CA     8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA193D0     8BF8           MOV EDI,EAX
6FA193D2     89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA193D9     41             INC ECX
6FA193DA     3BCB           CMP ECX,EBX
6FA193DC     890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA193E2     7C 1E          JL SHORT D2Launch.6FA19402               ;  /- Miniroutine - Registers Other Multiplayer Button
6FA193E4     68 24060000    PUSH 624                                 ;  |
6FA193E9     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA193EE     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA193F3     E8 32F00000    CALL <JMP.&Fog.#10023>                   ;  |
6FA193F8     83C4 0C        ADD ESP,0C                               ;  |
6FA193FB     6A FF          PUSH -1                                  ;  |
6FA193FD     E8 A3F10000    CALL D2Launch.6FA285A5                   ;  |
6FA19402     68 303AA36F    PUSH D2Launch.6FA33A30                   ;  |
6FA19407     E8 4CEF0000    CALL <JMP.&D2Win.#10017>                 ;  \-
6FA1940C  |. 8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA19412  |. 8BF0           MOV ESI,EAX
6FA19414  |. 89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1941B  |. 41             INC ECX
6FA1941C  |. 3BCB           CMP ECX,EBX
6FA1941E  |. 890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA19424     7C 1E          JL SHORT D2Launch.6FA19444               ;  /- Miniroutine - Registers Single Player Button
6FA19426     68 24060000    PUSH 624                                 ;  |
6FA1942B     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA19430     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA19435     E8 F0EF0000    CALL <JMP.&Fog.#10023>                   ;  |
6FA1943A     83C4 0C        ADD ESP,0C                               ;  |
6FA1943D     6A FF          PUSH -1                                  ;  |
6FA1943F     E8 61F10000    CALL D2Launch.6FA285A5                   ;  |
6FA19444     68 A039A36F    PUSH D2Launch.6FA339A0                   ;  |
6FA19449     E8 0AEF0000    CALL <JMP.&D2Win.#10017>                 ;  \-
6FA1944E  |. E9 FE000000    JMP D2Launch.6FA19551                    ;  \\- Miniroutine - END Lod-specific
6FA19453  |> 3BC3           CMP EAX,EBX                              ;  //- Miniroutine - BEGIN non-Lod
6FA19455     7C 1E          JL SHORT D2Launch.6FA19475
6FA19457     68 24060000    PUSH 624
6FA1945C     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA19461     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA19466     E8 BFEF0000    CALL <JMP.&Fog.#10023>
6FA1946B     83C4 0C        ADD ESP,0C
6FA1946E     6A FF          PUSH -1
6FA19470     E8 30F10000    CALL D2Launch.6FA285A5
6FA19475     68 8038A36F    PUSH D2Launch.6FA33880
6FA1947A     E8 D9EE0000    CALL <JMP.&D2Win.#10017>
6FA1947F  |. 8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA19485  |. 8BF8           MOV EDI,EAX
6FA19487  |. 89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1948E  |. 41             INC ECX
6FA1948F  |. 3BCB           CMP ECX,EBX
6FA19491  |. 890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA19497  |. 7C 1E          JL SHORT D2Launch.6FA194B7
6FA19499  |. 68 24060000    PUSH 624
6FA1949E  |. 68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA194A3  |. 68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA194A8  |. E8 7DEF0000    CALL <JMP.&Fog.#10023>
6FA194AD  |. 83C4 0C        ADD ESP,0C
6FA194B0  |. 6A FF          PUSH -1
6FA194B2  |. E8 EEF00000    CALL D2Launch.6FA285A5
6FA194B7  |> 68 B038A36F    PUSH D2Launch.6FA338B0
6FA194BC  |. E8 97EE0000    CALL <JMP.&D2Win.#10017>
6FA194C1  |. 8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA194C7  |. A3 08CDA36F    MOV DWORD PTR DS:[6FA3CD08],EAX
6FA194CC  |. 89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA194D3  |. 41             INC ECX
6FA194D4  |. 890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA194DA  |. E8 E1920000    CALL D2Launch.6FA227C0
6FA194DF  |. 391D B8D0A36F  CMP DWORD PTR DS:[6FA3D0B8],EBX
6FA194E5  |. 7C 1E          JL SHORT D2Launch.6FA19505
6FA194E7  |. 68 24060000    PUSH 624
6FA194EC  |. 68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA194F1  |. 68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA194F6  |. E8 2FEF0000    CALL <JMP.&Fog.#10023>
6FA194FB  |. 83C4 0C        ADD ESP,0C
6FA194FE  |. 6A FF          PUSH -1
6FA19500  |. E8 A0F00000    CALL D2Launch.6FA285A5
6FA19505  |> 68 5038A36F    PUSH D2Launch.6FA33850
6FA1950A  |. E8 49EE0000    CALL <JMP.&D2Win.#10017>
6FA1950F  |. 8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA19515  |. 89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1951C  |. 41             INC ECX
6FA1951D  |. 3BCB           CMP ECX,EBX
6FA1951F  |. 890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA19525  |. 7C 1E          JL SHORT D2Launch.6FA19545
6FA19527  |. 68 24060000    PUSH 624
6FA1952C  |. 68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA19531  |. 68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA19536  |. E8 EFEE0000    CALL <JMP.&Fog.#10023>
6FA1953B  |. 83C4 0C        ADD ESP,0C
6FA1953E  |. 6A FF          PUSH -1
6FA19540  |. E8 60F00000    CALL D2Launch.6FA285A5
6FA19545  |> 68 E038A36F    PUSH D2Launch.6FA338E0
6FA1954A  |. E8 09EE0000    CALL <JMP.&D2Win.#10017>
6FA1954F  |. 8BF0           MOV ESI,EAX                              ;  \\- END non-Lod
6FA19551  |> 8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA19557  |. 89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1955E  |. 41             INC ECX
6FA1955F  |. 890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA19565  |. E8 12EE0000    CALL <JMP.&D2Win.#10185>
6FA1956A  |. 85C0           TEST EAX,EAX
6FA1956C  |. 74 1F          JE SHORT D2Launch.6FA1958D
6FA1956E  |. 33D2           XOR EDX,EDX
6FA19570  |. 8BCF           MOV ECX,EDI
6FA19572  |. E8 03ED0000    CALL <JMP.&D2Win.#10025>
6FA19577  |. 33D2           XOR EDX,EDX
6FA19579  |. 8BCE           MOV ECX,ESI
6FA1957B  |. E8 FAEC0000    CALL <JMP.&D2Win.#10025>
6FA19580  |. 8B0D 08CDA36F  MOV ECX,DWORD PTR DS:[6FA3CD08]
6FA19586  |. 33D2           XOR EDX,EDX
6FA19588  |. E8 EDEC0000    CALL <JMP.&D2Win.#10025>
6FA1958D  |> 391D B8D0A36F  CMP DWORD PTR DS:[6FA3D0B8],EBX
6FA19593     7C 1E          JL SHORT D2Launch.6FA195B3               ;  /- Miniroutine - Register Credits Button
6FA19595     68 24060000    PUSH 624                                 ;  |
6FA1959A     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA1959F     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA195A4     E8 81EE0000    CALL <JMP.&Fog.#10023>                   ;  |
6FA195A9     83C4 0C        ADD ESP,0C                               ;  |
6FA195AC     6A FF          PUSH -1                                  ;  |
6FA195AE     E8 F2EF0000    CALL D2Launch.6FA285A5                   ;  |
6FA195B3     68 1039A36F    PUSH D2Launch.6FA33910                   ;  |
6FA195B8     E8 9BED0000    CALL <JMP.&D2Win.#10017>                 ;  \-
6FA195BD  |. 8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA195C3  |. 89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA195CA  |. 41             INC ECX
6FA195CB  |. 3BCB           CMP ECX,EBX
6FA195CD  |. 890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA195D3     7C 1E          JL SHORT D2Launch.6FA195F3               ;  /- Miniroutine - Registers Cinematics Button
6FA195D5     68 24060000    PUSH 624                                 ;  |
6FA195DA     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA195DF     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA195E4     E8 41EE0000    CALL <JMP.&Fog.#10023>                   ;  |
6FA195E9     83C4 0C        ADD ESP,0C                               ;  |
6FA195EC     6A FF          PUSH -1                                  ;  |
6FA195EE     E8 B2EF0000    CALL D2Launch.6FA285A5                   ;  |
6FA195F3     68 4039A36F    PUSH D2Launch.6FA33940                   ;  |
6FA195F8     E8 5BED0000    CALL <JMP.&D2Win.#10017>                 ;  \-
6FA195FD  |. 8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA19603  |. 89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1960A  |. 41             INC ECX
6FA1960B  |. 3BCB           CMP ECX,EBX
6FA1960D  |. 890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA19613     7C 1E          JL SHORT D2Launch.6FA19633               ;  /- Miniroutine - Registers Exit Diablo II Button
6FA19615     68 24060000    PUSH 624                                 ;  |
6FA1961A     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA1961F     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA19624     E8 01EE0000    CALL <JMP.&Fog.#10023>                   ;  |
6FA19629     83C4 0C        ADD ESP,0C                               ;  |
6FA1962C     6A FF          PUSH -1                                  ;  |
6FA1962E     E8 72EF0000    CALL D2Launch.6FA285A5                   ;  |
6FA19633     68 7039A36F    PUSH D2Launch.6FA33970                   ;  |
6FA19638     E8 1BED0000    CALL <JMP.&D2Win.#10017>                 ;  \-
6FA1963D  |. 8B0D B8D0A36F  MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA19643  |. 89048D D8CAA36>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1964A  |. 41             INC ECX
6FA1964B  |. 3BCB           CMP ECX,EBX
6FA1964D  |. 890D B8D0A36F  MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA19653     7C 1E          JL SHORT D2Launch.6FA19673
6FA19655     68 24060000    PUSH 624
6FA1965A     68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA1965F     68 EC75A36F    PUSH D2Launch.6FA375EC                   ;  ASCII "sgnNumChildren < MAX_CHILDREN"
6FA19664     E8 C1ED0000    CALL <JMP.&Fog.#10023>
6FA19669     83C4 0C        ADD ESP,0C
6FA1966C     6A FF          PUSH -1
6FA1966E     E8 32EF0000    CALL D2Launch.6FA285A5
6FA19673     68 906AA36F    PUSH D2Launch.6FA36A90
6FA19678     E8 DBEC0000    CALL <JMP.&D2Win.#10017>
6FA1967D  |. 8BF8           MOV EDI,EAX
6FA1967F  |. A1 B8D0A36F    MOV EAX,DWORD PTR DS:[6FA3D0B8]
6FA19684  |. 893C85 D8CAA36>MOV DWORD PTR DS:[EAX*4+6FA3CAD8],EDI
6FA1968B  |. 40             INC EAX
6FA1968C  |. A3 B8D0A36F    MOV DWORD PTR DS:[6FA3D0B8],EAX
6FA19691  |. A1 F4B7A36F    MOV EAX,DWORD PTR DS:[6FA3B7F4]
6FA19696  |. 85C0           TEST EAX,EAX
6FA19698  |. 75 1E          JNZ SHORT D2Launch.6FA196B8
6FA1969A  |. 68 FC090000    PUSH 9FC
6FA1969F  |. 68 AC75A36F    PUSH D2Launch.6FA375AC                   ;  ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA196A4  |. 68 7076A36F    PUSH D2Launch.6FA37670                   ;  ASCII "gptComInt != NULL"
6FA196A9  |. E8 7CED0000    CALL <JMP.&Fog.#10023>
6FA196AE  |. 83C4 0C        ADD ESP,0C
6FA196B1  |. 6A FF          PUSH -1
6FA196B3  |. E8 EDEE0000    CALL D2Launch.6FA285A5
6FA196B8  |> FF50 5C        CALL DWORD PTR DS:[EAX+5C]
6FA196BB  |. 8B0D 44CDA36F  MOV ECX,DWORD PTR DS:[6FA3CD44]
6FA196C1  |. 8BF0           MOV ESI,EAX
6FA196C3  |. 8A81 1E020000  MOV AL,BYTE PTR DS:[ECX+21E]
6FA196C9  |. 84C0           TEST AL,AL
6FA196CB  |. 74 33          JE SHORT D2Launch.6FA19700
6FA196CD  |. 8B15 F4B7A36F  MOV EDX,DWORD PTR DS:[6FA3B7F4]          ;  Bnclient.6FF19E70
6FA196D3  |. FF92 B0000000  CALL DWORD PTR DS:[EDX+B0]
6FA196D9  |. 0FBEC8         MOVSX ECX,AL
6FA196DC  |. 8BC6           MOV EAX,ESI
6FA196DE  |. BE 64000000    MOV ESI,64
6FA196E3  |. 99             CDQ
6FA196E4  |. F7FE           IDIV ESI
6FA196E6  |. 51             PUSH ECX
6FA196E7  |. 40             INC EAX
6FA196E8  |. 52             PUSH EDX
6FA196E9  |. 50             PUSH EAX
6FA196EA  |. 68 6076A36F    PUSH D2Launch.6FA37660                   ;  ASCII "v %d.%02d %d"
6FA196EF  |. 8D4424 1C      LEA EAX,DWORD PTR SS:[ESP+1C]
6FA196F3  |. 6A 20          PUSH 20
6FA196F5  |. 50             PUSH EAX
6FA196F6  |. E8 07EE0000    CALL <JMP.&Storm.#578>
6FA196FB  |. 83C4 18        ADD ESP,18
6FA196FE  |. EB 21          JMP SHORT D2Launch.6FA19721
6FA19700  |> 8BC6           MOV EAX,ESI
6FA19702  |. B9 64000000    MOV ECX,64
6FA19707  |. 99             CDQ
6FA19708  |. F7F9           IDIV ECX
6FA1970A  |. 40             INC EAX
6FA1970B  |. 52             PUSH EDX
6FA1970C  |. 50             PUSH EAX
6FA1970D  |. 68 5476A36F    PUSH D2Launch.6FA37654                   ;  ASCII "v %d.%02d"
6FA19712  |. 8D5424 18      LEA EDX,DWORD PTR SS:[ESP+18]
6FA19716  |. 6A 20          PUSH 20
6FA19718  |. 52             PUSH EDX
6FA19719  |. E8 E4ED0000    CALL <JMP.&Storm.#578>
6FA1971E  |. 83C4 14        ADD ESP,14
6FA19721  |> 6A 00          PUSH 0
6FA19723  |. 8D5424 10      LEA EDX,DWORD PTR SS:[ESP+10]
6FA19727  |. 8BCF           MOV ECX,EDI
6FA19729  |. E8 88EB0000    CALL <JMP.&D2Win.#10046>
6FA1972E  |. E8 D5EA0000    CALL <JMP.&D2Sound.#10069>
6FA19733  |. 85C0           TEST EAX,EAX
6FA19735  |. 74 0A          JE SHORT D2Launch.6FA19741
6FA19737  |. B9 01000000    MOV ECX,1
6FA1973C  |. E8 C1EA0000    CALL <JMP.&D2Sound.#10034>
6FA19741  |> 5F             POP EDI
6FA19742  |. 5E             POP ESI
6FA19743  |. 5B             POP EBX
6FA19744  |. 83C4 20        ADD ESP,20
6FA19747  \. C3             RETN
It should be noted that while changing the contents of the structures whose addresses are passed as the first arguement to 10017 is trivial, removing a button entirely is a little more complicated (but really not much more).

Note that after every button registration, we add one to [6FA3D0B8]. I believe this to be a button counter. If we remove a button and still increment, there will be an access violation somewhere down the line (D2Win code, where all this is used). If we don't increment and add a button, I can only assume that one will not be displayed, as I haven't tried it.
__________________

Originally, my intent was to remove the "battle.net" and "gateway: ..." buttons completely and shift the "other multiplayer" button up so that they didn't look disjoint. After some consideration, however, with the extra space one can put the "open battle.net" and "tcp/ip" buttons from the "other multiplayer" screen right on the main screen.

EDIT: /* Don't do this, yet. There's an assertion failure "pCel" when the TCP/IP button is clicked. :mrgreen: If you want to just remove and reposition the buttons, that works, but changing screens could cause problems. Oddly enough, this only occurs after a game has been exited once (back to the menu screen), but still... */

Okay, it works now. The buttons are somewhat hardcoded in places I didn't anticipate, so (unless you can find them, and more power to you if so) don't use buttons on screens that they didn't originally belong on. I haven't tried making entirely new buttons, though.


Modifications to main screen registration routine:
{Removes "gateway: ..." button}

Code: Select all

6FA19300   A1 F4B7A36F      MOV EAX,DWORD PTR DS:[6FA3B7F4]
6FA19305   FF50 70          CALL DWORD PTR DS:[EAX+70]
6FA19308   C705 D4CAA36F 01>MOV DWORD PTR DS:[6FA3CAD4],1
6FA19312   E8 09000000      CALL D2Launch.6FA19320
6FA19317   B8 01000000      MOV EAX,1
6FA1931C   C2 0400          RETN 4
6FA1931F   90               NOP
6FA19320   83EC 20          SUB ESP,20
6FA19323   53               PUSH EBX
6FA19324   56               PUSH ESI
6FA19325   57               PUSH EDI
6FA19326   E8 C589FFFF      CALL D2Launch.6FA11CF0
6FA1932B   A1 44CDA36F      MOV EAX,DWORD PTR DS:[6FA3CD44]
6FA19330   C640 32 00       MOV BYTE PTR DS:[EAX+32],0
6FA19334   E8 B7ED0000      CALL D2Launch.6FA280F0
6FA19339   E8 F8F00000      CALL <JMP.&Fog.#10227>
6FA1933E   85C0             TEST EAX,EAX
6FA19340   A1 B8D0A36F      MOV EAX,DWORD PTR DS:[6FA3D0B8]
6FA19345   BB 40000000      MOV EBX,40
6FA1934A   0F84 03010000    JE D2Launch.6FA19453
6FA19350   EB 48            JMP SHORT D2Launch.6FA1939A
6FA19352   90               NOP
6FA19353   90               NOP
6FA19354   90               NOP
6FA19355   90               NOP
6FA19356   90               NOP
6FA19357   90               NOP
6FA19358   90               NOP
6FA19359   68 AC75A36F      PUSH D2Launch.6FA375AC                   ; ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA1935E   68 EC75A36F      PUSH D2Launch.6FA375EC                   ; ASCII "sgnNumChildren < MAX_CHILDREN"
6FA19363   E8 C2F00000      CALL <JMP.&Fog.#10023>
6FA19368   83C4 0C          ADD ESP,0C
6FA1936B   6A FF            PUSH -1
6FA1936D   E8 33F20000      CALL D2Launch.6FA285A5
6FA19372   68 003AA36F      PUSH D2Launch.6FA33A00
6FA19377   E8 DCEF0000      CALL <JMP.&D2Win.#10017>
6FA1937C   8B0D B8D0A36F    MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA19382   A3 08CDA36F      MOV DWORD PTR DS:[6FA3CD08],EAX
6FA19387   89048D D8CAA36F  MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1938E   41               INC ECX
6FA1938F   890D B8D0A36F    MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA19395   E8 26940000      CALL D2Launch.6FA227C0
6FA1939A   391D B8D0A36F    CMP DWORD PTR DS:[6FA3D0B8],EBX
6FA193A0   7C 1E            JL SHORT D2Launch.6FA193C0
6FA193A2   68 24060000      PUSH 624
6FA193A7   68 AC75A36F      PUSH D2Launch.6FA375AC                   ; ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA193AC   68 EC75A36F      PUSH D2Launch.6FA375EC                   ; ASCII "sgnNumChildren < MAX_CHILDREN"
6FA193B1   E8 74F00000      CALL <JMP.&Fog.#10023>
6FA193B6   83C4 0C          ADD ESP,0C
6FA193B9   6A FF            PUSH -1
6FA193BB   E8 E5F10000      CALL D2Launch.6FA285A5
6FA193C0   68 D039A36F      PUSH D2Launch.6FA339D0
6FA193C5   E8 8EEF0000      CALL <JMP.&D2Win.#10017>
6FA193CA   8B0D B8D0A36F    MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA193D0   3E:89048D D8CAA3>MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA193D8   90               NOP
6FA193D9   41               INC ECX
6FA193DA   3BCB             CMP ECX,EBX
6FA193DC   890D B8D0A36F    MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA193E2   7C 1E            JL SHORT D2Launch.6FA19402
6FA193E4   68 24060000      PUSH 624
6FA193E9   68 AC75A36F      PUSH D2Launch.6FA375AC                   ; ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA193EE   68 EC75A36F      PUSH D2Launch.6FA375EC                   ; ASCII "sgnNumChildren < MAX_CHILDREN"
6FA193F3   E8 32F00000      CALL <JMP.&Fog.#10023>
6FA193F8   83C4 0C          ADD ESP,0C
6FA193FB   6A FF            PUSH -1
6FA193FD   E8 A3F10000      CALL D2Launch.6FA285A5
6FA19402   68 303AA36F      PUSH D2Launch.6FA33A30
6FA19407   E8 4CEF0000      CALL <JMP.&D2Win.#10017>
6FA1940C   8B0D B8D0A36F    MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA19412   8BF0             MOV ESI,EAX
6FA19414   89048D D8CAA36F  MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1941B   41               INC ECX
6FA1941C   3BCB             CMP ECX,EBX
6FA1941E   890D B8D0A36F    MOV DWORD PTR DS:[6FA3D0B8],ECX
Modifications to the "battle.net" and "other multiplayer" buttons:
{Changes strings to "open battle.net" and "tcp/ip"
Changes callbacks to appropriate callbacks
Changes position of buttons and buttongraphics of "battle.net"}

Code: Select all

6FA339D0  06 00 00 00 08 01 00 00 6E 01 00 00 10 01 00 00  .....n....
6FA339E0  23 00 00 00 00 00 00 00 FB 13 00 00 AC CE A3 6F  #.......û..¬Î£o
6FA339F0  C0 ED A1 6F 00 00 00 00 00 00 00 00 00 00 00 00  Àí¡o............
...
6FA33A30  06 00 00 00 08 01 00 00 98 01 00 00 10 01 00 00  .....˜....
6FA33A40  23 00 00 00 00 00 00 00 FC 13 00 00 AC CE A3 6F  #.......ü..¬Î£o
6FA33A50  B0 1F A2 6F 00 00 00 00 00 00 00 00 00 00 00 00  °¢o............
Modification of callback used by cancel button (TCP/IP) screen:
{Returns to main menu instead of other multiplayer screen}

Code: Select all

6FA36880  06 00 00 00 27 00 00 00 3B 02 00 00 80 00 00 00  ...'...;..€...
6FA36890  23 00 00 00 1B 00 00 00 EF 13 00 00 B0 CE A3 6F  #......ï..°Î£o
6FA368A0  90 60 A2 6F 00 00 00 00 00 00 00 00 00 00 00 00  �`¢o............
The missing part would now be the callback of any cancel button on the open battle.net screen, but I cannot look into that (long story, but yes, I do own a legal copy - it's in four pieces in a box in my room :( ).
__________________________________

I hope someone finds this useful and am looking forward to seeing new menu designs in the mods. :D

Thanks for all the help,
Elliot_009
Last edited by Elliot_009 on Fri Dec 22, 2006 8:15 pm, edited 6 times in total.

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12080
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: How to remove the "BATTLE.NET" button.

Post by Myhrginoc » Sat Dec 23, 2006 3:36 pm

Nice work! :bravo:

There might be a "page index" table in the dll that is checked by the button code. If you replaced the Battle.net button on the main page with a TCP/IP button, then you would have two paths: one from the main page and one from the "other multiplayer" page. Comparing the program flow through each route ought to find the code that checks the calling page index.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Necrolis
Senior Admin
Throne
Posts: 9106
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Post by Necrolis » Sat Dec 22, 2007 4:51 pm

This resurrection was kindly sponsored by you friendly forum Necromancer :P(actually its here cause it the best place for it)
this code might be useful for anyone who's used this edit (so you can make the cancel buttons on the tcp/ip screen go the main menu, and open bnet if so chosen.

Code: Select all

TCP/IP Main
6FA1A358    68 8068A36F     PUSH d2launch.6FA36880                   ; cancel

6FA1A239    68 F067A36F     PUSH d2launch.6FA367F0                   ; join game

6FA1A1F4    68 C067A36F     PUSH d2launch.6FA367C0                   ; host game

MP Game Type Selection
6FA1EF30    E8 BB910000     CALL d2launch.6FA280F0
6FA1EF35    833D B8D0A36F 4>CMP DWORD PTR DS:[6FA3D0B8],40
6FA1EF3C    7C 1E           JL SHORT d2launch.6FA1EF5C
6FA1EF3E    68 24060000     PUSH 624
6FA1EF43    68 AC75A36F     PUSH d2launch.6FA375AC                   ; ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA1EF48    68 EC75A36F     PUSH d2launch.6FA375EC                   ; ASCII "sgnNumChildren < MAX_CHILDREN"
6FA1EF4D    E8 D8940000     CALL <JMP.&Fog.#10023>
6FA1EF52    83C4 0C         ADD ESP,0C
6FA1EF55    6A FF           PUSH -1
6FA1EF57    E8 49960000     CALL d2launch.6FA285A5
6FA1EF5C    68 7066A36F     PUSH d2launch.6FA36670                   ; open b.net
6FA1EF61    E8 F2930000     CALL <JMP.&D2Win.#10017>
6FA1EF66    8B0D B8D0A36F   MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA1EF6C    89048D D8CAA36F MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1EF73    41              INC ECX
6FA1EF74    83F9 40         CMP ECX,40
6FA1EF77    890D B8D0A36F   MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA1EF7D    7C 1E           JL SHORT d2launch.6FA1EF9D
6FA1EF7F    68 24060000     PUSH 624
6FA1EF84    68 AC75A36F     PUSH d2launch.6FA375AC                   ; ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA1EF89    68 EC75A36F     PUSH d2launch.6FA375EC                   ; ASCII "sgnNumChildren < MAX_CHILDREN"
6FA1EF8E    E8 97940000     CALL <JMP.&Fog.#10023>
6FA1EF93    83C4 0C         ADD ESP,0C
6FA1EF96    6A FF           PUSH -1
6FA1EF98    E8 08960000     CALL d2launch.6FA285A5
6FA1EF9D    68 A066A36F     PUSH d2launch.6FA366A0                   ; tcp/ip
6FA1EFA2    E8 B1930000     CALL <JMP.&D2Win.#10017>
6FA1EFA7    8B0D B8D0A36F   MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA1EFAD    89048D D8CAA36F MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1EFB4    41              INC ECX
6FA1EFB5    83F9 40         CMP ECX,40
6FA1EFB8    890D B8D0A36F   MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA1EFBE    7C 1E           JL SHORT d2launch.6FA1EFDE
6FA1EFC0    68 24060000     PUSH 624
6FA1EFC5    68 AC75A36F     PUSH d2launch.6FA375AC                   ; ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA1EFCA    68 EC75A36F     PUSH d2launch.6FA375EC                   ; ASCII "sgnNumChildren < MAX_CHILDREN"
6FA1EFCF    E8 56940000     CALL <JMP.&Fog.#10023>
6FA1EFD4    83C4 0C         ADD ESP,0C
6FA1EFD7    6A FF           PUSH -1
6FA1EFD9    E8 C7950000     CALL d2launch.6FA285A5
6FA1EFDE    68 D066A36F     PUSH d2launch.6FA366D0                   ; cancel
6FA1EFE3    E8 70930000     CALL <JMP.&D2Win.#10017>
6FA1EFE8    8B0D B8D0A36F   MOV ECX,DWORD PTR DS:[6FA3D0B8]
6FA1EFEE    89048D D8CAA36F MOV DWORD PTR DS:[ECX*4+6FA3CAD8],EAX
6FA1EFF5    41              INC ECX
6FA1EFF6    890D B8D0A36F   MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA1EFFC    B8 01000000     MOV EAX,1
6FA1F001    C2 0400         RETN 4

these use the struct posted above
goto main menu cancel
6FA366D0  06 00 00 00 08 01 00 00  .....
6FA366D8  38 02 00 00 10 01 00 00  8....
6FA366E0  23 00 00 00 1B 00 00 00  #......
6FA366E8  EF 13 00 00 AC CE A3 6F  ï..¬Î£o
6FA366F0  90 60 A2 6F 00 00 00 00
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
HashCasper
Posts: 263
Joined: Mon Apr 28, 2003 6:46 am
Location: Baton Rouge, LA
Contact:

Post by HashCasper » Sun May 04, 2008 4:37 pm

Could this be made into a d2mod plug in? (I know that it can, but I don't have access to the SDK)
"We have a point to work to, to make our nation huge; make our home stretch around the world, increase our army too. We must take over the world, make it our own, the Earth we must control, so you can't F#CK it anymore." --Mathew Chalk--

User avatar
Necrolis
Senior Admin
Throne
Posts: 9106
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Post by Necrolis » Sat May 10, 2008 1:06 pm

HashCasper";p="386465" wrote:Could this be made into a d2mod plug in? (I know that it can, but I don't have access to the SDK)
This is abit more complicated to get into a plugin(like which menus, what parts of the buttons, new txt etc.) if you can make a good proposal i'll look into it :)
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
MagicMatze
Junior Member
Champion of the Light
Posts: 324
Joined: Sun Jan 25, 2004 8:53 pm
Location: Good old Germany
Germany

Post by MagicMatze » Sun Nov 23, 2008 2:58 pm

I have NOPt out the gateway button successfully but have no idea how to remove the battle.net button. Your codes went up to 6FA36xxxx but mine ends with 6FA30xxxx.
So I cannot look up the code to make changes for:
Modifications to the "battle.net" and "other multiplayer" buttons:
{Changes strings to "open battle.net" and "tcp/ip"
Changes callbacks to appropriate callbacks
Changes position of buttons and buttongraphics of "battle.net"}

edit:
I am following the Code Editing Tutorial for changing/adding normal difficulty text to the screen - but to find the BATTLE.NET string key in D2Launch.dll. I have set a breakpoint as the tutorial says (ECX=13F3 for BATTLE.NET string) but it seems this breakpoint won't be triggered?
Anyone who can give me a hint for finding the correct button for disabling?

edit2:
Have found the button at 6FA19407:

Code: Select all

6FA193E2   7C 1E            JL SHORT D2Launch.6FA19402
6FA193E4   68 24060000      PUSH 624
6FA193E9   68 AC75A36F      PUSH D2Launch.6FA375AC                   ; ASCII "C:\projects\D2\head\Diablo2\Source\D2Launch\Src\MainMenus.cpp"
6FA193EE   68 EC75A36F      PUSH D2Launch.6FA375EC                   ; ASCII "sgnNumChildren < MAX_CHILDREN"
6FA193F3   E8 32F00000      CALL <JMP.&Fog.#10023>
6FA193F8   83C4 0C          ADD ESP,0C
6FA193FB   6A FF            PUSH -1
6FA193FD   E8 A3F10000      CALL D2Launch.6FA285A5
6FA19402   68 303AA36F      PUSH D2Launch.6FA33A30
6FA19407   E8 4CEF0000      CALL <JMP.&D2Win.#10017>

But I have no idea how to remove 'em?

btw: all my code is v1.10
Last edited by MagicMatze on Sun Nov 23, 2008 8:36 pm, edited 2 times in total.

User avatar
Necrolis
Senior Admin
Throne
Posts: 9106
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Post by Necrolis » Sun Nov 23, 2008 9:35 pm

remove the button like the others, make it jump over the code that adds it to the chain(it looks the same as the others)
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
MagicMatze
Junior Member
Champion of the Light
Posts: 324
Joined: Sun Jan 25, 2004 8:53 pm
Location: Good old Germany
Germany

Post by MagicMatze » Sun Nov 23, 2008 9:38 pm

Have set a breakpoint to

Code: Select all

 6FA19407   E8 4CEF0000      CALL <JMP.&D2Win.#10017> 
then clicked the battle.net button and game paused. Then NOP the code out and then the Other Multiplayer button disappered?!

Will try it tomorrow again - too much code editing for today :x

edit:
Think the code above isn't the battle.net button. Found similar else:

Code: Select all

6FA1964B   3BCB             CMP ECX,EBX
6FA1964D   890D B8D0A36F    MOV DWORD PTR DS:[6FA3D0B8],ECX
6FA19653   7C 1E            JL SHORT D2Launch.6FA19673
6FA19655   68 24060000      PUSH 624
Changed it to:

Code: Select all

6FA1964B   E9 17010000      JMP D2Launch.6FA19767
6FA19650   90               NOP
6FA19651   90               NOP
6FA19652   90               NOP
6FA19653   90               NOP
6FA19654   90               NOP
6FA19655   90               NOP
6FA19656   90               NOP
6FA19657   90               NOP
6FA19658   90               NOP
6FA19659   90               NOP
(long ranged jump to

Code: Select all

6FA19767   3BC3             CMP EAX,EBX
but game crashed...

A little help for finding and solving this problem would be very nice.
Last edited by MagicMatze on Mon Nov 24, 2008 11:48 am, edited 1 time in total.

User avatar
MagicMatze
Junior Member
Champion of the Light
Posts: 324
Joined: Sun Jan 25, 2004 8:53 pm
Location: Good old Germany
Germany

Post by MagicMatze » Thu Nov 27, 2008 4:47 pm

Instead of removing this button I followed Elliot_009s post: Replacing the battle.net button with Open B.net and changing callback of cancel button from TCP/IP menu.
I edited D2Launch.dll and went to the button location with CTRL+G. The changed did work but I cannot save it. The whole dll file went to another structure and with other offsets. If I save it to a txt file, it has a greater size than the dll should have.

Any workaround?

User avatar
Necrolis
Senior Admin
Throne
Posts: 9106
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Post by Necrolis » Sat Nov 29, 2008 3:56 pm

do a static edit(though it should save as those aren't dynamic datatables that the buttons are read from). btw the window is only draw once, and D2Win.#10017 -> D2CreateWindow(D2WindowParamsStrc* pParams), is called when the NEXT window is draw, so you breakpoint BEFORE the window you want is drawn.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
Wuffie
Posts: 12
Joined: Sat Mar 24, 2007 1:28 am

Re: How to remove the "BATTLE.NET" button.

Post by Wuffie » Sun Nov 30, 2008 10:26 am

No idea if this will help but looking over my old notes on main menu buttons I found this stuff to do with the button flags, or code bits that define how the buttons are aliened and work

Code: Select all

How button signature/code is worked out

#1 00 00 00 #2 00 00 00 #3 00 00 00 #4 00 00 00
#5 00 00 00 #6 00 00 00 #7 00 00 00 #8 CE A3 6F
#9 #9 A1 6F 00 00 00 00 00 00 00 00 00 00 00 00

#1 06 : bit flag stating button?
#2 XX XX : pixels from left 
#3 XX XX : pixels from TOP (i think)
#4 XX XX : Lenght of the button
#5 19 or 23 : Font size :)
#6 :S not sure
#7 XX XX : String referance... change this to existing string and not need to edit strings table
#8 B0 - CC : button border/style (dc6 table!?)
CE A3 6F denotes end of styling of button (i think)
#9 XX XX : button funcion code 
A1 (not figured it out yet but its eather a1 or a2)
6F : end of button
Example of this here

Code: Select all

Modifications to the "battle.net" and "other multiplayer" buttons:
{Changes strings to "open battle.net" and "tcp/ip"
Changes callbacks to appropriate callbacks
Changes position of buttons and buttongraphics of "battle.net"}

0x239D0
6FA339D0  06 00 00 00 08 01 00 00 6E 01 00 00 10 01 00 00  .....n....
6FA339E0  23 00 00 00 00 00 00 00 FB 13 00 00 AC CE A3 6F  #.......û..¬Î£o
6FA339F0  C0 ED A1 6F 00 00 00 00 00 00 00 00 00 00 00 00  Àí¡o............
...
6FA33A30  06 00 00 00 08 01 00 00 98 01 00 00 10 01 00 00  .....˜....
6FA33A40  23 00 00 00 00 00 00 00 FC 13 00 00 AC CE A3 6F  #.......ü..¬Î£o
6FA33A50  B0 1F A2 6F 00 00 00 00 00 00 00 00 00 00 00 00  °¢o............

Wuff Quick edit
0x239E8 F3 to FC (width from left)
0x239Ec C8 to AC (hight from bottom)
0x239F0 D0 to B0 (function (SP button))
0x23A09 01 to 02 
0x23A38 B1 01 to 98 02 (text code string number ( i tihnk)
0x23A48 F4 to FC
0x23A50 30 EF A1 to B0 1F A2 (function (TCP\IP button))
If u need a copy of my d2launch.dll let me know, i remember this as one of most head scratching code edits I did as there was no pre-edited files to work back from and figure out how its all done :)

User avatar
Necrolis
Senior Admin
Throne
Posts: 9106
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: How to remove the "BATTLE.NET" button.

Post by Necrolis » Sun Nov 30, 2008 9:39 pm

Wuffie";p="406773" wrote:No idea if this will help but looking over my old notes on main menu buttons I found this stuff to do with the button flags, or code bits that define how the buttons are aliened and work

Code: Select all

How button signature/code is worked out

#1 00 00 00 #2 00 00 00 #3 00 00 00 #4 00 00 00
#5 00 00 00 #6 00 00 00 #7 00 00 00 #8 CE A3 6F
#9 #9 A1 6F 00 00 00 00 00 00 00 00 00 00 00 00

#1 06 : bit flag stating button?
#2 XX XX : pixels from left 
#3 XX XX : pixels from TOP (i think)
#4 XX XX : Lenght of the button
#5 19 or 23 : Font size :)
#6 :S not sure
#7 XX XX : String referance... change this to existing string and not need to edit strings table
#8 B0 - CC : button border/style (dc6 table!?)
CE A3 6F denotes end of styling of button (i think)
#9 XX XX : button funcion code 
A1 (not figured it out yet but its eather a1 or a2)
6F : end of button
[/qoute]
that struct is only partially correct, its incorrect for 2 reasons:
1) there are about 6 different unions to that struct[the window creation params]
2) certain members are just wrong anyway, eg: +00 is nType, of which there are 12 types(one includes smackers ;)), type 6 being WINDOW_BUTTON.
for these basic edits one only needs to edit the callbacks and strings(and maybe gfx). when i'm done recoding all the menu's I'll make something like sir_generals heavenstorm tutorial[these menus are actually very simple, it took about 5 min to recode the splash screen & main menu]
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
mirecek
Dark Alliance Beta Test
Arch-Angel
Posts: 1218
Joined: Sun Sep 11, 2005 10:04 am

Re: How to remove the "BATTLE.NET" button.

Post by mirecek » Sun Nov 30, 2008 10:30 pm

I am watching this topic carefully :twisted: and with more time and posts, it is more and more interesting.

At first, I want to thank for "workaround" tutorial from wuffie. I have followed his notes and sucesfully made it to menu without BATTLE.NET button. But still from TCP/IP screen I return to multiplayer page. With some more time, I will probably change position of mainmenu buttons (thanks for menu offsets topic, again). I have only few coding experience (hex editor + small amount of olly) so "jump over the code, EBX 1107, set breakpoint and expand it to own function (omg wtfneebs itz very easy TT newbs dye dye dye newbZ!!1), or just create your own function" unfortunatelly tells me only a few, only what could I read from posts on forum. I was sucessfull by making few easy changes by switching values, nopping things and doing jumps over the empty code, but primary by Following tutorials - not finding it by my own.

When I read, that something big is preparing from our forum necromancer ;) I must confess that I am little excited, and have to say something while I can.

Now, when we have the menu buttons as "public" topic, the most interesting part of it is probably their XY position. But I believe, there is still some hidden stuff waiting. I would be very thankful, if the "menustorm :twisted: " tutorial will be expanded as much as possible, not just "I am too lazy again, heres just scratch from my notes again" - no offense.

I like long readings, but I know most of writers dislike long writings. ;) I believe that exist solution between both of us /neebs and their shan´do/
and will look forward that tutorial with passion. I will keep eye on this topic ;) good luck, Nec.
"Each of those few chords separated by complete silence feels like a knife wound to the heart"

There is no greater sorrow than to recall happiness in times of misery. Draconian

User avatar
Wuffie
Posts: 12
Joined: Sat Mar 24, 2007 1:28 am

Re: How to remove the "BATTLE.NET" button.

Post by Wuffie » Mon Dec 01, 2008 12:46 am

Necrolis";p="406808" wrote:...that struct is only partially correct, its incorrect for 2 reasons:
1) there are about 6 different unions to that struct[the window creation params]
2) certain members are just wrong anyway, eg: +00 is nType, of which there are 12 types(one includes smackers ;)), type 6 being WINDOW_BUTTON.
for these basic edits one only needs to edit the callbacks and strings(and maybe gfx). when i'm done recoding all the menu's I'll make something like sir_generals heavenstorm tutorial[these menus are actually very simple, it took about 5 min to recode the splash screen & main menu]...
Thanks for pointing that out :) wrong info is worse than none IMO

and good luck with ur recoding, im sure alot of ppl will be happy when you finish

User avatar
impendeo
Posts: 54
Joined: Mon Sep 01, 2008 1:49 am

Re: How to remove the "BATTLE.NET" button.

Post by impendeo » Wed Mar 25, 2009 4:56 pm

I've been trying to disable the Battle.net button in 1.11b so the game doesnt respond to the onclick event. I've been loooking for days but I don't have the experience yet to know what to look for. I need a nudge in the right direction. I tried to set a break point with ecx==13f3 but it wont break.
Last edited by impendeo on Sat Mar 28, 2009 8:53 am, edited 2 times in total.

User avatar
impendeo
Posts: 54
Joined: Mon Sep 01, 2008 1:49 am

Post by impendeo » Sat Mar 28, 2009 8:56 am

3 days later and im still in the same fix. Can someone give me a bit of a hand with this ( from a learning point of view ) -- replicating the 'theory' in the tutorial doesnt yeild any result when it comes down to looking for the bnetbutton ( 13F3 ) .

User avatar
Necrolis
Senior Admin
Throne
Posts: 9106
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Post by Necrolis » Sat Mar 28, 2009 10:30 am

The button data is stored in the .data section of the dll, so it'll be in reverse order(big endian), also 1.11b doesn't have the nice error strings to help you
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

Jym_yuki
Junior Member
Paladin
Posts: 139
Joined: Sat Apr 03, 2004 5:34 pm
Contact:

Post by Jym_yuki » Sat Mar 28, 2009 11:07 am

en ,i want know ,how to change String's colour on button?
it's always black. :D
how can change to red, green...?
D2 Mod :)

User avatar
impendeo
Posts: 54
Joined: Mon Sep 01, 2008 1:49 am

Post by impendeo » Sun Mar 29, 2009 7:10 am

I think I'm missing something vital, I cant find the button, i managd to get it to break when the button was clicked but i think that was because the break was set at the bnet call. really I have no idea what im doing and need an example to follow.

edit1:

I believe I have found the button, is there a way to disable the button without editing the orignal d2launch.dll?
Last edited by impendeo on Mon Mar 30, 2009 2:29 am, edited 1 time in total.

Pangaea
Junior Member
Paladin
Posts: 240
Joined: Thu Apr 01, 2010 9:05 pm

[v1.13] Deactivate BNet Buttons / ignore "skiptobnet"

Post by Pangaea » Sun Feb 20, 2011 2:06 pm

Ok...it is partly related to this topic and i made some changes which work so far, but
there are some code sequences i found, which also look BNet related, didn't trap while
testing so i don't know what it is doing. So i didn't manipulate anything thereand so
there's a bypass possible i'm not aware of.

I redirected the Callbackaddresses of Open, Closed and Gateway to a stand alone
sequence (mov eax,00000001 ret 0004) which does (nearly) nothing and made a
conditional jump unconditional.

At these 4 File Offsets the byte sequence have to changed to "10 f7 a4 6f":
00021120, 00021270, 000212a0 and 00023f10
For the jump change at 00019e99: 74 -> eb

(v1.13 D2Launch.DLL)

===========

Edit: it seems to exist a start param "-gametype". I don't know how(/if) it work(s), since it
needs a additional string, which i couldn't identify till now. In D2Launch is a code
sequence, which looks like that it uses this param.
Last edited by Pangaea on Sun May 15, 2011 2:55 pm, edited 1 time in total.
I'm working with v1.13c

lolet
Posts: 95
Joined: Sat Sep 04, 2010 8:43 pm

Re: How to remove the "BATTLE.NET" button.

Post by lolet » Mon Feb 21, 2011 1:05 am

I think this struct may be very useful for someone who wants to edit out of game menus.

Code: Select all


struct Control {
     DWORD dwType;                                                          //0x00
     CellFile *pCellFile;                                                   //0x04
     DWORD dwState;                                                         //0x08 0x05 - enabled, 0x04 - disabled, 0x03-0x00 - not visible
     DWORD dwPosX;                                                          //0x0C
     DWORD dwPosY;                                                          //0x10
     DWORD dwSizeX;                                                         //0x14
     DWORD dwSizeY;                                                         //0x18
     BOOL  (__fastcall *Draw)(Control*);								    //0x1C
     BOOL  (__fastcall *DrawEx)(Control*);						  	        //0x20 used by timer/popup
     BOOL  (__stdcall *Push)(ControlMsg*);							        //0x24 
     BOOL  (__stdcall *Mouse)(ControlMsg*);				            		//0x28 
     BOOL  (__stdcall *ListCheck)(ControlMsg*);                          	//0x2C used only by list
     BOOL  (__stdcall *Key)(ControlMsg*);							 	    //0x30 WM_CHAR MSG
     BOOL  (__stdcall *OnPress)(Control*);		                            //0x34 Our Callback
     BOOL  (__fastcall*DrawAnim)(Control*);                          		//0x38 used by animimage
     Control* pNext;                                                        //0x3C
};

struct Button  : Control // (size 0x274) dwType==0x06
{
     DWORD dwButtonFlags;								//0x40 0x00 - normal 0x01 - radio 0x02 - switch 0x03 - clickable(?) 0x04 - play sound 0x20 - sth with disabled/enabled 0x40 - multi line 
     DWORD dwIsPushed;									//0x44
     BOOL  dwIsSwitched;                                //0x48
     BOOL _1;			                                //0x4C
     DWORD dwHotKey;                             	    //0x50
     DWORD dwButtonType;                           		//0x54 0x00 - Normal Button, 0x01 - Switch Button 0x02 - Long Button
     DWORD _2;	                                        //0x58
     DWORD dwCellFrame;                                 //0x5C
     DWORD dwFont;										//0x60  hardcoded
     wchar_t wText[256];                              	//0x64
     DWORD dwColor;										//0x264 hardcoded
     BOOL (__stdcall *OnHover)(Button*);				//0x268
     BOOL bisHovered;									//0x26C
     DWORD dwStrTbl2ndLine;								//0x270
};

User avatar
Stormy Fairweather
Posts: 85
Joined: Fri Jul 18, 2008 1:13 am

Re: How to remove the "BATTLE.NET" button.

Post by Stormy Fairweather » Sun May 15, 2011 6:32 am

Not much of one for necromancy, but this topic has all the information I think I need, but I seem to be applying it wrong. I seek to remove the Gateway and B.net buttons, and move the others together. So far I tried to remove the gateway following Elliot_009 second post, but all I get is a exception error after I mod the dll to match his code. Although one part of the code makes no sense to me;

6FA193D0 3E:89048D D8CAA3

The code in my dll at that address is 8BF8 89048D D8CAA3. Perhaps the 3E: means something I have not learned yet, or is a typo, but I tried skipping that part, moving the addresses over 2 spaces as seems called for, entering 3E as code and moving the rest over one. It always crashes. As the rest of that code now matches Elliot's I suspect this is the source of my crash.

Would someone please explain what is meant, and perhaps gimme a clue or two as to why I am having trouble removing this button. I am gonna take a break from the gateway, and try ot remove the battle.net button. Perhaps I will gain insight whilst doing that.

Wisdom is, as always, appreciated.

Edit - bad enough I necro'd a thread, but I even solved my problem before anyone got around to helping. Sorry all.

Post Reply

Return to “Code Editing”