Function at 0x51b7b0
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x29c
mov eax, dword [0x641a90]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x284], eax
lea eax, [ebp - 0x108]
push edi
mov edi, dword [ebp + 0xc]
push eax
mov dword [ebp - 0x278], edi
call fcn.00462ec0
lea ecx, [ebp - 0x108]
add esp, 4
dec ecx
lea ecx, [ecx]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x51b7f0
mov eax, dword [str.pcdlib32.dll]
mov dword [ecx], eax
mov eax, dword [0x5f0cf0]
mov dword [ecx + 4], eax
mov eax, dword [0x5f0cf4]
mov dword [ecx + 8], eax
mov al, byte [0x5f0cf8]
mov byte [ecx + 0xc], al
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
mov dword [ebp - 0x29c], ebx
test ebx, ebx
jne 0x51b845
pop edi
lea eax, [ebx + 2]
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005920c1
mov esp, ebp
pop ebp
ret
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.PCDopen
push ebx
call esi
push str.PCDsetResolution
push ebx
mov dword [ebp - 0x28c], eax
call esi
push str.PCDsetFormat
push ebx
mov dword [ebp - 0x274], eax
call esi
push str.PCDloadImage
push ebx
mov dword [ebp - 0x298], eax
call esi
push str.PCDclose
push ebx
mov dword [ebp - 0x280], eax
call esi
push str.PCDgetRotation
push ebx
mov dword [ebp - 0x290], eax
call esi
mov ecx, eax
mov eax, dword [ebp - 0x28c]
mov dword [ebp - 0x294], ecx
test eax, eax
je 0x51bc1b
cmp dword [ebp - 0x274], 0
je 0x51bc1b
cmp dword [ebp - 0x298], 0
je 0x51bc1b
cmp dword [ebp - 0x280], 0
je 0x51bc1b
test ecx, ecx
je 0x51bc1b
cmp dword [ebp - 0x290], 0
je 0x51bc1b
lea ecx, [ebp - 0x27c]
push ecx
push dword [ebp - 0x284]
call eax
add esp, 8
test ax, ax
jne 0x51bc1b
movsx eax, byte [edi + 0xfc]
cmp eax, 5
ja case.0x51b913.2
jmp dword [eax*4 + 0x51bc38]
mov ebx, 1
lea esi, [ebx + 0x7f]
lea edi, [esi + 0x40]
jmp 0x51b97a
mov ebx, 2
mov esi, 0x100
mov edi, 0x180
jmp 0x51b97a
mov ebx, 4
mov esi, 0x400
mov edi, 0x600
jmp 0x51b97a
mov ebx, 5
mov esi, 0x800
mov edi, 0xc00
jmp 0x51b97a
mov ebx, 6
mov esi, 0x1000
mov edi, 0x1800
jmp 0x51b97a
mov ebx, 3
mov esi, 0x200
mov edi, 0x300
lea eax, [ebp - 0x270]
push eax
call fcn.00457d90
mov eax, dword [ebp - 0x278]
add esp, 4
test dword [eax + 0x8c], 0x800
je 0x51ba17
mov ebx, 1
lea eax, [ebp - 0x288]
push eax
push dword [ebp - 0x27c]
lea esi, [ebx + 0x7f]
lea edi, [esi + 0x40]
call dword [ebp - 0x294]
add esp, 8
test byte [ebp - 0x288], 4
je 0x51b9e5
mov dword [ebp - 0x244], 0x800
mov dword [ebp - 0x240], 0xc00
mov dword [ebp - 0x23c], 0x1800
jmp 0x51ba03
mov dword [ebp - 0x244], 0xc00
mov dword [ebp - 0x240], 0x800
mov dword [ebp - 0x23c], 0x2400
mov dword [ebp - 0x238], 8
mov dword [ebp - 0x234], 3
movzx eax, bx
push eax
push dword [ebp - 0x27c]
call dword [ebp - 0x274]
push 0xb
push dword [ebp - 0x27c]
call dword [ebp - 0x298]
lea eax, [ebp - 0x288]
push eax
push dword [ebp - 0x27c]
call dword [ebp - 0x294]
add esp, 0x18
test byte [ebp - 0x288], 4
je 0x51ba5a
mov eax, edi
mov edi, esi
mov esi, eax
mov eax, dword [0x5d3434]
movq xmm0, qword [str.Kodak_Photo_CD]
mov dword [ebp - 0x182], eax
mov ax, word [0x5d3438]
mov word [ebp - 0x17e], ax
mov al, byte [0x5d343a]
mov byte [ebp - 0x17c], al
mov eax, 0x10
mov word [ebp - 0x26c], ax
lea eax, [edi + edi*2]
mov dword [ebp - 0x250], eax
lea eax, [ebp - 0x270]
mov dword [ebp - 0x260], edi
mov edi, dword [ebp - 0x278]
push eax
push edi
movq qword [ebp - 0x18a], xmm0
mov dword [ebp - 0x270], 8
mov dword [ebp - 0x258], 0x180001
mov dword [ebp - 0x25c], esi
call fcn.00456000
movzx ebx, ax
add esp, 8
test bx, bx
jne 0x51bbe5
lea eax, [ebp - 0x274]
push eax
push 0
push dword [ebp - 0x27c]
call dword [ebp - 0x280]
add esp, 0xc
test ax, ax
je 0x51bb0b
mov ebx, 4
jmp 0x51bbd6
push dword [ebp - 0x274]
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, eax
mov dword [ebp - 0x28c], ecx
test ecx, ecx
je 0x51bc14
cmp dword [ecx], 0x28
jne 0x51bc14
cmp word [ecx + 0xe], 0x18
jne 0x51bc14
mov eax, dword [ecx + 4]
xor edi, edi
lea eax, [eax + eax*2]
lea eax, [eax*8 + 0x1f]
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
shl eax, 2
mov dword [ebp - 0x284], eax
test esi, esi
jle 0x51bbb8
xor ebx, ebx
mov eax, dword [ecx + 0x20]
push dword [ebp - 0x250]
add eax, 0xa
lea eax, [ebx + eax*4]
add eax, ecx
push eax
push dword [ebp - 0x264]
call fcn.00592150
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp - 0x278]
call fcn.004585b0
movzx eax, ax
add esp, 0x1c
mov dword [ebp - 0x280], eax
test ax, ax
jne 0x51bbb2
add ebx, dword [ebp - 0x284]
inc edi
mov ecx, dword [ebp - 0x28c]
cmp edi, esi
jl 0x51bb62
mov ebx, dword [ebp - 0x280]
mov edi, dword [ebp - 0x278]
push dword [ebp - 0x274]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push dword [ebp - 0x274]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push 0
push 0
push 0
push edi
call fcn.00453f80
add esp, 0x10
push dword [ebp - 0x27c]
call dword [ebp - 0x290]
add esp, 4
push dword [ebp - 0x29c]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop esi
pop edi
mov ax, bx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005920c1
mov esp, ebp
pop ebp
ret
mov ebx, 4
jmp 0x51bbbe
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov ecx, dword [ebp - 4]
mov eax, 2
pop esi
pop edi
xor ecx, ebp
pop ebx
call fcn.005920c1
mov esp, ebp
pop ebp
ret