REDIVIVUS

Proposals / #1666

Type Mac BNSEND_PrepareCDKeyHash as int32_t __fastcc (D2CDKeyHashStrc*, char*, uint32_t, uint32_t)

checked · by KierTaylor · submitted 2026-11-08

Register+stack function: ECX -> ESI is the output hash record (key length at +0, product +4, public +8, 0 at +0xc, hash written from +0x10), EDX -> EDI is the CD-key string (strlen checked for 26 or 16), [EBP+8] and [EBP+0xc] are the client and server tokens copied to the head of the hashed block. The caller BNSEND_HashCDKeyByType passes its token as [ESP] and the server-token getter result as [ESP+4] (0x000560ba). Windows twin 0x0051dfc0 is int32_t (uint32_t nToken, uint32_t nServerToken, char* szCDKey, D2CDKeyHashStrc* pOutHash); args are mapped by role.

Changes 1, applied together

  1. Set prototype mac 0x000560d4

    signatureundefined BNSEND_PrepareCDKeyHash(void)→int32_t BNSEND_PrepareCDKeyHash(D2CDKeyHashStrc* pOutHash, char* szCDKey, uint32_t nToken, uint32_t nServerToken)
    conventionunknown→__fastcc