Hi
Last week we killed some hard-core characters because of an technical problem on our closed realm.
I was able to restore most of them using an simple char-editor.
But some chracters are using new generated set and uniqueitems which makes it impossible to edit them.
So i think the only solution is to edit the files directly with an hex editor.
I created 2 new hc-characters, one dead, one alive and compared the 2 files.
There are only 3 offsets wich were different in the two files.
Add: C
Add: 24
Add: 30
Add:24 only switches between 2C and 24 for dead/alive but i´m not able to figure out wich values i have to imput/calculate for Add: C and Add:30
Can someone help me out of this ?? :cry:
Thx
Odix
Hex-edit Charfile
Moderators: Nefarius, Havvoric
- Paul Siramy
- Principality
- Posts: 2828
- Joined: Sat May 25, 2002 2:39 pm
- Location: La Garenne Colombes (near Paris)
- Contact:
I don't exactly how it's working, but there is a checksum in the saves, so it's not easy to figure its new value after editing a char.
DT1 Tools - DS1 Editor - MPQ list file - Extracting D2 Animation - Adding ANY Monsters and ANY Objects to a DS1 - New monster color variations from scratch
In development since 16 Feb 2012 : MergeDCC v2
In development since 16 Feb 2012 : MergeDCC v2
I am not sure where the byte position in the char file for hardcore dead/alive lies, but the checksum is found at byte 12 and is 4 bytes long.
The checksum code in C++:
// pucData - pointer to the byte stream of the .d2s file
// iSize - number of bytes in the stream ( filesize )
void Checksum( unsigned char *pucData, int iSize )
{
// delete old checksum at offset 0x0C
*((unsigned int*)(pucData+12)) = 0;
// init new checksum with 0
unsigned int uiCS = 0;
// this is the whole checksum calculation
for ( int j = 0; j < iSize; ++j )
uiCS = (uiCS<<1) + pucData[j] + ( uiCS & 0x80000000 ? 1 : 0 );
// write new checksum to stream
*((unsigned int*)(pucData+12)) = uiCS;
}
(credit goes out to: shadowgate hp)
for further information please refer to the d2-char-file-format site:
d2exp file format
The checksum code in C++:
// pucData - pointer to the byte stream of the .d2s file
// iSize - number of bytes in the stream ( filesize )
void Checksum( unsigned char *pucData, int iSize )
{
// delete old checksum at offset 0x0C
*((unsigned int*)(pucData+12)) = 0;
// init new checksum with 0
unsigned int uiCS = 0;
// this is the whole checksum calculation
for ( int j = 0; j < iSize; ++j )
uiCS = (uiCS<<1) + pucData[j] + ( uiCS & 0x80000000 ? 1 : 0 );
// write new checksum to stream
*((unsigned int*)(pucData+12)) = uiCS;
}
(credit goes out to: shadowgate hp)
for further information please refer to the d2-char-file-format site:
d2exp file format
Re: Hex-edit Charfile
This line has some mistake, tested one is
Code: Select all
uiCS = ((uiCS<<1)|( uiCS >> 31))+ pucData[j];