Rev 311 | Rev 315 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 311 | Rev 312 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ |
19 | */ |
20 | 20 | ||
21 | #include <stddef.h> |
21 | #include <stddef.h> |
22 | #include <stdint.h> |
22 | #include <stdint.h> |
23 | #include <assert.h> |
- | |
24 | #include <time.h> |
- | |
25 | 23 | ||
26 | #include "ff.h" |
24 | #include "ff.h" |
27 | 25 | ||
28 | const volatile uint32_t cObfuscV4Seed = 0x52830517; // this value will be manipulated during the building of each individual filter (see make_win.c) |
26 | // this value will be manipulated during the building of each individual filter (see make_win.c) |
- | 27 | const volatile uint32_t cObfuscV4Seed = 0x52830517; |
|
29 | 28 | ||
30 | int rand_msvcc(unsigned int* seed) { |
29 | int rand_msvcc(unsigned int* seed) { |
31 | *seed = *seed * 214013L + 2531011L; |
30 | *seed = *seed * 214013L + 2531011L; |
32 | return (*seed >> 16) & 0x7fff; /* Scale between 0 and RAND_MAX */ |
31 | return (*seed >> 16) & 0x7fff; /* Scale between 0 and RAND_MAX */ |
33 | } |
32 | } |
Line 274... | Line 273... | ||
274 | // Furthermore, if obfuscation 3+ failed (since the seed is individual for each 8BF file), |
273 | // Furthermore, if obfuscation 3+ failed (since the seed is individual for each 8BF file), |
275 | // we still want that load_*.c is able to detect pparm->iProtected instead |
274 | // we still want that load_*.c is able to detect pparm->iProtected instead |
276 | // of throwing the error "Incompatible obfuscation". |
275 | // of throwing the error "Incompatible obfuscation". |
277 | pparm->cbSize = PARM_SIZE; |
276 | pparm->cbSize = PARM_SIZE; |
278 | } |
277 | } |
- | 278 | ||
- | 279 | if (obfusc_version >= 1) { |
|
- | 280 | // information was lost due to obfuscation. Make sure it is zero. |
|
- | 281 | pparm->unknown2 = 0; |
|
- | 282 | } |
|
279 | } |
283 | } |