Skip to content

Commit e9ed554

Browse files
committed
chore(ArchiveStorageDecryptor) - fix gcc warnings
1 parent b027297 commit e9ed554

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

UnityPyBoost/ArchiveStorageDecryptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inline unsigned char decrypt_byte(unsigned char *bytes, uint64_t& offset, uint64
99
+ substitute_data[index & 3]
1010
+ substitute_data[((index >> 4) & 3) + 8]
1111
+ substitute_data[((unsigned char)index >> 6) + 12];
12-
bytes[offset] = (unsigned char)((index_data[bytes[offset] & 0xF] - count_byte) & 0xF | 0x10 * (index_data[bytes[offset] >> 4] - count_byte));
12+
bytes[offset] = (unsigned char)(((index_data[bytes[offset] & 0xF] - count_byte) & 0xF) | 0x10 * (index_data[bytes[offset] >> 4] - count_byte));
1313
count_byte = bytes[offset++];
1414
index++;
1515
return count_byte;
@@ -76,7 +76,7 @@ PyObject *decrypt_block(PyObject *self, PyObject *args) {
7676
unsigned char *result_raw = (unsigned char *)PyBytes_AS_STRING(result);
7777
memcpy(result_raw, data.buf, data.len);
7878

79-
uint64_t offset = 0;
79+
Py_ssize_t offset = 0;
8080
while (offset < data.len) {
8181
offset += decrypt(result_raw + offset, index++, data.len - offset, (unsigned char *)index_data.buf, (unsigned char *)substitute_data.buf);
8282
}

0 commit comments

Comments
 (0)