Lbolt99
May 28th, 2002, 17:18
CacheX program and keygen analysis.
Disassembled keygen (eclipse) and also registration routine in CacheX opera version.
Crypto used: SHA-1, blowfish
Blowfish: Subkey tables stored in file and copied (0x1048 bytes)
Seems to deviate from blowfish spec: subkey table is continuously modified by CacheX
“Null” represents 64 bits of zeros in this document (ie hex 00 00 00 00 00 00 00 00)
Serial # format: hex digits, 64 bits (ie 5E43-347E-5223-7A43)
The name and serial # are stored in the registry. These are pulled from the registry when the program starts, a simple XOR operation is done on the S/N to get it to the same code that is entered at the dialog box when registering program. The reverse operation is done when registering the prog; the code entered is XOR’ed with a constant and stored in the registry. Either way, it proceeds to the below procedure:
Procedure (initially, the keygen and the internal cachex routine do the same thing):
Part I
1) SHA-1 the name (after it’s converted to uppercase)
2) XOR the hash of the name with the blowfish P-table (0x48 bytes)
3) Blowfish (64 bit data: null). Iterates 0x12 times, churning thru subkey table, updating all 0x48 bytes of P table
4) Blowfish (64 bit data: end result of last iteration of #3). Iterates 0x200 times, churning thru 0x1000 size table
5) NOTE: As of this point, the Eclipse keygen and the program’s internal routine have done the same thing.
5a) the KEYGEN at this point calls blowfish again, with data that is preinitalized at the start of the keygen: 85 09 1E 93 91 9D FD 74. After blowfish is done, it results in the correct S/N to enter into CacheX opera. The keygen is finished.
5b) only CacheX after this point. (keygen doesn’t do any of this)
6) Swap P1 thru P18 of blowfish subkey table
7) Single blowfish call: data is the Serial number: After blowfish is done, it results in the same preinitialized data that was in the keygen: 85 09 1E 93 91 9D FD 74
Part II
8) OK. Whew. This part seems to be a large constant operation, in general. I’ve commented it in one of the attached documents, but all in all I believe it generates the same info every time regardless of name/Serial#.
9) SHA-1 the memory image of the program
10) Blowfish: see steps 2-4 in part 1. (Xor with hash of memory image this time tho)
11) Blowfish: decrypts executable code (executed at the CALL ESI routine cs:443b02)
Part III
12) Now we’re looking inside the CALL ESI
13) SHA-1 on 9D 91 93 1E 00 80 74 FD (see step 7)
14) Blowfish: see steps 2-4 in part 1. Xor is with hash of hex digits in step 13
15) The following iterates twice:
a. Read 30h data (constant) from low memory, copy
b. Blowfish crap all over again (xor subkey table w/30h data read in), 0x12 iteration , 0x200 iteration, p1 thru p18 swap).
c. Iterates 0x1F4 times:
blowfish 30h byes of data copied (w/modified subkey table)
d. read and copy different 30h data from low ram
e. Final Check: 1st 8 bytes of the 30h data. Read bytes 5-8, NOT them, compare with bytes 1-4. if same, exit. They will be the same on the 2nd iteration of Step #15, if your code is correct.
e. iterate back to step a (once only,assuming correct code)
OK, now that it’s all in a nutshell, I have a bad feeling that there is no way to keygen CacheX unless you have a valid code, in order to find out the CONSTANT: 85 09 1E 93 91 9D FD 74. This constant is different between the different cachex’s: IE/netscape and Opera. The subkey tables in the three version are the same, for what it’s worth. Since the constant is unknown, and there doesn’t seem to be any way to figure it out from working backwards in part 3. Is my analysis correct?
So eclipse must have had a valid serial in order to figure out the obscured constant?
Disassembled keygen (eclipse) and also registration routine in CacheX opera version.
Crypto used: SHA-1, blowfish
Blowfish: Subkey tables stored in file and copied (0x1048 bytes)
Seems to deviate from blowfish spec: subkey table is continuously modified by CacheX
“Null” represents 64 bits of zeros in this document (ie hex 00 00 00 00 00 00 00 00)
Serial # format: hex digits, 64 bits (ie 5E43-347E-5223-7A43)
The name and serial # are stored in the registry. These are pulled from the registry when the program starts, a simple XOR operation is done on the S/N to get it to the same code that is entered at the dialog box when registering program. The reverse operation is done when registering the prog; the code entered is XOR’ed with a constant and stored in the registry. Either way, it proceeds to the below procedure:
Procedure (initially, the keygen and the internal cachex routine do the same thing):
Part I
1) SHA-1 the name (after it’s converted to uppercase)
2) XOR the hash of the name with the blowfish P-table (0x48 bytes)
3) Blowfish (64 bit data: null). Iterates 0x12 times, churning thru subkey table, updating all 0x48 bytes of P table
4) Blowfish (64 bit data: end result of last iteration of #3). Iterates 0x200 times, churning thru 0x1000 size table
5) NOTE: As of this point, the Eclipse keygen and the program’s internal routine have done the same thing.
5a) the KEYGEN at this point calls blowfish again, with data that is preinitalized at the start of the keygen: 85 09 1E 93 91 9D FD 74. After blowfish is done, it results in the correct S/N to enter into CacheX opera. The keygen is finished.
5b) only CacheX after this point. (keygen doesn’t do any of this)
6) Swap P1 thru P18 of blowfish subkey table
7) Single blowfish call: data is the Serial number: After blowfish is done, it results in the same preinitialized data that was in the keygen: 85 09 1E 93 91 9D FD 74
Part II
8) OK. Whew. This part seems to be a large constant operation, in general. I’ve commented it in one of the attached documents, but all in all I believe it generates the same info every time regardless of name/Serial#.
9) SHA-1 the memory image of the program
10) Blowfish: see steps 2-4 in part 1. (Xor with hash of memory image this time tho)
11) Blowfish: decrypts executable code (executed at the CALL ESI routine cs:443b02)
Part III
12) Now we’re looking inside the CALL ESI
13) SHA-1 on 9D 91 93 1E 00 80 74 FD (see step 7)
14) Blowfish: see steps 2-4 in part 1. Xor is with hash of hex digits in step 13
15) The following iterates twice:
a. Read 30h data (constant) from low memory, copy
b. Blowfish crap all over again (xor subkey table w/30h data read in), 0x12 iteration , 0x200 iteration, p1 thru p18 swap).
c. Iterates 0x1F4 times:
blowfish 30h byes of data copied (w/modified subkey table)
d. read and copy different 30h data from low ram
e. Final Check: 1st 8 bytes of the 30h data. Read bytes 5-8, NOT them, compare with bytes 1-4. if same, exit. They will be the same on the 2nd iteration of Step #15, if your code is correct.
e. iterate back to step a (once only,assuming correct code)
OK, now that it’s all in a nutshell, I have a bad feeling that there is no way to keygen CacheX unless you have a valid code, in order to find out the CONSTANT: 85 09 1E 93 91 9D FD 74. This constant is different between the different cachex’s: IE/netscape and Opera. The subkey tables in the three version are the same, for what it’s worth. Since the constant is unknown, and there doesn’t seem to be any way to figure it out from working backwards in part 3. Is my analysis correct?
So eclipse must have had a valid serial in order to figure out the obscured constant?