On Starcraft, the first 4 bytes of the CDKey hash are used. That's the actual CDKey has that's sent over the wire as part of SID_AUTH_CHECK.
00 a2 d4 d6 4c 46 8e 56 4f 42 c6 s4 68 e4 5d 6a 46 5f 46 b4 5c 24 d5 46 e4 56 a6 4d 75 2d 21 f8 79 05 0b 00 00
Very interesting, great job on this iago, doesn't seem as complicated as everyone once thought!Just two problems I am encountering while trying to compile this in Java, 1 you haven't included the util.Buffer source code; and 2 WardenSHA1 is missing...
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
I know what's throwing me off (not really, but I'd rather have a viable reason to complain about it)... typos.QuoteOn Starcraft, the first 4 bytes of the CDKey hash are used. That's the actual CDKey has that's sent over the wire as part of SID_AUTH_CHECK. Hash? And unimportant, but, spot what's not a byte:Quote00 a2 d4 d6 4c 46 8e 56 4f 42 c6 s4 68 e4 5d 6a 46 5f 46 b4 5c 24 d5 46 e4 56 a6 4d 75 2d 21 f8 79 05 0b 00 00As for Myst, I'm afraid I have no clue what you're talking about... Have fun whoever's gonna reverse 0x02, and good job iago (as if you need more congrats).
Aside, if anyone is trying to implement this in vb6, these links may be helpfull:VB6 RSA encryption:http://www.cryptosys.net/pki/rsa_encrypt_ex.htmlVB6 MD5 hashing:http://www.vbforums.com/showthread.php?s=&threadid=232284
And i think warden uses the same SHA1 function used for BNCS cdkey/password hashing(?)I have only flicked through it, but i remember iago saying somthing about the only differnce is the data in, is more big-endian-like.iago, Is there any other difernces to bnets broken SHA1 function other than that?
ah I decided to have ago at implementing this, just for a better understanding of it.But im really struggleing with this modifyed SHA1 function (plus im not native to C) Im trying to do this padding, but im a little unsure what and how much needs to get padded.Im guessing its somthing to do with the chunks of data that get hashed in 0x40 chunks -- is it the end chunk that gets padded to 0x40 bytes?Im not so worryed about inverting the byte order just yet, but its hard as i have no test hash to compare with (only the ones you have provided with inverted byte order as well as padding)Is there any chance you could explain what and where gets padded?thanks in advance
aye, a mod finally split the shit from this thread.say, iago, did you find your warden_sha1_update at 19010dd0? Am I nuts, or is it the only sha1-updateish-function with a right 0x1D bitshift ....?
Anyway, that function that you indicate, I have marked as standard SHA1. It's used by the generate_x() (190116B0) function in NLS, and NLS uses standard SHA1. The Warden one is within the module, In the default module, the function at +0x1112 calls the warden_sha1_init(), warden_sha1_update(), and warden_sha1_final() functions.
[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
void warden_sha1_hash(int buffer[5], unsigned char *data, int length){ SHA1_CTX ctx; //Inits the 1st 5 dwords in the ctx structure with the seeds warden_sha1_init(&ctx); //hashs the in-data in blocks of 64 bytes a time warden_sha1_update(&ctx, data, length); //then does some final stuff? warden_sha1_final(&ctx, buffer);}
//unless im reading this wrong, wouldnt this be a negative number? //Doesnt seem so important since blocks that are not 64 bytes are padded? len = ((-9 - (ctx->bitlen[0] >> 3)) & 0x3F) + 1; //hashs the "MysteryBuffer" into the existing 5 dword hash warden_sha1_update(ctx, MysteryBuffer, len); //hashs the 8 bytes from the start of the structure into the existing 5 dword hash? (byte order switched) warden_sha1_update(ctx, (char *)vars, 8);
0123456789ABCDEFFEDCBA9876543210F0E1D2C3
Before:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F6061626364After:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F6061626364000000000000000000000000000000000000000000000000000000
0123456789ABCDEFFEDCBA9876543210F0E1D2C3000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F
CC2B23B6A048E79466583D880065D36B53AD3A94
CC2B23B6A048E79466583D880065D36B53AD3A94404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F6061626364000000000000000000000000000000000000000000000000000000
2298255598EFA4E655ABAF9C21806AFC85FEB4B7
800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
/* The next two lines multiply len by 8. */ c = len >> 29; b = len << 3; a = (bitlen[0] / 8) & 0x3F; /* Check for overflow. */ if(bitlen[0] + b < bitlen[0] || bitlen[0] + b < b) bitlen[1]++; bitlen[0] = bitlen[0] + b; bitlen[1] = bitlen[1] + c; len = len + a; data = data - a;
I dunno wat it means, someone tell me whats ix86 and pmac?Can someone send me a working bot source (with bnls support) to my email? Then help me copy and paste it to my bot?