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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x7c
mov eax, dword [0x476028]
xor eax, esp
mov dword [esp + 0x78], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov ebx, ecx
xor esi, esi
cmp ebx, esi
push edi
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], ebx
je 0x405f90
mov eax, dword [ebx + 8]
cmp eax, esi
mov dword [ebx + 8], esi
jne 0x405f90
push 0x37
lea ecx, [esp + 0x51]
push esi
push ecx
mov dword [esp + 0x20], esi
mov byte [esp + 0x58], 0
call sub.MSVCR80.dll_memset
mov eax, dword [ebx + 4]
add esp, 0xc
lea edx, [esp + 0xc]
push edx
push eax
mov dword [esp + 0x14], esi
call sub.gdiplus.dll_GdipGetImageWidth
cmp eax, esi
je 0x405e2e
mov dword [ebx + 8], eax
mov ecx, dword [esp + 0xc]
mov eax, dword [ebx + 4]
lea edx, [esp + 0xc]
push edx
push eax
mov dword [esp + 0x58], ecx
mov dword [esp + 0x14], esi
call sub.gdiplus.dll_GdipGetImageHeight
cmp eax, esi
je 0x405e4f
mov dword [ebx + 8], eax
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0xc]
lea edx, [esp + 0xc]
push edx
push eax
mov dword [esp + 0x5c], ecx
mov dword [esp + 0x64], esi
call sub.gdiplus.dll_GdipGetImagePixelFormat
cmp eax, esi
je 0x405e70
mov dword [ebx + 8], eax
mov eax, dword [esp + 0xc]
cmp eax, 0x30402
mov edi, 8
jg 0x405f09
je 0x405f00
cmp eax, 0x21808
jg 0x405edb
je 0x405ecf
sub eax, 0x21005
je 0x405f20
sub eax, 1
jne 0x405f90
mov word [esp + 0x5a], 0x10
mov dword [esp + 0x5c], 3
mov dword [esp + 0x74], 0xf800
mov dword [esp + 0x78], 0x7e0
mov dword [esp + 0x7c], 0x1f
jmp 0x405f5e
mov word [esp + 0x5a], 0x18
jmp 0x405f5e
cmp eax, 0x22009
je 0x405ef6
cmp eax, 0x30101
jne 0x405f90
mov word [esp + 0x5a], 1
jmp 0x405f5e
mov dword [esp + 0x14], 1
jmp 0x405f57
mov word [esp + 0x5a], 4
jmp 0x405f5e
cmp eax, 0xe200b
jg 0x405f50
je 0x405f57
cmp eax, 0x30803
je 0x405f49
cmp eax, 0x61007
jne 0x405f90
mov word [esp + 0x5a], 0x10
mov dword [esp + 0x5c], 3
mov dword [esp + 0x74], 0x7c00
mov dword [esp + 0x78], 0x3e0
mov dword [esp + 0x7c], 0x1f
jmp 0x405f5e
mov word [esp + 0x5a], di
jmp 0x405f5e
cmp eax, 0x26200a
jne 0x405f90
mov word [esp + 0x5a], 0x20
push 0x50
call sub.MFC80U.DLL_Ordinal_762
add esp, 4
cmp eax, esi
je 0x405f73
call fcn.00406f60
mov esi, eax
lea eax, [esp + 0x4c]
mov ecx, esi
call fcn.00404c30
test al, al
jne 0x405fa6
test esi, esi
je 0x405f90
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x78]
xor ecx, esp
call fcn.00452313
mov esp, ebp
pop ebp
ret 4
cmp word [esi + 0x1a], di
ja 0x40600e
mov edx, dword [ebx + 4]
lea ecx, [esp + 0xc]
push ecx
push edx
mov dword [esp + 0x14], 0
call sub.gdiplus.dll_GdipGetImagePaletteSize
test eax, eax
je 0x405fc9
mov dword [ebx + 8], eax
mov eax, dword [esp + 0xc]
push eax
call sub.MFC80U.DLL_Ordinal_265
mov ecx, dword [esp + 0x10]
mov edx, dword [ebx + 4]
add esp, 4
mov edi, eax
push ecx
push edi
push edx
mov dword [esp + 0x50], edi
call sub.gdiplus.dll_GdipGetImagePalette
test eax, eax
je 0x405ff2
mov dword [ebx + 8], eax
lea ebx, [edi + 8]
mov edi, dword [edi + 4]
call fcn.00404ec0
mov eax, dword [esp + 0x44]
push eax
call sub.MFC80U.DLL_Ordinal_266
mov ebx, dword [esp + 0x14]
add esp, 4
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
mov edx, dword [ebx + 4]
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x10]
push ecx
xor edi, edi
push edx
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x30], eax
call sub.gdiplus.dll_GdipGetImagePixelFormat
cmp eax, edi
je 0x40603b
mov dword [ebx + 8], eax
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x2c]
push eax
mov eax, dword [ebx + 4]
push ecx
push 1
lea edx, [esp + 0x28]
push edx
push eax
call sub.gdiplus.dll_GdipBitmapLockBits
cmp eax, edi
je 0x40605c
mov dword [ebx + 8], eax
movzx eax, word [esi + 0x1a]
imul eax, dword [esi + 0x10]
mov ecx, dword [esp + 0x3c]
add eax, 0x1f
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
add eax, eax
add eax, eax
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x10], eax
cmp ecx, eax
lea eax, [esp + 0x34]
jl 0x406090
lea eax, [esp + 0x10]
cmp dword [esi + 0x14], 0
mov edx, dword [eax]
mov dword [esp + 0x10], edx
jle 0x4060c8
jmp 0x4060a4
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x10]
imul ecx, edi
add ecx, dword [esp + 0xc]
push eax
push ecx
mov ecx, dword [esi + 0x38]
mov edx, dword [ecx + edi*4]
push edx
call sub.MSVCR80.dll_memcpy
add edi, 1
add esp, 0xc
cmp edi, dword [esi + 0x14]
jl 0x4060a0
mov ecx, dword [ebx + 4]
lea eax, [esp + 0x2c]
push eax
push ecx
call sub.gdiplus.dll_GdipBitmapUnlockBits
test eax, eax
je 0x4060dd
mov dword [ebx + 8], eax
cmp dword [esp + 0x14], 0
je 0x4060e9
call fcn.00406120
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x10]
push edx
add eax, 0x1c
mov dword [esp + 0x14], esi
call fcn.00403230
mov ecx, dword [esp + 0x84]
pop edi
pop esi
pop ebx
xor ecx, esp
mov al, 1
call fcn.00452313
mov esp, ebp
pop ebp
ret 4