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

Disassembly:
push 0xffffffffffffffff
push 0x487293
mov eax, dword fs:[0]
push eax
sub esp, 0xf0
push ebx
push ebp
push esi
push edi
mov eax, dword [0x504a70]
xor eax, esp
push eax
lea eax, [esp + 0x104]
mov dword fs:[0], eax
mov edi, ecx
lea eax, [edi - 8]
cmp eax, 0xf8
ja 0x40cbd1
xor eax, eax
xor ebx, ebx
xor cl, cl
test cl, cl
mov byte [esp + 0x17], 1
mov dword [esp + 0x18], ebx
mov byte [esp + 0x98], cl
mov dword [esp + 0xc0], ebx
mov dword [esp + 0xc8], ebx
mov dword [esp + 0xcc], ebx
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], eax
mov dword [esp + 0xa8], eax
mov dword [esp + 0xac], eax
mov dword [esp + 0xb0], eax
mov dword [esp + 0xb4], eax
mov dword [esp + 0xb8], eax
mov dword [esp + 0xbc], eax
je 0x40c72c
mov dword [esp + 0x18], 1
mov dword [esp + 0x10c], ebx
xor eax, eax
xor cl, cl
test cl, cl
mov dword [esp + 0x9c], ebx
mov byte [esp + 0x50], cl
mov dword [esp + 0x54], 7
mov dword [esp + 0x78], ebx
mov dword [esp + 0x7c], ebx
mov dword [esp + 0x84], ebx
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
je 0x40c782
add dword [esp + 0x18], 1
mov ebp, dword [esp + 0x118]
mov byte [esp + 0x10c], 1
lea ecx, [esp + 0x50]
lea eax, [esp + 0x20]
mov dword [esp + 0xc4], ecx
mov ecx, dword [ebp + 4]
push eax
lea edx, [esp + 0x9c]
push ecx
mov dword [esp + 0x88], edx
mov dword [esp + 0x28], ebx
call sub.gdiplus.dll_GdipGetImageWidth
cmp eax, ebx
je 0x40c7c3
mov dword [ebp + 8], eax
mov eax, dword [ebp + 4]
lea edx, [esp + 0x30]
push edx
push eax
mov dword [esp + 0x38], ebx
call sub.gdiplus.dll_GdipGetImageHeight
cmp eax, ebx
je 0x40c7dc
mov dword [ebp + 8], eax
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x30]
lea edx, [esp + 0xe8]
push edx
push 0x21808
push 1
lea eax, [esp + 0x94]
mov dword [esp + 0x9c], ecx
mov ecx, dword [ebp + 4]
push eax
push ecx
mov dword [esp + 0x54], esi
mov dword [esp + 0x9c], ebx
mov dword [esp + 0xa0], ebx
mov dword [esp + 0xa8], esi
call sub.gdiplus.dll_GdipBitmapLockBits
cmp eax, ebx
je 0x40c8ac
mov dword [ebp + 8], eax
mov byte [esp + 0x17], 0
mov edx, dword [esp + 0x114]
mov al, byte [edx + 0x1c]
test al, al
je 0x40c847
mov byte [esp + 0x17], 0
mov byte [esp + 0x10c], 0
xor esi, esi
mov edi, dword [esp + esi*4 + 0x58]
cmp edi, ebx
je 0x40c869
mov ecx, edi
call fcn.0040cc60
push edi
call fcn.00456d4d
add esp, 4
add esi, 1
cmp esi, 8
jb 0x40c851
mov dword [esp + 0x10c], 0xffffffff
xor esi, esi
mov edi, edi
mov edi, dword [esp + esi*4 + 0xa0]
cmp edi, ebx
je 0x40c89b
mov ecx, edi
call fcn.0040cc60
push edi
call fcn.00456d4d
add esp, 4
add esi, 1
cmp esi, 8
jb 0x40c880
mov al, byte [esp + 0x17]
jmp 0x40cbd3
mov ecx, dword [esp + 0xf8]
mov eax, dword [esp + 0xf0]
test eax, eax
mov ebx, ecx
mov dword [esp + 0x1c], ebx
jg 0x40c8d1
mov ebx, esi
imul ebx, eax
add ebx, ecx
mov dword [esp + 0x1c], ebx
neg eax
test esi, esi
mov dword [esp + 0x34], eax
mov eax, ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x24], 0
jbe 0x40c9d7
cmp dword [esp + 0x20], 0
mov esi, eax
mov dword [esp + 0x2c], 0
jbe 0x40c9a8
movzx eax, byte [esi]
movzx ecx, byte [esi + 1]
add esi, 1
movzx edx, byte [esi + 1]
lea ebx, [esp + 0x18]
push ebx
add esi, 1
push eax
push ecx
push edx
lea eax, [esp + 0xa8]
lea ecx, [esp + 0x60]
add esi, 1
call fcn.0040cd00
cmp dword [esp + 0x18], edi
jbe 0x40c97a
mov eax, dword [esp + 0x114]
mov cl, byte [eax + 0x1c]
test cl, cl
mov edx, dword [esp + 0xc4]
jne 0x40c97a
mov ecx, dword [esp + 0xc4]
cmp dword [ecx + 0x2c], 0
lea eax, [ecx + 0x2c]
je 0x40c97a
mov ebp, dword [eax]
mov ebx, dword [ecx + 0x30]
add ecx, 0x30
mov dword [ebx + 0x2c], ebp
mov eax, dword [eax]
mov ecx, dword [ecx]
mov dword [eax + 0x30], ecx
lea eax, [esp + 0x18]
push eax
push edx
call fcn.0040cde0
cmp dword [esp + 0x18], edi
ja 0x40c932
mov ecx, dword [esp + 0x114]
mov dl, byte [ecx + 0x1c]
test dl, dl
jne 0x40c99d
mov eax, dword [esp + 0x2c]
add eax, 1
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x2c], eax
jb 0x40c900
mov ebp, dword [esp + 0x118]
mov ebx, dword [esp + 0x1c]
mov eax, dword [esp + 0x114]
mov cl, byte [eax + 0x1c]
test cl, cl
jne 0x40c9d7
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
add eax, dword [esp + 0x34]
add ecx, 1
cmp ecx, dword [esp + 0x30]
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], ecx
jb 0x40c8eb
mov edx, dword [esp + 0x114]
mov al, byte [edx + 0x1c]
test al, al
jne 0x40cbae
mov ecx, dword [esp + 0x18]
lea edx, [ecx*4 + 8]
push edx
call fcn.00456d48
mov ebp, eax
add esp, 4
test ebp, ebp
mov dword [esp + 0x44], ebp
je 0x40cba2
lea ecx, [esp + 0x48]
push ecx
mov dword [ebp], 1
mov eax, dword [esp + 0x1c]
push ebp
lea ecx, [esp + 0x58]
mov dword [ebp + 4], eax
mov dword [esp + 0x50], 0
call fcn.0040ce70
mov edi, dword [esp + 0x11c]
mov edx, dword [edi + 4]
push ebp
push edx
call sub.gdiplus.dll_GdipSetImagePalette
test eax, eax
je 0x40ca48
mov dword [edi + 8], eax
mov edx, dword [edi + 4]
lea eax, [esp + 0xd0]
push eax
push 0x30803
push 2
lea ecx, [esp + 0x94]
push ecx
push edx
call sub.gdiplus.dll_GdipBitmapLockBits
test eax, eax
je 0x40ca82
mov dword [edi + 8], eax
mov byte [esp + 0x17], 0
push ebp
call fcn.00456d4d
add esp, 4
jmp 0x40cba7
mov ecx, dword [esp + 0xd8]
test ecx, ecx
mov edx, dword [esp + 0xe0]
mov esi, dword [esp + 0x30]
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], edx
jg 0x40caad
mov eax, esi
imul eax, ecx
add eax, edx
mov dword [esp + 0x1c], eax
neg ecx
test esi, esi
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], 0
jbe 0x40cb7b
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x20]
test eax, eax
jbe 0x40cb48
mov dword [esp + 0x28], eax
movzx edx, byte [ebx]
movzx esi, byte [ebx + 1]
add ebx, 1
movzx edi, byte [ebx + 1]
add ebx, 1
add ebx, 1
cmp byte [esp + 0x50], 0
mov dword [esp + 0x4c], edi
je 0x40cafa
mov eax, dword [esp + 0x78]
jmp 0x40cb29
mov ecx, dword [esp + 0x54]
mov eax, esi
shr eax, cl
shr edi, cl
mov ebp, edx
shr ebp, cl
and eax, 1
and edi, 1
lea eax, [eax + edi*2]
mov edi, dword [esp + 0x4c]
add eax, eax
and ebp, 1
add eax, ebp
mov eax, dword [esp + eax*4 + 0x58]
call fcn.0040cda0
mov ebp, dword [esp + 0x44]
mov ecx, dword [esp + 0x24]
mov byte [ecx], al
add ecx, 1
sub dword [esp + 0x28], 1
mov dword [esp + 0x24], ecx
jne 0x40cad5
mov ebx, dword [esp + 0x2c]
mov edi, dword [esp + 0x11c]
mov edx, dword [esp + 0x114]
add ebx, dword [esp + 0x34]
mov ecx, dword [esp + 0x38]
mov al, byte [edx + 0x1c]
add dword [esp + 0x1c], ecx
test al, al
mov dword [esp + 0x2c], ebx
jne 0x40cb7b
mov eax, dword [esp + 0x3c]
add eax, 1
cmp eax, dword [esp + 0x40]
mov dword [esp + 0x3c], eax
jb 0x40cac1
mov edx, dword [edi + 4]
lea ecx, [esp + 0xd0]
push ecx
push edx
call sub.gdiplus.dll_GdipBitmapUnlockBits
test eax, eax
je 0x40ca74
push ebp
mov dword [edi + 8], eax
call fcn.00456d4d
add esp, 4
jmp 0x40cba7
mov byte [esp + 0x17], 0
mov ebp, dword [esp + 0x118]
mov ecx, dword [ebp + 4]
lea eax, [esp + 0xe8]
push eax
push ecx
call sub.gdiplus.dll_GdipBitmapUnlockBits
xor ebx, ebx
test eax, eax
je 0x40c834
mov dword [ebp + 8], eax
jmp 0x40c834
xor al, al
mov ecx, dword [esp + 0x104]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xfc
ret 0xc