From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "signature" |
|---|
| subject | "Library:Libjpeg-turbo" |
|---|
| claim | "In MSVC x64 builds of libjpeg-turbo with the jpeg8 API, jpeg_CreateCompress and jpeg_CreateDecompress both contain the same version check: cmp edx, 50h; jz; mov rax,[rcx]; mov dword [rax+28h], 0Dh (JERR_BAD_LIB_VERSION); mov dword [rax+2Ch], 50h; mov rax,[rcx]; mov [rax+30h], edx; mov rax,[rcx]. The struct-size compare that follows (cmp rbx, 270h decompress / 238h compress) tells them apart. For other API levels replace 50 with 3E (6b, error code 0C) or 46 (7)." |
|---|
| scope | | level | "library" |
|---|
| applies_to | "Library:Libjpeg-turbo" |
|---|
| observed_in | | "Pillow 12.3.0 _imaging.cp311-win_amd64.pyd (v3.1.4.1)" |
| "PHP 8.3.30 php_gd.dll (2.1.0, MSVC 14.29)" |
| "Blender 5.2 blender.exe and openimageio.dll (2.1.3)" |
|
|---|
|
|---|
| data | | pattern | "33 ED 49 8B D8 48 89 69 08 48 8B F1 83 FA 50 74 ?? 48 8B 01 C7 40 28 0D 00 00 00 48 8B 01 C7 40 2C 50 00 00 00 48 8B 01 89 50 30 48 8B 01" |
|---|
| matches | "version check inside jpeg_CreateCompress and jpeg_CreateDecompress (two matches per build)" |
|---|
| multiple | true |
|---|
|
|---|
| evidence | | type | "byte_pattern" |
|---|
| detail | "Identical bytes in all four builds; the prologue before '33 ED' differs (40 53 55 56 57 48 83 EC 28 in Pillow, 48 89 5C 24 08 ... 57 48 83 EC 20 in PHP/Blender), and after the pattern Pillow/PHP call 'FF 10' while Blender has '48 8B 10 FF D2'" |
|---|
|
| type | "source" |
|---|
| detail | "jpeg_CreateDecompress: cinfo->mem = NULL; if (version != JPEG_LIB_VERSION) ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);" |
|---|
| repo | "https://github.com/libjpeg-turbo/libjpeg-turbo" |
|---|
| commit | "2fa570c514a4b0e70342ef8b32ce1cda21b85710" |
|---|
| path | "src/jdapimin.c" |
|---|
| lines | "39-48" |
|---|
|
|
|---|
| confidence | "medium" |
|---|
| related | |
|---|
| key | "MSVC x64 jpeg_Create version check" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T14:07:22.135Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-18T23:01:43.306Z" |
|---|
| result | "partial" |
|---|
| method | "Read src/jdapimin.c 36-50 (version and struct-size checks with ERREXIT2, JERR_BAD_LIB_VERSION and JERR_BAD_STRUCT_SIZE exist in jerror.h) at the cited commit. The machine-code bytes and the numeric values (0Dh, 50h, struct sizes) are not checkable from source alone." |
|---|
| notes | "Source half confirmed; binary half not checked." |
|---|
|
|
|---|