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

Disassembly:
sub esp, 0xc8
push ebx
push ebp
mov ebp, dword [esp + 0xd4]
mov eax, dword [ebp]
xor ebx, ebx
cmp dword [eax + 0x40], ebx
push esi
push edi
je 0x5c918a
cmp dword [eax], 0xffffffff
je 0x5c918a
cmp dword [eax + 4], ebx
jle 0x5c918a
cmp dword [eax + 8], ebx
jg 0x5c91b7
mov ecx, dword [esp + 0xe4]
mov eax, dword [ecx]
mov edx, dword [eax + 0x1c]
push str.Invalid_source_image
call edx
mov eax, dword [esp + 0xe0]
mov dword [eax], 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc8
ret 0xc
mov ecx, dword [ebp + 4]
cmp dword [ecx + 4], ebx
jne 0x5c91ec
mov ecx, dword [esp + 0xe4]
mov edx, dword [ecx]
mov eax, dword [edx + 0x1c]
push str.Invalid_color_palette
call eax
mov eax, dword [esp + 0xe0]
mov dword [eax], 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc8
ret 0xc
mov ecx, dword [eax + 4]
mov eax, dword [eax + 8]
push eax
lea edx, [esp + 0x9c]
mov dword [esp + 0x24], eax
push edx
mov eax, 0xc
mov dword [esp + 0x2c], ecx
call fcn.004d3de0
mov edi, dword [ebp + 8]
push ebx
push ebx
push ebx
lea eax, [esp + 0xa4]
call fcn.004d0d70
mov eax, dword [ebp + 8]
cmp dword [eax + 0x40], ebx
je 0x5c9236
cmp dword [eax], 0xffffffff
je 0x5c9236
cmp dword [eax + 4], ebx
jle 0x5c9236
cmp dword [eax + 8], ebx
jg 0x5c9263
mov ecx, dword [esp + 0xe4]
mov eax, dword [ecx]
mov edx, dword [eax + 0x1c]
push str.Invalid_destination_image
call edx
mov eax, dword [esp + 0xe0]
mov dword [eax], 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc8
ret 0xc
mov eax, dword [ebp + 4]
lea edi, [esp + 0x84]
call fcn.005cc990
mov edi, dword [ebp]
push ebx
lea eax, [esp + 0x2c]
call fcn.004d2430
mov ecx, dword [ebp + 8]
xor eax, eax
lea esi, [esp + 0x50]
call fcn.004d3340
mov eax, dword [ebp + 4]
xor ebp, ebp
cmp dword [esp + 0x20], ebx
mov byte [esp + 0x16], bl
mov byte [esp + 0x15], bl
mov byte [esp + 0x14], bl
mov byte [esp + 0x17], 0xff
mov esi, dword [eax + 8]
mov dword [esp + 0x18], ebp
jle 0x5c93d2
mov edi, dword [esp + 0xe4]
mov edx, dword [edi]
mov eax, dword [edx]
mov ecx, edi
call eax
test al, al
jne 0x5c93f6
fild dword [esp + 0x18]
mov edx, dword [edi]
mov eax, dword [edx + 0x24]
sub esp, 8
fidiv dword [esp + 0x28]
mov ecx, edi
fstp qword [esp]
call eax
mov eax, dword [esp + 0x24]
cmp eax, ebx
jle 0x5c93c1
mov edi, eax
lea edx, [esp + 0x28]
lea ecx, [esp + 0x80]
call dword [esp + 0x48]
cmp esi, 0xffffffff
mov eax, dword [eax]
mov dword [esp + 0x18], eax
je 0x5c9316
cmp byte [esp + 0x1b], bl
jne 0x5c9316
mov dword [esp + 0x14], esi
jmp 0x5c933c
mov cl, byte [esp + 0x1a]
lea edx, [esp + 0x1c]
mov byte [esp + 0x1d], ah
mov byte [esp + 0x1c], al
push edx
lea eax, [esp + 0x88]
push eax
mov byte [esp + 0x26], cl
call fcn.005cca40
mov dword [esp + 0x14], eax
lea edx, [esp + 0x14]
lea ecx, [esp + 0x50]
call dword [esp + 0x78]
mov ecx, dword [esp + 0x3c]
cmp ecx, dword [esp + 0x28]
jae 0x5c9380
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
add eax, dword [esp + 0x34]
add dword [esp + 0x3c], 1
add ecx, 1
cmp ecx, dword [esp + 0x2c]
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], ecx
jne 0x5c9380
add eax, dword [esp + 0x30]
mov dword [esp + 0x44], ebx
mov dword [esp + 0x40], eax
mov edx, dword [esp + 0x64]
cmp edx, dword [esp + 0x50]
jae 0x5c93b8
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x6c]
add eax, dword [esp + 0x5c]
add dword [esp + 0x64], 1
add ecx, 1
cmp ecx, dword [esp + 0x54]
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], ecx
jne 0x5c93b8
add eax, dword [esp + 0x58]
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x68], eax
sub edi, 1
jne 0x5c92f0
add ebp, 1
cmp ebp, dword [esp + 0x20]
mov dword [esp + 0x18], ebp
jl 0x5c92b4
mov esi, dword [esp + 0xe0]
mov dword [esi], ebx
lea ecx, [esp + 0x84]
call fcn.005cc9f0
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0xc8
ret 0xc
mov esi, dword [esp + 0xe0]
mov dword [esi], 1
jmp 0x5c93db