oodle compression crashes

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Bleech Studios
Posts: 11
Joined: Tue May 19, 2020 10:15 am

oodle compression crashes

Post by Bleech Studios »

im in cpp (compiling as 64bit) and ive loaded the oo2core 4 win64 library:

Code: Select all

typedef int (*OodleLZ_Decompress)(unsigned char* in, int insz, unsigned char* out, int outsz, int a, int b, int c, 
void* d, void* e, void* f, void* g, void* h, void* i, int j);
OodleLZ_Decompress decompressor; // on getprocaddress it works fine without error


When I call the following

Code: Select all

uncompr_chunk_size = decompressor(buf, (int)chunk_size, outbuf, (int)uncompr_chunk_size, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 3);


It crashes the program. The stream is valid (correct header 0x8C06 kraken.. with a bit of the uncompressed data at the header, i think!), it must be the calling of the function. Any ideas what the problem is? The buffers are initialized too

EDIT: The stream is valid, I created a BMS script to extract the compressed stream and it worked fine.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: oodle compression crashes

Post by aluigi »

Oodle on Win64 uses 64bit integers instead of 32bit ones of the 32bit library.

There is a comment in src\included\oodle.c of quickbms:

Code: Select all

// int is 64bit in Oodle64

so if you replace int with long it may automatically switch to 64bit, otherwise go with long long.
Bleech Studios
Posts: 11
Joined: Tue May 19, 2020 10:15 am

Re: oodle compression crashes

Post by Bleech Studios »

Didnt work, Im using oo2core_7_win64.dll now, I checked the version its 2.5.5 or do I need the version from your bms source? The oodle_dll says its version 2.7.3 but the oodle.c says 2.3.0. Im using:

Code: Select all

typedef long long (*OodleLZ_Decompress)(void* in, long long insz, void* out, long long outsz, long long a, long long b, long long c, void* d, void* e, void* f, void* g, void* h, void* i, long long j);


I tried with size_t too. Im using oodle 2.7.3 and I have tried all versions for win64 too
Bleech Studios
Posts: 11
Joined: Tue May 19, 2020 10:15 am

Re: oodle compression crashes

Post by Bleech Studios »

You were right! Thanks so much.