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

Disassembly:
push 0xffffffffffffffff
push 0x42e570
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x74
mov dword [esp], ecx
push ebx
push esi
lea ecx, [esp + 0x5c]
call fcn.00426a7f
lea ecx, [esp + 0x6c]
mov dword [esp + 0x84], 0
call fcn.00426a7f
mov eax, dword [esp + 0x8c]
push 0
push 0x8000
lea ecx, [esp + 0x64]
mov eax, dword [eax]
mov byte [esp + 0x8c], 1
push eax
call fcn.00426b91
test eax, eax
je 0x408dcd
lea ecx, [esp + 0x4c]
push 0xe
push ecx
lea ecx, [esp + 0x64]
call fcn.00426cae
mov edx, dword [esp + 0x56]
lea ebx, [edx - 0xe]
push ebx
call fcn.00425303
mov esi, eax
add esp, 4
test esi, esi
mov dword [esp + 0x10], esi
je 0x408dc4
push ebx
push esi
lea ecx, [esp + 0x64]
call fcn.00426cae
mov eax, dword [esi + 0x10]
test eax, eax
jne 0x408dbb
mov eax, dword [esp + 0x90]
push 0
push 0x9001
lea ecx, [esp + 0x74]
mov eax, dword [eax]
push eax
call fcn.00426b91
test eax, eax
jne 0x408df9
push esi
call fcn.0042532c
add esp, 4
lea ecx, [esp + 0x5c]
call fcn.00426dac
lea ecx, [esp + 0x6c]
mov byte [esp + 0x84], 0
call fcn.00426ad4
lea ecx, [esp + 0x5c]
mov dword [esp + 0x84], 0xffffffff
call fcn.00426ad4
xor al, al
jmp 0x4092ec
add ebx, 0xffffffd8
push ebp
shr ebx, 2
push edi
mov dword [esp + 0x30], ebx
lea ecx, [ebx*4 + 0x28]
push ecx
call fcn.00425303
mov ebp, eax
mov eax, dword [esp + 0x1c]
mov ecx, 0xa
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov dword [ebp + 0x24], 0
mov dx, word [eax + 0xe]
mov word [ebp + 0xe], dx
mov ecx, dword [eax + 4]
xor edx, edx
mov dword [ebp + 4], ecx
mov dx, word [ebp + 0xe]
mov eax, dword [eax + 8]
imul edx, ecx
add edx, 0x1f
lea ebx, [ebx*4 + 8]
sar edx, 3
and edx, 0xfffffffc
push ebx
imul edx, eax
mov dword [ebp + 8], eax
mov dword [ebp + 0x14], edx
call fcn.00425303
add esp, 8
mov ebx, eax
mov dword [esp + 0x40], 0
mov dword [esp + 0x3c], 0x4307d8
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x18]
lea edi, [ebp + 0x28]
mov word [ebx], 0x300
lea ecx, [eax*4]
lea esi, [edx + 0x28]
mov dword [esp + 0x34], ecx
mov edx, ecx
shr ecx, 2
mov word [ebx + 2], ax
mov byte [esp + 0x8c], 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor edi, edi
mov esi, 0xf
cmp eax, edi
mov dword [esp + 0x94], edi
jbe 0x408fe5
lea eax, [ebp + 0x28]
lea ecx, [ebp + 0x29]
mov dword [esp + 0x98], eax
lea eax, [ebx + 5]
mov dword [esp + 0x2c], eax
mov eax, 0xffffffd7
sub eax, ebp
mov dword [esp + 0x24], 0x3c
mov dword [esp + 0x1c], edi
mov dword [esp + 0x14], ecx
mov dword [esp + 0x20], eax
mov edx, dword [esp + 0x98]
mov ecx, dword [esp + 0x10]
mov eax, dword [edx]
push eax
call fcn.004095b0
mov ecx, dword [esp + 0x1c]
fstp dword [esp + 0x38]
mov edx, dword [ecx + ebp + 0x28]
mov ecx, dword [esp + 0x10]
push edx
call fcn.004095b0
fcomp dword [esp + 0x38]
fnstsw ax
test ah, 0x41
jne 0x408f3c
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x94]
add eax, ecx
mov dword [esp + 0x1c], eax
mov edx, dword [esp + 0x98]
mov ecx, dword [esp + 0x10]
mov eax, dword [edx]
push eax
call fcn.004095b0
mov ecx, dword [esp + 0x24]
fstp dword [esp + 0x38]
mov edx, dword [ecx + ebp + 0x28]
mov ecx, dword [esp + 0x10]
push edx
call fcn.004095b0
fcomp dword [esp + 0x38]
fnstsw ax
test ah, 1
je 0x408f87
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x94]
add eax, ecx
mov dword [esp + 0x24], eax
jmp 0x408f8b
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x2c]
mov dl, byte [ecx + 1]
add ecx, 4
mov byte [eax - 1], dl
mov dl, byte [ecx - 4]
mov byte [eax], dl
mov dl, byte [ecx - 5]
mov byte [eax + 1], dl
mov edx, dword [esp + 0x94]
mov byte [eax + 2], 0
inc edx
add eax, 4
mov dword [esp + 0x94], edx
mov edx, dword [esp + 0x98]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x94]
add edx, 4
cmp eax, ecx
mov dword [esp + 0x98], edx
jb 0x408ef3
mov edx, dword [ebp + 0x28]
mov ecx, dword [ebp + edi*4 + 0x28]
lea eax, [ebp + 0x28]
mov dword [esp + 0x94], ecx
push ebx
mov dword [eax + edi*4], edx
mov dl, byte [ebp + 0x2a]
mov byte [ebx + edi*4 + 4], dl
mov dl, byte [ebp + 0x29]
mov byte [ebx + edi*4 + 5], dl
mov dl, byte [eax]
mov byte [ebx + edi*4 + 6], dl
mov dl, byte [esp + 0x9a]
mov byte [ebx + edi*4 + 7], 0
mov dword [eax], ecx
mov byte [ebx + 4], dl
mov byte [ebx + 5], ch
mov byte [ebx + 6], cl
mov byte [ebx + 7], 0
mov edx, dword [eax + 0x3c]
mov ecx, dword [eax + esi*4]
mov dword [eax + esi*4], edx
mov dl, byte [ebp + 0x66]
mov byte [ebx + esi*4 + 4], dl
mov dl, byte [ebp + 0x65]
mov byte [ebx + esi*4 + 5], dl
mov dl, byte [ebp + 0x64]
mov byte [ebx + esi*4 + 6], dl
mov byte [ebx + esi*4 + 7], 0
mov dword [esp + 0x98], ecx
mov dword [eax + 0x3c], ecx
mov al, byte [esp + 0x9a]
mov byte [ebx + 0x41], ch
mov byte [ebx + 0x40], al
mov byte [ebx + 0x42], cl
mov byte [ebx + 0x43], 0
call dword [sym.imp.GDI32.dll_CreatePalette]
push eax
lea ecx, [esp + 0x40]
call fcn.00428968
push ebx
call fcn.0042532c
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x5c]
mov eax, dword [esp + 0x60]
mov esi, dword [esp + 0x38]
mov dword [esp + 0x48], ecx
mov cx, word [esp + 0x64]
mov dword [esp + 0x4c], edx
mov dword [esp + 0x50], eax
mov word [esp + 0x54], cx
mov edx, dword [ebp]
add esp, 4
lea eax, [esi + edx + 0xe]
lea edx, [esp + 0x44]
mov dword [esp + 0x4e], eax
mov ecx, dword [ebp + 0x14]
add ecx, eax
push 0xe
mov dword [esp + 0x4a], ecx
push edx
lea ecx, [esp + 0x7c]
call fcn.00426ce8
mov ecx, dword [ebp]
add esi, ecx
lea ecx, [esp + 0x74]
push esi
push ebp
call fcn.00426ce8
mov ebx, dword [esp + 0x18]
xor eax, eax
mov ax, word [ebx + 0xe]
imul eax, dword [ebx + 4]
cdq
and edx, 7
add eax, edx
mov edi, eax
sar edi, 3
mov eax, edi
mov dword [esp + 0x30], edi
and eax, 3
jbe 0x40910e
mov ecx, 4
sub ecx, eax
add edi, ecx
mov dword [esp + 0x30], edi
lea esi, [edi + edi*4]
lea esi, [esi + esi*4]
shl esi, 2
push esi
call fcn.00425303
push esi
mov dword [esp + 0x1c], eax
call fcn.00425303
mov dword [esp + 0xa0], eax
mov eax, dword [ebx + 8]
add esp, 8
mov dword [esp + 0x18], 0
test eax, eax
jbe 0x40924e
jmp 0x40914a
mov edi, dword [esp + 0x30]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x94], 0x64
sub eax, edx
cmp eax, 0x64
ja 0x409167
mov dword [esp + 0x94], eax
mov esi, dword [esp + 0x94]
mov edx, dword [esp + 0x14]
imul esi, edi
push esi
push edx
lea ecx, [esp + 0x6c]
mov dword [esp + 0x40], esi
call fcn.00426cae
mov edi, dword [esp + 0x98]
mov ecx, esi
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x94]
xor edi, edi
test eax, eax
jbe 0x409226
mov eax, dword [ebx + 4]
xor esi, esi
test eax, eax
jbe 0x409216
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x2c]
push eax
push esi
push edi
push ebx
push ecx
mov ecx, dword [esp + 0x24]
call fcn.00409310
mov eax, dword [eax]
xor edx, edx
mov dword [esp + 0x24], eax
mov ecx, dword [esp + 0x26]
mov dh, al
mov eax, dword [esp + 0x25]
and eax, 0xff
and ecx, 0xff
or edx, eax
shl edx, 8
or edx, ecx
push edx
mov edx, dword [esp + 0x44]
push edx
call dword [sym.imp.GDI32.dll_GetNearestPaletteIndex]
mov ecx, dword [esp + 0x10]
push eax
mov eax, dword [esp + 0x9c]
push eax
push esi
push edi
push ebp
call fcn.00409500
mov eax, dword [ebx + 4]
inc esi
cmp esi, eax
jb 0x4091b3
mov eax, dword [esp + 0x94]
inc edi
cmp edi, eax
jb 0x4091aa
mov esi, dword [esp + 0x38]
mov ecx, dword [esp + 0x98]
push esi
push ecx
lea ecx, [esp + 0x7c]
call fcn.00426ce8
mov ecx, dword [esp + 0x18]
mov eax, dword [ebx + 8]
add ecx, 0x64
cmp ecx, eax
mov dword [esp + 0x18], ecx
jb 0x409146
mov edx, dword [ebp]
push 0
add edx, 0xe
lea ecx, [esp + 0x78]
push edx
call fcn.00426d33
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x74]
push eax
lea eax, [ebp + 0x28]
push eax
call fcn.00426ce8
mov ecx, dword [esp + 0x98]
push ecx
call fcn.0042532c
mov edx, dword [esp + 0x18]
push edx
call fcn.0042532c
push ebx
call fcn.0042532c
push ebp
call fcn.0042532c
add esp, 0x10
lea ecx, [esp + 0x74]
call fcn.00426dac
lea ecx, [esp + 0x64]
call fcn.00426dac
mov dword [esp + 0x3c], vtable.CGdiObject.0
lea ecx, [esp + 0x3c]
mov byte [esp + 0x8c], 3
call fcn.004289bf
lea ecx, [esp + 0x74]
mov byte [esp + 0x8c], 0
call fcn.00426ad4
lea ecx, [esp + 0x64]
mov dword [esp + 0x8c], 0xffffffff
call fcn.00426ad4
pop edi
mov al, 1
pop ebp
mov ecx, dword [esp + 0x7c]
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x80
ret 8