[1.10] SaveFile Limit

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

User avatar
Lurix
Dark Alliance Beta Test
Champion of the Light
Posts: 496
Joined: Tue Aug 31, 2010 9:30 am
Location: Birmingham, UK
Bulgaria

[1.10] SaveFile Limit

Post by Lurix » Fri Jan 18, 2013 8:12 am

Since I know the limit is something lke 6 KB (Correct me if I'm wrong)
Is it possible to increase this value to 1MB for example? And how hard it would it be?

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

Hand-picked

Re: [1.10] SaveFile Limit

Post by Necrolis » Fri Jan 18, 2013 8:30 am

The limit is 8192 bytes to be exact. expanding the limit itself isn't too hard, just look for all occurrences of 0x2000 in D2Game.dll and up those (there shouldn't be many, the main on yeilds an assertion in 1.10, so its very easy to find).

As for the side effects of doing this, I have no clue as I've never bothered with expanding the vanilla save file code, so its up to you to test.

EDIT: actually there is only one location, being the one that yields the assertion, so just look for a CMP vs 0x2000, those other 0x2000's are all bitflags
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
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: [1.10] SaveFile Limit

Post by kidpaddle94 » Fri Jan 18, 2013 1:57 pm

I think the assertion in D2Game was only in Multiplayer. I could allow clients to join my game with higher filesize, but couldn't get my own character to join with higher filesize.

For example, if I made a TCP/IP game with this location increased to 9000 bytes, my host couldn't enter game. But if I created a game with a new character, joiners could join with 8250 bytes for example.

I also recall there was a second assertion when the client would leave the game.

Trying in single player would have the same effect as trying to host with oversized characters.

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

Hand-picked

Re: [1.10] SaveFile Limit

Post by Necrolis » Fri Jan 18, 2013 3:26 pm

I lie, was checking an already altered dll, the exact locations are (copied from my actual code that replaces ALL of D2's save crap):

Code: Select all

    {0x6FC31B23,SAVEFILE_MAX_SIZE,FT_NON_RELOC},
    {0x6FC8A1EF,SAVEFILE_MAX_SIZE,FT_NON_RELOC},
    {0x6FC8A65F,SAVEFILE_MAX_SIZE,FT_NON_RELOC},
    {0x6FC8A702,SAVEFILE_MAX_SIZE,FT_NON_RELOC},
    {0x6FC8CA41,SAVEFILE_MAX_SIZE,FT_NON_RELOC},
    {0x6FC90C98,SAVEFILE_MAX_SIZE,FT_NON_RELOC},
    {0x6FC92808,SAVEFILE_MAX_SIZE,FT_NON_RELOC},
    {0x6FC92828,SAVEFILE_MAX_SIZE,FT_NON_RELOC},
There are also a few places where the save file is copied onto the STACK (LIKE WTF?!?!), which lead to an infamous dupe (just like the assertion did). so you need to fixup (IMO its much more secure to recode) the following functions to get it done correctly:

Code: Select all

D2Game.0x6FC8A6E8
D2Game.0x6FC8A60A
D2Game.0x6FC8C9D0
judging by the addresses, some might be in the middle of another function (only have access to my SVN atm).

There is also code in D2Launch for save files, but IIRC it doesn't have a limit check (it might still be dumb and copy crap to a stack buffer). The only other code is the code in D2Client that splits or join the savefile parts for sending or receiving characters when joining or hosting an MP game, it has no limit (it infact does very little other than checking for the 0xAA55AA55 header stamp...).

In terms of the stack buffers, I'm not sure on its size (didn't make notes...), IIRC its more like 10KB, but its easy to expand, just find the call to _alloca (it'll be right at the start of a function), and increase that, just beware not to go crazy (you could probably double or triple it with ease).

If you are gonna expand the file size, remove the artificial delay the game adds between sending each ~500 byte chunk, this is handled by a Sleep call in D2Client's save part sending code, drop the 250ms delay (between each part) down to like 20 or 10ms.
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
Lurix
Dark Alliance Beta Test
Champion of the Light
Posts: 496
Joined: Tue Aug 31, 2010 9:30 am
Location: Birmingham, UK
Bulgaria

Re: [1.10] SaveFile Limit

Post by Lurix » Thu Jan 31, 2013 10:20 am

I've found something about the topic here
ReadmeFile" wrote:*** CURRENTLY FOR 1.12A ONLY ***

Increases the maximum save file size from 0x2000 to 0x8000.

Ported from ES 3.00 R6D's direct dll hacks.

Install:
* Copy savesize.dll to your game or mod dir
* Load savesize.dll with a loader (PlugY, etc)

Site:
http://zenthought.org/project/diablo2

- zinx <zinx@zenthought.org>
I'm wondering how much the increasement is (Increases the maximum save file size from 0x2000 to 0x8000)?
And would it be hard to make something simmilar for 1.10?

Thanks.

User avatar
Volf
Retired Admin
Dominion
Posts: 5396
Joined: Thu Jul 31, 2003 8:19 am
Finland

Hand-picked

Re: [1.10] SaveFile Limit

Post by Volf » Thu Jan 31, 2013 10:30 am

I would also be wary interested in a 1.10 version that wont conflict with d2mod system. Been browsing old topics on the subject for several months with no luck. A small increase would be enough, actually an increase of 2kb-4kb would be a lifesaver.

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: [1.10] SaveFile Limit

Post by kidpaddle94 » Tue Aug 06, 2013 7:38 am

edited
Last edited by kidpaddle94 on Sat Nov 28, 2020 9:12 am, edited 1 time in total.

situm
Posts: 5
Joined: Tue Aug 28, 2012 3:57 am

Re: [1.10] SaveFile Limit

Post by situm » Sat Oct 12, 2013 4:49 pm

kidpaddle94" wrote:1.13c

As Necrolis said, it's better to replace those functions where the filesize is on the stack, but for now I went with the patch fixup technique

Code: Select all

#define SAVEFILE_MAX_SIZE		0x00006000

{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F73, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53887, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x538AB, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x538D1, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x538FF, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5391D, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x562BD, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0xCB0DE, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F73, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E82, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54023, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x70FEE, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x71000, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x7167E, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F11, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F3C, (DWORD)SAVEFILE_MAX_SIZE+0x608, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F5B, (DWORD)SAVEFILE_MAX_SIZE+0x620, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F62, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F6E, (DWORD)SAVEFILE_MAX_SIZE+0x60C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F7F, (DWORD)SAVEFILE_MAX_SIZE+0x610, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53FF4, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x537D1, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x537DE, (DWORD)SAVEFILE_MAX_SIZE+0x02C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x537FC, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5383F, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x538ED, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5396C, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x539C1, (DWORD)SAVEFILE_MAX_SIZE+0x03C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53A34, (DWORD)SAVEFILE_MAX_SIZE+0x03C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53A7D, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53AB9, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53AFC, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53B38, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56251, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5625D, (DWORD)SAVEFILE_MAX_SIZE+0x608, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56283, (DWORD)SAVEFILE_MAX_SIZE+0x614, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5630A, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56319, (DWORD)SAVEFILE_MAX_SIZE+0x624, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56320, (DWORD)SAVEFILE_MAX_SIZE+0x620, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56327, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5632F, (DWORD)SAVEFILE_MAX_SIZE+0x614, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56337, (DWORD)SAVEFILE_MAX_SIZE+0x614, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56354, (DWORD)SAVEFILE_MAX_SIZE+0x624, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5635B, (DWORD)SAVEFILE_MAX_SIZE+0x620, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56362, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5636C, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56378, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5639C, (DWORD)SAVEFILE_MAX_SIZE+0x618, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x563B1, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E51, (DWORD)SAVEFILE_MAX_SIZE+0x004, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E7A, (DWORD)SAVEFILE_MAX_SIZE+0x014, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E8E, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E9A, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F00, (DWORD)SAVEFILE_MAX_SIZE+0x004, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53FD7, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F781, (DWORD)SAVEFILE_MAX_SIZE+0x00C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F7F5, (DWORD)SAVEFILE_MAX_SIZE+0x034, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F80A, (DWORD)SAVEFILE_MAX_SIZE+0x030, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F811, (DWORD)SAVEFILE_MAX_SIZE+0x024, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F818, (DWORD)SAVEFILE_MAX_SIZE+0x02C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F820, (DWORD)SAVEFILE_MAX_SIZE+0x02C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F831, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F88D, (DWORD)SAVEFILE_MAX_SIZE+0x024, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F8DA, (DWORD)SAVEFILE_MAX_SIZE+0x00C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F8E9, (DWORD)SAVEFILE_MAX_SIZE+0x00C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F8F1, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F953, (DWORD)SAVEFILE_MAX_SIZE+0x028, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F95A, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F962, (DWORD)SAVEFILE_MAX_SIZE+0x028, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F973, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F9CC, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA1B, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA29, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA31, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA93, (DWORD)SAVEFILE_MAX_SIZE+0x028, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA9A, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FAA2, (DWORD)SAVEFILE_MAX_SIZE+0x028, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FAB3, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FB0C, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FB5B, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FB69, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54001, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5401C, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5402F, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54051, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54245, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5424C, (DWORD)SAVEFILE_MAX_SIZE+0x050, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5401C, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54254, (DWORD)SAVEFILE_MAX_SIZE+0x064, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5425D, (DWORD)SAVEFILE_MAX_SIZE+0x060, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5426C, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54276, (DWORD)SAVEFILE_MAX_SIZE+0x060, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x542C4, (DWORD)SAVEFILE_MAX_SIZE+0x058, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x542CF, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x542D7, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x542EA, (DWORD)SAVEFILE_MAX_SIZE+0x070, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5430B, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
There is also an additional fixup to patch in plugy.dll if you use the expanded stash. On Plugy 10 it would be at plugy.0x17566

Code: Select all

046B7560    FF15 D87E6D04        CALL DWORD PTR DS:[46D7ED8]              ; Fog.#10115
046B7566    36:FFB424 08260000   PUSH DWORD PTR SS:[ESP+2608]
046B756E    E8 1DFEFFFF          CALL plugy.046B7390
046B7573    C3                   RETN

can you please share the updated dlls? thanks a lot.

User avatar
weapon-x
Forum Legend
Arch-Angel
Posts: 1047
Joined: Wed Mar 18, 2009 4:52 am
Location: Mindanao, Philippines
Contact:
Philippines

Re: [1.10] SaveFile Limit

Post by weapon-x » Sun Nov 17, 2013 11:19 am

i would be delighted to see a plugin for this increased savefile size v1.10
right now i cant seem to track em down
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "

~Mark Twain

User avatar
Lurix
Dark Alliance Beta Test
Champion of the Light
Posts: 496
Joined: Tue Aug 31, 2010 9:30 am
Location: Birmingham, UK
Bulgaria

Re: [1.10] SaveFile Limit

Post by Lurix » Sun Apr 27, 2014 9:00 pm

Someone has any progress about that in 1.10? Thanks.

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: [1.10] SaveFile Limit

Post by kingpin » Sun Apr 27, 2014 11:29 pm

Lurix" wrote:Someone has any progress about that in 1.10? Thanks.
I have done it for 1.10, but waiting on weapon-x to see what bug he found with it.

User avatar
Lurix
Dark Alliance Beta Test
Champion of the Light
Posts: 496
Joined: Tue Aug 31, 2010 9:30 am
Location: Birmingham, UK
Bulgaria

Re: [1.10] SaveFile Limit

Post by Lurix » Mon Apr 28, 2014 7:29 am

I'll be more than happy to be able to use it soon. Thanks in advance!

User avatar
weapon-x
Forum Legend
Arch-Angel
Posts: 1047
Joined: Wed Mar 18, 2009 4:52 am
Location: Mindanao, Philippines
Contact:
Philippines

Re: [1.10] SaveFile Limit

Post by weapon-x » Tue May 06, 2014 2:44 pm

there is a juicy c0000005 error when loading a char
with over 8192 bytes...

haven't attached olly when this happened so i got no clue as where i should
start looking (honestly i am super rusty, haven't touched my files for over 3 weeks) hehe

anyhow, i think my internet connection is back to normal (for now) so i'll re-create the error
and try to share more stuff for us to debug :mrgreen:
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "

~Mark Twain

User avatar
Lurix
Dark Alliance Beta Test
Champion of the Light
Posts: 496
Joined: Tue Aug 31, 2010 9:30 am
Location: Birmingham, UK
Bulgaria

Re: [1.10] SaveFile Limit

Post by Lurix » Wed May 07, 2014 11:51 am

Nice, hope you got luck on this, since a lloy are looking forward this.

User avatar
weapon-x
Forum Legend
Arch-Angel
Posts: 1047
Joined: Wed Mar 18, 2009 4:52 am
Location: Mindanao, Philippines
Contact:
Philippines

Re: [1.10] SaveFile Limit

Post by weapon-x » Fri May 09, 2014 9:14 am

errr... is there any other known method to pump-up character save file
aside from acquiring lots of items (rings and amulets from gamble in my case...)

?? i finally have free time this weekend, and tonight :)
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "

~Mark Twain

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: [1.10] SaveFile Limit

Post by kidpaddle94 » Fri May 09, 2014 10:17 am

Just get hero editor and fill the character with 30 properties items. That's what I did to test this on 1.13c

Also, a quick list of the stuff to test:

- load an oversized character in Single Player
- exit a Single Player game using an oversized character
- create a TCP/IP game using an oversized character
- join a game using an oversized character
- exit a TCP/IP game (while you're not the host) with an oversized character
- init a Multiplayer trade session with an oversized character
- end a trade session with an oversized character

And there is also an additional problem with plugy, which will occur when you leave a game, as far as I remember (SP/MP)

User avatar
weapon-x
Forum Legend
Arch-Angel
Posts: 1047
Joined: Wed Mar 18, 2009 4:52 am
Location: Mindanao, Philippines
Contact:
Philippines

Re: [1.10] SaveFile Limit

Post by weapon-x » Fri May 09, 2014 10:35 am

i think the best thing to do is port your edit to 1.10,
as i believe you already tested all this stuff...

but then, how does one re-trace the codes/offsets of 1.13 to 1.10,
when things look different from all directions...

i remember doing this once but it took me a week or so just to find a specific code...
:mrgreen:
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "

~Mark Twain

User avatar
weapon-x
Forum Legend
Arch-Angel
Posts: 1047
Joined: Wed Mar 18, 2009 4:52 am
Location: Mindanao, Philippines
Contact:
Philippines

Re: [1.10] SaveFile Limit

Post by weapon-x » Wed May 14, 2014 1:32 pm

urg, perhaps it is better to compile the code and open it to the community
so people can help test it...

what needs to be done:

*systematic testing
*increase/remove the artificial delay the game adds (just like what necrolis posted)

here is the link

http://www.mediafire.com/download/ruhdv ... veFile.zip

this is for 1.10, just load this using SVR's d2mod :)

*extends the savefile limit from 8192k to 16000k

the client delay is at DLLBASE_D2CLIENT+0xD73D

known errors

Code: Select all

1. When the client leaves a multi-player session
2. Sometimes joining generates a "Bad Generic Character File" or something like that
*anyhow thanks to this testing stuff, i managed to fix one of my custom pSpells bug, which was done
erroneously due to me, being naive, and making noob codes :lol:
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "

~Mark Twain

Sampson
Posts: 52
Joined: Mon Sep 30, 2013 2:22 am

Re: [1.10] SaveFile Limit

Post by Sampson » Sat Jul 25, 2015 1:13 am

kidpaddle94" wrote: And there is also an additional problem with plugy, which will occur when you leave a game, as far as I remember (SP/MP)
Is this a serious problem?

And does anyone know if there are any consequences to using the patch fixup method instead of just replacing functions?

For some reason, Diablo II won't start if I use the patch fixup method with 1.13c (by using Diablo II template)


I put: "#define SAVEFILE_MAX_SIZE 0x00006000" inside "D2PatchConst.h"

I put "{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F73, (DWORD)SAVEFILE_MAX_SIZE, 0}," inside "gptTemplatePatches".

The result is
Problem Event Name: BEX
Application Name: Game.exe
Application Version: 1.0.13.60
Application Timestamp: 4b95ca4b
Fault Module Name: StackHash_e98d
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 00000000
Exception Code: c0000005
Exception Data: 00000008
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 2057
Additional Information 1: e98d
Additional Information 2: e98dfca8bcf81bc1740adb135579ad53
Additional Information 3: 6eab
Additional Information 4: 6eabdd9e0dc94904be3b39a1c0583635

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

Hand-picked

Re: [1.10] SaveFile Limit

Post by Necrolis » Sat Jul 25, 2015 9:24 am

Sampson" wrote:And does anyone know if there are any consequences to using the patch fixup method instead of just replacing functions?
YIp, there is a major one, stackoverflows; It shouldn't happen too easily; however 1.13c doesn't use a checked stack allocator (_alloca), so you would wind up with bogus crashes... TBH the better way is to allocate a 32KB buffer in the BSS section and rewrite the epilogues and prologues to use that as the basis for the buffer.
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

rpg302308
Posts: 12
Joined: Wed Jan 20, 2010 12:33 pm

Re: [1.10] SaveFile Limit

Post by rpg302308 » Mon Oct 12, 2015 2:59 pm

how to modify it on 1.09d

User avatar
luoriming-ansys
Posts: 25
Joined: Sat Jun 11, 2016 6:36 am
Hong Kong

Re: [1.10] SaveFile Limit

Post by luoriming-ansys » Mon Jul 11, 2016 5:47 am

kidpaddle94" wrote:1.13c

As Necrolis said, it's better to replace those functions where the filesize is on the stack, but for now I went with the patch fixup technique

Code: Select all

#define SAVEFILE_MAX_SIZE		0x00006000

{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F73, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53887, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x538AB, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x538D1, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x538FF, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5391D, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x562BD, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0xCB0DE, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F73, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E82, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54023, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x70FEE, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x71000, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x7167E, (DWORD)SAVEFILE_MAX_SIZE, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F11, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F3C, (DWORD)SAVEFILE_MAX_SIZE+0x608, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F5B, (DWORD)SAVEFILE_MAX_SIZE+0x620, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F62, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F6E, (DWORD)SAVEFILE_MAX_SIZE+0x60C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F7F, (DWORD)SAVEFILE_MAX_SIZE+0x610, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53FF4, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x537D1, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x537DE, (DWORD)SAVEFILE_MAX_SIZE+0x02C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x537FC, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5383F, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x538ED, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5396C, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x539C1, (DWORD)SAVEFILE_MAX_SIZE+0x03C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53A34, (DWORD)SAVEFILE_MAX_SIZE+0x03C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53A7D, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53AB9, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53AFC, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53B38, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56251, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5625D, (DWORD)SAVEFILE_MAX_SIZE+0x608, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56283, (DWORD)SAVEFILE_MAX_SIZE+0x614, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5630A, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56319, (DWORD)SAVEFILE_MAX_SIZE+0x624, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56320, (DWORD)SAVEFILE_MAX_SIZE+0x620, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56327, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5632F, (DWORD)SAVEFILE_MAX_SIZE+0x614, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56337, (DWORD)SAVEFILE_MAX_SIZE+0x614, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56354, (DWORD)SAVEFILE_MAX_SIZE+0x624, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5635B, (DWORD)SAVEFILE_MAX_SIZE+0x620, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56362, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5636C, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x56378, (DWORD)SAVEFILE_MAX_SIZE+0x61C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5639C, (DWORD)SAVEFILE_MAX_SIZE+0x618, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x563B1, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E51, (DWORD)SAVEFILE_MAX_SIZE+0x004, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E7A, (DWORD)SAVEFILE_MAX_SIZE+0x014, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E8E, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53E9A, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53F00, (DWORD)SAVEFILE_MAX_SIZE+0x004, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x53FD7, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F781, (DWORD)SAVEFILE_MAX_SIZE+0x00C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F7F5, (DWORD)SAVEFILE_MAX_SIZE+0x034, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F80A, (DWORD)SAVEFILE_MAX_SIZE+0x030, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F811, (DWORD)SAVEFILE_MAX_SIZE+0x024, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F818, (DWORD)SAVEFILE_MAX_SIZE+0x02C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F820, (DWORD)SAVEFILE_MAX_SIZE+0x02C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F831, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F88D, (DWORD)SAVEFILE_MAX_SIZE+0x024, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F8DA, (DWORD)SAVEFILE_MAX_SIZE+0x00C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F8E9, (DWORD)SAVEFILE_MAX_SIZE+0x00C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F8F1, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F953, (DWORD)SAVEFILE_MAX_SIZE+0x028, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F95A, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F962, (DWORD)SAVEFILE_MAX_SIZE+0x028, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F973, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0F9CC, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA1B, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA29, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA31, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA93, (DWORD)SAVEFILE_MAX_SIZE+0x028, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FA9A, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FAA2, (DWORD)SAVEFILE_MAX_SIZE+0x028, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FAB3, (DWORD)SAVEFILE_MAX_SIZE+0x01C, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FB0C, (DWORD)SAVEFILE_MAX_SIZE+0x020, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FB5B, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x0FB69, (DWORD)SAVEFILE_MAX_SIZE+0x008, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54001, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5401C, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5402F, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54051, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54245, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5424C, (DWORD)SAVEFILE_MAX_SIZE+0x050, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5401C, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54254, (DWORD)SAVEFILE_MAX_SIZE+0x064, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5425D, (DWORD)SAVEFILE_MAX_SIZE+0x060, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5426C, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x54276, (DWORD)SAVEFILE_MAX_SIZE+0x060, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x542C4, (DWORD)SAVEFILE_MAX_SIZE+0x058, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x542CF, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x542D7, (DWORD)SAVEFILE_MAX_SIZE+0x054, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x542EA, (DWORD)SAVEFILE_MAX_SIZE+0x070, 0},
{D2DLL_D2GAME, DLLBASE_D2GAME+0x5430B, (DWORD)SAVEFILE_MAX_SIZE+0x038, 0},
There is also an additional fixup to patch in plugy.dll if you use the expanded stash. On Plugy 10 it would be at plugy.0x17566

Code: Select all

046B7560    FF15 D87E6D04        CALL DWORD PTR DS:[46D7ED8]              ; Fog.#10115
046B7566    36:FFB424 08260000   PUSH DWORD PTR SS:[ESP+2608]
046B756E    E8 1DFEFFFF          CALL plugy.046B7390
046B7573    C3                   RETN

How can we input "SAVEFILE_MAX_SIZE+0x5F8," in the offset 0x53F11?What does {D2DLL_D2GAME, DLLBASE_D2GAME+0x53F11, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0} means?

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: [1.10] SaveFile Limit

Post by devurandom » Mon Jul 11, 2016 6:40 am

luoriming-ansys" wrote: How can we input "SAVEFILE_MAX_SIZE+0x5F8," in the offset 0x53F11?What does {D2DLL_D2GAME,
DLLBASE_D2GAME+0x53F11, (DWORD)SAVEFILE_MAX_SIZE+0x5F8, 0} means?
These are patches for use with Kidpaddles D2Template, otherwise you have to patch each DLL offset manually with Ollydbg.
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
luoriming-ansys
Posts: 25
Joined: Sat Jun 11, 2016 6:36 am
Hong Kong

Re: [1.10] SaveFile Limit

Post by luoriming-ansys » Mon Jul 11, 2016 12:36 pm

:)
Last edited by luoriming-ansys on Sat Oct 07, 2017 1:25 am, edited 1 time in total.

User avatar
luoriming-ansys
Posts: 25
Joined: Sat Jun 11, 2016 6:36 am
Hong Kong

Re: [1.10] SaveFile Limit

Post by luoriming-ansys » Mon Jul 11, 2016 4:27 pm

Now I know how to change the value,it works fine,thank kidpaddle94 for his code. :D :) :cool:
Last edited by luoriming-ansys on Sat Oct 07, 2017 1:14 am, edited 1 time in total.

Post Reply

Return to “Code Editing”