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

Disassembly:
sub esp, 0x5c
mov eax, dword [esp + 0x64]
push ebp
mov ebp, ecx
mov dword [esp + 0x14], ebp
test eax, eax
jne 0x1003c999
pop ebp
add esp, 0x5c
ret 8
push ebx
mov ebx, dword [ebp + 0xb0]
push eax
push 1
push 2
lea eax, [esp + 0x38]
shr ebx, 0xf
push eax
mov eax, dword [esp + 0x78]
and bl, 1
mov dword [esp + 0x3c], 0
mov eax, dword [eax]
call eax
cmp eax, 1
je 0x1003c9cf
pop ebx
xor eax, eax
pop ebp
add esp, 0x5c
ret 8
mov ax, word [esp + 0x2c]
mov ch, al
mov cl, ah
push esi
movzx esi, cx
mov dword [esp + 0x30], esi
test si, si
je 0x1003ca09
cmp esi, 1
je 0x1003ca09
push esi
push str.Unsupported_compression__d
push dword [ebp + 0xb4]
call sym.FreeImage.dll_FreeImage_OutputMessageProc
add esp, 0xc
xor eax, eax
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
movsx eax, word [ebp + 2]
mov ecx, dword [ebp + 4]
mov dword [esp + 0x18], eax
movzx eax, word [ebp + 0xc]
push edi
movsx edi, ax
mov edx, edi
mov dword [esp + 0x40], 1
shr edx, 3
cmp edi, 1
mov dword [esp + 0x2c], ecx
cmove edx, dword [esp + 0x40]
cmp ax, 1
mov eax, dword [esp + 0x20]
mov dword [esp + 0x38], edx
jne 0x1003ca4e
mov edx, dword [ebp + 8]
lea ebp, [edx + 7]
shr ebp, 3
jmp 0x1003ca56
mov ebp, edx
mov edx, dword [eax + 8]
imul ebp, edx
mov dword [esp + 0x30], ebp
cmp esi, 1
jne 0x1003ca84
cmp edi, 0x10
jbe 0x1003ca84
push edi
push str.Unsupported_RLE_with_depth__d
push dword [eax + 0xb4]
call sym.FreeImage.dll_FreeImage_OutputMessageProc
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
movzx eax, word [eax + 0xe]
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x44], eax
cmp ax, 7
jne 0x1003caa2
cmp esi, 3
cmovb eax, dword [esp + 0x40]
mov dword [esp + 0x44], eax
cwde
mov byte [esp + 0x13], 0
cmp eax, 9
ja case.0x1003cab8.5
movzx eax, byte [eax + 0x1003d2fc]
jmp dword [eax*4 + 0x1003d2f0]
mov dword [esp + 0x28], 1
movzx eax, bl
push 0
push 0
push 0
push edi
push ecx
push edx
cmp edi, 0x10
je 0x1003cb06
cmp edi, 0x20
je 0x1003caf3
push eax
mov byte [esp + 0x2f], 1
call sym.FreeImage.dll__FreeImage_AllocateHeader_28
mov esi, eax
mov dword [esp + 0x14], esi
jmp 0x1003cba9
push 6
push eax
call sym.FreeImage.dll__FreeImage_AllocateHeaderT_32
mov esi, eax
mov dword [esp + 0x14], esi
jmp 0x1003cba9
push 2
push eax
call sym.FreeImage.dll__FreeImage_AllocateHeaderT_32
mov esi, eax
mov dword [esp + 0x14], esi
jmp 0x1003cba9
cmp word [esp + 0x44], 7
jne 0x1003cb30
test bl, bl
jne 0x1003cb30
mov esi, 4
mov dword [esp + 0x28], esi
jmp 0x1003cb42
cmp esi, 4
jae 0x1003cb25
mov dword [esp + 0x28], esi
cmp esi, 3
jb 0x1003d20c
mov eax, esi
push 0
push 0
push 0
cmp edi, 0x10
je 0x1003cb8b
cmp edi, 0x20
je 0x1003cb6b
imul eax, edi
push eax
push ecx
push edx
movzx eax, bl
push eax
call sym.FreeImage.dll__FreeImage_AllocateHeader_28
mov esi, eax
mov dword [esp + 0x14], esi
jmp 0x1003cba9
shl eax, 5
cmp esi, 4
push eax
push ecx
sbb eax, eax
push edx
add eax, 0xc
push eax
movzx eax, bl
push eax
call sym.FreeImage.dll__FreeImage_AllocateHeaderT_32
mov esi, eax
mov dword [esp + 0x14], esi
jmp 0x1003cba9
shl eax, 4
cmp esi, 4
push eax
push ecx
sbb eax, eax
push edx
add eax, 0xa
push eax
movzx eax, bl
push eax
call sym.FreeImage.dll__FreeImage_AllocateHeaderT_32
mov esi, eax
mov dword [esp + 0x14], eax
test esi, esi
je 0x1003d223
mov eax, dword [esp + 0x20]
push dword [eax + 0x5c]
push esi
call sym.FreeImage.dll__FreeImage_SetThumbnail_8
test bl, bl
je 0x1003cbce
pop edi
mov eax, esi
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
cmp edi, 1
jne 0x1003cbd9
mov dword [esp + 0x40], edi
jmp 0x1003cbe6
push esi
call sym.FreeImage.dll__FreeImage_GetBPP_4
shr eax, 3
mov dword [esp + 0x40], eax
push esi
call sym.FreeImage.dll__FreeImage_GetPitch_4
mov ebx, dword [esp + 0x2c]
mov dword [esp + 0x54], eax
lea ecx, [ebx - 1]
push ecx
push esi
call sym.FreeImage.dll__FreeImage_GetScanLine_8
push ebp
mov dword [esp + 0x54], eax
call fcn.1026947b
movzx ecx, word [esp + 0x38]
add esp, 4
mov edi, eax
mov dword [esp + 0x4c], edi
sub ecx, 0
je 0x1003d01e
sub ecx, 1
jne 0x1003d09d
mov ebx, dword [esp + 0x1c]
mov edx, 4
imul ebx, dword [esp + 0x2c]
push 0x105a20a0
mov eax, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.102694a7
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x1003cc6a
push esi
call sym.FreeImage.dll__FreeImage_Unload_4
test edi, edi
je 0x1003d243
jmp 0x1003d23a
mov ecx, dword [esp + 0x20]
cmp word [ecx], 1
jne 0x1003cd92
xor ecx, ecx
mov eax, ebx
mov edx, 2
mul edx
push 0x105a20a0
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.102694a7
add esp, 8
mov dword [esp + 0x24], eax
test eax, eax
jne 0x1003ccb3
push esi
call sym.FreeImage.dll__FreeImage_Unload_4
test edi, edi
je 0x1003d274
jmp 0x1003d26b
mov ecx, dword [esp + 0x74]
push ecx
push ebx
push 2
push eax
mov eax, dword [esp + 0x80]
mov eax, dword [eax]
call eax
xor edx, edx
test ebx, ebx
je 0x1003cd84
mov ecx, dword [esp + 0x24]
cmp ebx, 8
jb 0x1003cd56
cmp dword [0x105a2390], 2
jl 0x1003cd56
mov eax, dword [esp + 0x18]
lea eax, [eax + ebx*4]
add eax, 0xfffffffc
cmp ecx, eax
ja 0x1003cd01
mov esi, dword [esp + 0x14]
lea eax, [ecx - 2]
lea eax, [eax + ebx*2]
cmp eax, dword [esp + 0x18]
jae 0x1003cd56
mov edi, dword [esp + 0x18]
mov eax, ebx
and eax, 0xfffffff8
nop word [eax + eax]
movq xmm0, qword [ecx + edx*2]
pshufb xmm0, xmmword [0x103f9b10]
movq qword [ecx + edx*2], xmm0
pmovzxwd xmm0, xmm0
movups xmmword [edi + edx*4], xmm0
movq xmm0, qword [ecx + edx*2 + 8]
pshufb xmm0, xmmword [0x103f9b10]
movq qword [ecx + edx*2 + 8], xmm0
pmovzxwd xmm0, xmm0
movups xmmword [edi + edx*4 + 0x10], xmm0
add edx, 8
cmp edx, eax
jb 0x1003cd10
mov edi, dword [esp + 0x4c]
cmp edx, ebx
jae 0x1003cd84
mov ebp, dword [esp + 0x18]
jmp 0x1003cd64
mov ecx, dword [esp + 0x24]
mov ax, word [ecx + edx*2]
mov ch, al
mov cl, ah
mov eax, dword [esp + 0x24]
mov word [eax + edx*2], cx
movzx eax, cx
mov dword [ebp + edx*4], eax
inc edx
cmp edx, ebx
jb 0x1003cd60
mov ebp, dword [esp + 0x30]
push dword [esp + 0x24]
call fcn.10269476
add esp, 4
jmp 0x1003cdff
mov ecx, dword [esp + 0x74]
push ecx
push ebx
push 4
push eax
mov eax, dword [esp + 0x80]
mov eax, dword [eax]
call eax
xor ecx, ecx
test ebx, ebx
je 0x1003cdff
mov edx, dword [esp + 0x18]
cmp ebx, 8
jb 0x1003cdee
cmp dword [0x105a2390], 2
jl 0x1003cdee
mov eax, ebx
and eax, 0xfffffff8
movups xmm0, xmmword [edx + ecx*4]
pshufb xmm0, xmmword [0x103f9b00]
movups xmmword [edx + ecx*4], xmm0
movups xmm0, xmmword [edx + ecx*4 + 0x10]
pshufb xmm0, xmmword [0x103f9b00]
movups xmmword [edx + ecx*4 + 0x10], xmm0
add ecx, 8
cmp ecx, eax
jb 0x1003cdc3
cmp ecx, ebx
jae 0x1003cdff
mov eax, dword [edx + ecx*4]
bswap eax
mov dword [edx + ecx*4], eax
inc ecx
cmp ecx, ebx
jb 0x1003cdf2
xor ecx, ecx
cmp dword [esp + 0x1c], ecx
jbe 0x1003cef9
mov edi, dword [esp + 0x18]
xor eax, eax
mov edx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x2c]
mov dword [esp + 0x24], eax
lea ebx, [edi + 0x10]
mov dword [esp + 0x3c], edx
mov dword [esp + 0x48], ebx
nop dword [eax + eax]
xor esi, esi
test ebp, ebp
je 0x1003cecd
cmp ebp, 8
jb 0x1003cea7
cmp dword [0x105a2390], 2
jl 0x1003cea7
movd xmm0, ecx
mov edx, ebp
pshufd xmm1, xmm0, 0
and edx, 0xfffffff8
movaps xmm2, xmm1
mov eax, ebx
nop dword [eax + eax]
movups xmm0, xmmword [eax - 0x10]
add esi, 8
lea eax, [eax + 0x20]
pmaxud xmm1, xmm0
movups xmm0, xmmword [eax - 0x20]
pmaxud xmm2, xmm0
cmp esi, edx
jb 0x1003ce60
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x3c]
pmaxud xmm1, xmm2
movaps xmm0, xmm1
psrldq xmm0, 8
pmaxud xmm1, xmm0
movaps xmm0, xmm1
psrldq xmm0, 4
pmaxud xmm1, xmm0
movd ecx, xmm1
cmp esi, ebp
jae 0x1003cecd
add eax, esi
mov ebx, ebp
sub ebx, esi
lea edx, [edi + eax*4]
cmp ecx, dword [edx]
cmovb ecx, dword [edx]
lea edx, [edx + 4]
sub ebx, 1
jne 0x1003ceb4
mov eax, dword [esp + 0x24]
mov ebx, dword [esp + 0x48]
mov edx, dword [esp + 0x3c]
lea esi, [ebp*4]
add eax, ebp
add ebx, esi
mov dword [esp + 0x24], eax
sub edx, 1
mov dword [esp + 0x48], ebx
mov dword [esp + 0x3c], edx
jne 0x1003ce30
mov edi, dword [esp + 0x4c]
mov ebp, dword [esp + 0x30]
mov esi, dword [esp + 0x14]
push 0x105a20a0
push ecx
call fcn.102694a7
mov ebx, eax
add esp, 8
mov dword [esp + 0x24], ebx
test ebx, ebx
jne 0x1003cf24
push esi
call sym.FreeImage.dll__FreeImage_Unload_4
test edi, edi
je 0x1003d2a5
jmp 0x1003d29c
xor eax, eax
mov dword [esp + 0x48], eax
cmp dword [esp + 0x1c], eax
jbe 0x1003cffd
mov ecx, dword [esp + 0x2c]
shl ecx, 2
mov dword [esp + 0x5c], ecx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x3c], ecx
nop word [eax + eax]
cmp eax, dword [esp + 0x28]
jae 0x1003cff9
mov ecx, dword [esp + 0x20]
push eax
push esi
call fcn.1003c300
mov ebx, eax
mov eax, dword [esp + 0x2c]
imul ebx, dword [esp + 0x38]
add ebx, dword [esp + 0x50]
test eax, eax
je 0x1003cfde
lea ecx, [edi + ebp]
mov dword [esp + 0x4c], eax
mov ebp, dword [esp + 0x3c]
mov dword [esp + 0x58], ecx
nop word [eax + eax]
push dword [esp + 0x74]
mov esi, dword [ebp]
mov eax, dword [esp + 0x74]
push 1
push esi
push dword [esp + 0x30]
mov eax, dword [eax]
call eax
push esi
push dword [esp + 0x5c]
push dword [esp + 0x2c]
push edi
call fcn.1003c900
push dword [esp + 0x38]
push dword [esp + 0x44]
push dword [esp + 0x38]
push edi
push ebx
call fcn.1003c820
sub ebx, dword [esp + 0x54]
lea ebp, [ebp + 4]
sub dword [esp + 0x4c], 1
jne 0x1003cf90
mov ebp, dword [esp + 0x30]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x5c]
inc eax
add dword [esp + 0x3c], ecx
mov dword [esp + 0x48], eax
cmp eax, dword [esp + 0x1c]
jb 0x1003cf50
mov ebx, dword [esp + 0x24]
test edi, edi
je 0x1003d00a
push edi
call fcn.10269476
add esp, 4
push dword [esp + 0x18]
call fcn.10269476
push ebx
call fcn.10269476
add esp, 8
jmp 0x1003d09d
xor eax, eax
mov dword [esp + 0x4c], eax
cmp dword [esp + 0x1c], eax
jbe 0x1003d090
nop word [eax + eax]
cmp eax, dword [esp + 0x28]
jae 0x1003d090
mov ecx, dword [esp + 0x20]
push eax
push esi
call fcn.1003c300
mov esi, eax
imul esi, dword [esp + 0x38]
add esi, dword [esp + 0x50]
test ebx, ebx
je 0x1003d07d
push dword [esp + 0x74]
mov eax, dword [esp + 0x74]
push 1
push ebp
push edi
mov eax, dword [eax]
call eax
push dword [esp + 0x38]
push dword [esp + 0x44]
push ebp
push edi
push esi
call fcn.1003c820
sub esi, dword [esp + 0x54]
sub ebx, 1
jne 0x1003d050
mov ebx, dword [esp + 0x2c]
mov eax, dword [esp + 0x4c]
mov esi, dword [esp + 0x14]
inc eax
mov dword [esp + 0x4c], eax
cmp eax, dword [esp + 0x1c]
jb 0x1003d030
test edi, edi
je 0x1003d09d
push edi
call fcn.10269476
add esp, 4
mov ebp, dword [esp + 0x44]
cmp bp, 4
je 0x1003d187
cmp bp, 7
je 0x1003d17e
mov ebx, dword [esp + 0x20]
cmp bp, 9
jne 0x1003d0df
test byte [ebx + 0xb0], 2
jne 0x1003d0df
mov ecx, esi
call fcn.1003ea50
mov edi, dword [esp + 0x14]
mov eax, edi
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
cmp byte [esp + 0x13], 0
je 0x1003d0cf
push esi
call sym.FreeImage.dll__FreeImage_GetPalette_4
test eax, eax
je 0x1003d0cf
test bp, bp
jne 0x1003d123
mov edi, dword [esp + 0x14]
mov ebx, 0xffffff
xor esi, esi
push edi
call sym.FreeImage.dll__FreeImage_GetPalette_4
mov dword [eax + esi], ebx
add esi, 4
sub ebx, 0xffffff
cmp esi, 8
jb 0x1003d100
mov eax, edi
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
cmp bp, 2
jne 0x1003d0cf
cmp dword [ebx + 0x14], 0
je 0x1003d15b
cmp dword [ebx + 0x10], 0x300
lea ecx, [ebx + 0x10]
jne 0x1003d15b
cmp word [ebx + 0xa0], 0
jl 0x1003d15b
push esi
call fcn.1003aee0
mov edi, dword [esp + 0x14]
mov eax, edi
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
push str.Indexed_image_has_no_palette._Using_the_default_grayscale_one.
push dword [ebx + 0xb4]
call sym.FreeImage.dll_FreeImage_OutputMessageProc
mov edi, dword [esp + 0x1c]
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
mov ecx, esi
call fcn.1003bf40
jmp 0x1003d18d
push esi
call sym.FreeImage.dll__FreeImage_Invert_4
mov ebx, dword [esp + 0x20]
test byte [ebx + 0xb0], 1
je 0x1003d1c8
cmp bp, 7
jne 0x1003d0cf
push 0
push 0
push esi
call sym.FreeImage.dll__FreeImage_CreateICCProfile_12
push esi
call sym.FreeImage.dll__FreeImage_GetICCProfile_4
mov edi, dword [esp + 0x14]
or word [eax], 1
mov eax, edi
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
mov ecx, esi
call fcn.1003e630
lea ecx, [ebx + 0x64]
call fcn.1003bc60
mov eax, dword [esp + 0x1c]
cmp eax, 4
je 0x1003d1e9
cmp eax, 3
jne 0x1003d0cf
mov ecx, esi
call fcn.1003eb70
mov edi, eax
test edi, edi
je 0x1003d0cf
push esi
call sym.FreeImage.dll__FreeImage_Unload_4
mov eax, edi
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x5c
ret 8
push 0x10410bfc
lea eax, [esp + 0x78]
mov dword [esp + 0x78], str.Invalid_number_of_channels
push eax
call fcn.1026eb3b
push 0x10410b74
lea eax, [esp + 0x78]
mov dword [esp + 0x78], str.DIB_allocation_failed__maybe_caused_by_an_invalid_image_size_or_by_a_lack_of_memory
push eax
call fcn.1026eb3b
push edi
call fcn.10269476
add esp, 4
xorps xmm0, xmm0
mov dword [esp + 0x60], vtable.std::bad_alloc.0
push 0x10410e84
lea eax, [esp + 0x64]
movq qword [esp + 0x68], xmm0
push eax
mov dword [esp + 0x6c], str.bad_allocation
call fcn.1026eb3b
push edi
call fcn.10269476
add esp, 4
xorps xmm0, xmm0
mov dword [esp + 0x60], vtable.std::bad_alloc.0
push 0x10410e84
lea eax, [esp + 0x64]
movq qword [esp + 0x68], xmm0
push eax
mov dword [esp + 0x6c], str.bad_allocation
call fcn.1026eb3b
push edi
call fcn.10269476
add esp, 4
push dword [esp + 0x18]
call fcn.10269476
add esp, 4
mov dword [esp + 0x60], vtable.std::bad_alloc.0
xorps xmm0, xmm0
lea eax, [esp + 0x60]
movq qword [esp + 0x64], xmm0
mov dword [esp + 0x64], str.bad_allocation
push 0x10410e84
push eax
call fcn.1026eb3b
push 0x10410bfc
lea eax, [esp + 0x78]
mov dword [esp + 0x78], str.Unsupported_color_mode
push eax
call fcn.1026eb3b
mov edi, 0x191003ca
retf