mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-09 15:20:01 +03:00
Use mt19937_xorcode helper function
This commit is contained in:
+1
-4
@@ -274,10 +274,7 @@ static int DataFile_Open(int link)
|
||||
uint8_t *compressed_data = xmalloc(compressed_size);
|
||||
buffer_read_bytes(&r, compressed_data, compressed_size);
|
||||
archive_free_data(dfile);
|
||||
struct mt19937 mt;
|
||||
mt19937_init(&mt, 4588163);
|
||||
for (size_t i = 0; i < compressed_size; i++)
|
||||
compressed_data[i] ^= mt19937_genrand(&mt);
|
||||
mt19937_xorcode(compressed_data, compressed_size, 4588163);
|
||||
|
||||
uint8_t *raw = xmalloc(uncompressed_size);
|
||||
int rv = uncompress(raw, &uncompressed_size, compressed_data, compressed_size);
|
||||
|
||||
Reference in New Issue
Block a user