ExtraWork

ExtraWork is a library sent by the server after successfully passing CheckRevision during the connection process. ExtraWork has been used by Battle.net to collect statistics on system hardware and to prevent hacking/botting.

Servers choose to send either SID_OPTIONALWORK or SID_REQUIREDWORK with the filename of the ExtraWork MPQ, which is traditionally IX86ExtraWork.mpq. If SID_OPTIONALWORK is sent, the client will first check the value of registry key HKCU\Software\Battle.net\Optimize\SysDesc, and if the key is set to 1, the client continues on to request ExtraWork from the server. If SID_REQUIREDWORK is sent, the client continues on to request ExtraWork, regardless of the value of the registry key.

The client then sends SID_GETFILETIME with request ID 0x80000005 for SID_OPTIONALWORK and 0x80000006 for SID_REQUIREDWORK, and with the same filename as the one from SID_OPTIONALWORK and SID_REQUIREDWORK. After the server replies back with the filetime, the client initiates a BNFTPv1 connection to download the ExtraWork MPQ.

After downloading the ExtraWork MPQ, the client extracts the ExtraWork DLL, whose filename must match the filename of the MPQ, with the exception of the file extension. (e.g. IX86ExtraWork.mpq contains IX86ExtraWork.dll)
The client then loads the ExtraWork DLL and runs ExtraWork(), passing in a pointer to a 1028 byte buffer.

ExtraWork() function declaration in C++

extern "C" __declspec(dllexport) std::int32_t __fastcall ExtraWork(ExtraWorkData *extrawork, int unused);

Buffer Format

Type Field
UINT16 Client
UINT16 Length
UINT8 Data

Client Values

Client Value
Diablo II 0x01
WarCraft III 0x02
StarCraft 0x03
World of Warcraft? \ Diablo II 0x04

After ExtraWork() fills the buffer and returns, the client sends the buffer to the server via SID_EXTRAWORK.

| Edited: xboi209

Comments

xboi209

Diablo 2 1.14d has been observed to set the game type to 4 in C>S 0x4B SID_EXTRAWORK. The length has been observed to be as high as 2578.