Function at 0x51b580
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x40
push esi
mov esi, dword [esp + 0x48]
push edi
mov eax, 0xff
mov edi, 0x55
mov byte [esp + 8], 0x49
test esi, esi
mov byte [esp + 9], 0x44
mov byte [esp + 0xa], 0x41
mov byte [esp + 0xb], 0x54
mov byte [esp + 0xc], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], 0xf
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], 0x33
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], 0x80
mov dword [esp + 0x30], 8
mov dword [esp + 0x34], 0x88
mov dword [esp + 0x38], 0x22
mov dword [esp + 0x3c], 0xaa
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], eax
je 0x51ba13
test byte [esi + 0x6c], 0x40
jne 0x51b617
push esi
call fcn.0052bdc0
add esp, 4
mov al, byte [esi + 0x123]
test al, al
je case.default.0x51b640
test byte [esi + 0x70], 2
je case.default.0x51b640
xor eax, eax
mov al, byte [esi + 0x124]
cmp eax, 6
ja case.default.0x51b640
jmp dword [eax*4 + 0x51ba1c]
test byte [esi + 0xe4], 7
je case.default.0x51b640
mov eax, dword [esp + 0x54]
test eax, eax
je 0x51b66b
push 0xff
push eax
push esi
call fcn.0052b0b0
add esp, 0xc
push esi
call fcn.0052ba60
add esp, 4
pop edi
pop esi
add esp, 0x40
ret
test byte [esi + 0xe4], 7
jne 0x51b690
cmp dword [esi + 0xc8], 5
jae case.default.0x51b640
mov eax, dword [esp + 0x54]
test eax, eax
je 0x51b66b
push 0xf
jmp 0x51b661
mov eax, dword [esi + 0xe4]
mov ecx, eax
and ecx, 7
cmp cl, 4
je case.default.0x51b640
mov ecx, dword [esp + 0x54]
test ecx, ecx
je 0x51b66b
test al, 4
je 0x51b66b
push 0xff
push ecx
jmp 0x51b662
mov cl, byte [esi + 0xe4]
mov eax, 3
test al, cl
jne 0x51b6db
cmp dword [esi + 0xc8], eax
jae case.default.0x51b640
mov eax, dword [esp + 0x54]
test eax, eax
je 0x51b66b
push 0x33
jmp 0x51b661
mov eax, dword [esi + 0xe4]
mov edx, eax
and edx, 3
cmp dl, 2
je case.default.0x51b640
mov ecx, dword [esp + 0x54]
test ecx, ecx
je 0x51b66b
test al, 2
je 0x51b66b
push 0xff
push ecx
jmp 0x51b662
test byte [esi + 0xe4], 1
jne 0x51b72b
cmp dword [esi + 0xc8], 2
jae case.default.0x51b640
mov eax, dword [esp + 0x54]
test eax, eax
je 0x51b66b
push edi
jmp 0x51b661
test byte [esi + 0xe4], 1
je 0x51b66b
test byte [esi + 0x68], 4
jne 0x51b75e
push str.Invalid_attempt_to_read_row_data
push esi
call fcn.00528380
add esp, 8
mov eax, dword [esi + 0xec]
mov ecx, dword [esi + 0xdc]
mov dword [esi + 0x80], eax
mov dword [esi + 0x84], ecx
mov eax, dword [esi + 0x78]
test eax, eax
jne 0x51b806
mov eax, dword [esi + 0x10c]
test eax, eax
jne 0x51b7c8
push 0
push esi
call fcn.00528880
push esi
call fcn.005287f0
lea edx, [esp + 0x14]
mov dword [esi + 0x10c], eax
mov eax, dword [esi + 0x11c]
add esp, 0xc
cmp eax, dword [edx]
je 0x51b7be
push str.Not_enough_image_data
push esi
call fcn.00528380
add esp, 8
mov eax, dword [esi + 0x10c]
test eax, eax
je 0x51b78b
mov eax, dword [esi + 0xb0]
mov ecx, dword [esi + 0x10c]
mov edx, dword [esi + 0xac]
cmp eax, ecx
mov dword [esi + 0x78], eax
mov dword [esi + 0x74], edx
jbe 0x51b7e7
mov dword [esi + 0x78], ecx
mov ecx, dword [esi + 0x78]
push ecx
push edx
push esi
call fcn.00528850
mov edx, dword [esi + 0x78]
mov eax, dword [esi + 0x10c]
add esp, 0xc
sub eax, edx
mov dword [esi + 0x10c], eax
lea eax, [esi + 0x74]
push 1
push eax
call fcn.00420820
add esp, 8
cmp eax, 1
je 0x51b845
test eax, eax
je 0x51b836
mov eax, dword [esi + 0x8c]
test eax, eax
jne 0x51b82c
mov eax, str.Decompression_error
push eax
push esi
call fcn.00528380
add esp, 8
mov eax, dword [esi + 0x84]
test eax, eax
je 0x51b87f
jmp 0x51b776
mov eax, dword [esi + 0x84]
test eax, eax
jne 0x51b860
mov eax, dword [esi + 0x78]
test eax, eax
jne 0x51b860
mov eax, dword [esi + 0x10c]
test eax, eax
je 0x51b86e
push str.Extra_compressed_data
push esi
call fcn.00528380
add esp, 8
mov ecx, dword [esi + 0x68]
mov eax, dword [esi + 0x6c]
or ecx, 8
or al, 0x20
mov dword [esi + 0x68], ecx
mov dword [esi + 0x6c], eax
mov al, byte [esi + 0x127]
mov cl, byte [esi + 0x126]
mov dl, byte [esi + 0x12a]
mov byte [esi + 0x109], al
mov al, byte [esi + 0x129]
mov byte [esi + 0x108], cl
mov ecx, dword [esi + 0xe0]
lea edi, [esi + 0x100]
cmp al, 8
mov byte [esi + 0x10a], dl
mov dword [edi], ecx
mov byte [esi + 0x10b], al
jb 0x51b8ce
and eax, 0xff
shr eax, 3
imul eax, ecx
jmp 0x51b8dc
and eax, 0xff
imul eax, ecx
add eax, 7
shr eax, 3
mov ecx, dword [esi + 0xec]
mov dword [esi + 0x104], eax
mov al, byte [ecx]
test al, al
je 0x51b908
mov edx, dword [esi + 0xe8]
and eax, 0xff
inc edx
push eax
inc ecx
push edx
push ecx
push edi
push esi
call fcn.0052b880
add esp, 0x14
mov eax, dword [esi + 0xd8]
mov ecx, dword [esi + 0xec]
mov edx, dword [esi + 0xe8]
inc eax
push eax
push ecx
push edx
push esi
call fcn.005282e0
mov al, byte [esi + 0x230]
add esp, 0x10
test al, 4
je 0x51b94b
cmp byte [esi + 0x238], 0x40
jne 0x51b94b
mov eax, dword [esi + 0xec]
inc eax
push eax
push edi
call fcn.00520b20
add esp, 8
mov eax, dword [esi + 0x70]
test eax, eax
jne 0x51b95b
test dword [esi + 0x6c], 0x400000
je 0x51b964
push esi
call fcn.0051d410
add esp, 4
mov al, byte [esi + 0x123]
test al, al
je 0x51b9bc
test byte [esi + 0x70], 2
je 0x51b9bc
cmp byte [esi + 0x124], 6
jae 0x51b986
push esi
call fcn.0052b3f0
add esp, 4
mov eax, dword [esp + 0x54]
test eax, eax
je 0x51b9a5
xor ecx, ecx
mov cl, byte [esi + 0x124]
mov edx, dword [esp + ecx*4 + 0x10]
push edx
push eax
push esi
call fcn.0052b0b0
add esp, 0xc
mov eax, dword [esp + 0x50]
test eax, eax
je 0x51b9ea
xor ecx, ecx
mov cl, byte [esi + 0x124]
mov edx, dword [esp + ecx*4 + 0x2c]
push edx
jmp 0x51b9e0
mov eax, dword [esp + 0x50]
test eax, eax
je 0x51b9d3
push 0xff
push eax
push esi
call fcn.0052b0b0
add esp, 0xc
mov eax, dword [esp + 0x54]
test eax, eax
je 0x51b9ea
push 0xff
push eax
push esi
call fcn.0052b0b0
add esp, 0xc
push esi
call fcn.0052ba60
mov eax, dword [esi + 0x198]
add esp, 4
test eax, eax
je 0x51ba13
mov edx, dword [esi + 0xe4]
xor ecx, ecx
mov cl, byte [esi + 0x124]
push ecx
push edx
push esi
call eax
add esp, 0xc
pop edi
pop esi
add esp, 0x40
ret