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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.00405d80
mov edx, dword [esp + 0x78]
mov edi, eax
mov dword [esp + 0x38], eax
add eax, 1
mov dword [esp + 0x2c], eax
test edx, edx
je 0x4053c1
mov esi, eax
mov eax, dword [esp + 0x78]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [esp], eax
call ebx
sub esp, 4
add esi, eax
mov ebp, eax
mov dword [esp + 0x28], eax
mov dword [esp], 0x416ae8
call ebx
sub esp, 4
test edi, edi
mov dword [esp + 0x3c], eax
jle 0x404f98
test ebp, ebp
setne dl
add eax, esi
test dl, dl
cmovne esi, eax
lea eax, [esi + esi]
mov edx, dword [esp + 0x80]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x80]
add eax, 0x1c
test edx, edx
je 0x40540b
call fcn.00404ef0
mov ecx, dword [esp + 0x20]
test eax, eax
lea edx, [ecx + 0x1e]
lea ecx, [edx + eax + 6]
cmovne edx, ecx
mov eax, dword [esp + 0x84]
add edx, 3
and edx, 0xfffffffc
mov dword [esp + 0x24], edx
test eax, eax
jle 0x40505c
mov ebp, dword [esp + 0x88]
xor ebx, ebx
xor esi, esi
jmp 0x40500e
call fcn.00404ef0
add eax, edi
add eax, 5
add ebx, 1
add ebp, 0x18
and eax, 0xfffffffc
add esi, eax
cmp dword [esp + 0x84], ebx
je 0x405060
mov eax, dword [ebp]
mov edi, 0x1a
mov eax, dword [eax]
test eax, eax
je 0x405024
call fcn.00404ef0
lea edi, [eax + 0x18]
mov eax, dword [ebp + 8]
test eax, eax
jne 0x404ff0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov eax, dword [ebp + 0xc]
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.00405d80
lea eax, [edi + eax*2 + 2]
jmp 0x404ff7
xor esi, esi
nop
mov eax, dword [esp + 0x24]
lea eax, [eax + esi + 4]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov dword [esp + 0x34], eax
je 0x405465
add eax, 3
mov ebx, 0xffffffff
mov edx, 1
and eax, 0xfffffffc
xor edi, edi
xor ebp, ebp
mov word [eax + 2], bx
mov ecx, eax
mov word [eax], dx
mov dword [eax + 4], 0
mov dword [esp + 0x30], eax
lea esi, [eax + 0x1e]
mov eax, dword [esp + 0x64]
xor ebx, ebx
mov word [ecx + 0x1a], di
mov word [ecx + 0x1c], bp
mov dword [ecx + 8], eax
mov eax, dword [esp + 0x60]
mov dword [ecx + 0xc], eax
movzx eax, word [esp + 0x84]
mov word [ecx + 0x10], ax
mov eax, dword [esp + 0x68]
mov word [ecx + 0x12], ax
mov eax, dword [esp + 0x6c]
mov word [ecx + 0x14], ax
mov eax, dword [esp + 0x70]
mov word [ecx + 0x16], ax
mov eax, dword [esp + 0x74]
mov word [ecx + 0x18], ax
mov eax, dword [esp + 0x28]
test eax, eax
jne 0x405420
mov eax, dword [esp + 0x2c]
add ebx, esi
mov dword [esp + 0x10], 0
mov dword [esp + 8], ebx
mov dword [esp], 0
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x7c]
mov dword [esp + 4], eax
call fcn.00405d80
test eax, eax
je 0x4053a0
mov ebx, dword [esp + 0x80]
test ebx, ebx
je 0x4053b4
mov dword [esp], 0
call dword [sym.imp.USER32.dll_GetDC]
sub esp, 4
mov edi, eax
mov dword [esp + 4], 0x5a
mov dword [esp], eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
sub esp, 8
mov dword [esp + 8], eax
mov eax, dword [esp + 0x80]
mov dword [esp + 4], 0x48
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_MulDiv]
sub esp, 0xc
mov ebx, eax
mov dword [esp + 4], edi
mov dword [esp], 0
neg ebx
call dword [sym.imp.USER32.dll_ReleaseDC]
sub esp, 8
mov eax, dword [esp + 0x30]
add esi, dword [esp + 0x20]
or dword [eax + 0xc], 0x40
mov eax, dword [esp + 0x80]
mov word [esi], bx
add esi, 6
mov eax, dword [eax + 0x10]
mov word [esi - 4], ax
mov eax, dword [esp + 0x80]
movzx eax, byte [eax + 0x14]
mov byte [esi - 2], al
mov eax, dword [esp + 0x80]
movzx eax, byte [eax + 0x17]
mov byte [esi - 1], al
mov eax, dword [esp + 0x80]
mov dword [esp], esi
lea edi, [eax + 0x1c]
mov dword [esp + 4], edi
call fcn.00405e80
mov ecx, dword [esp + 0x84]
mov ebp, dword [esp + 0x88]
mov dword [esp + 0x20], 0
test ecx, ecx
jg 0x4052dc
jmp 0x405390
call fcn.00404ef0
mov edi, eax
lea eax, [eax + 0x1d]
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 8]
test eax, eax
je 0x405309
call fcn.00404ef0
mov esi, eax
lea ecx, [ebx + 0x18]
mov dword [ebx], 0
add edi, ecx
lea eax, [edi + esi]
mov dword [esp + 0x28], eax
mov eax, dword [ebp]
mov edx, dword [eax + 8]
mov dword [ebx + 4], edx
mov edx, dword [eax + 4]
mov eax, dword [eax]
or edx, 0x50000000
mov dword [ebx + 8], edx
xor edx, edx
mov word [ebx + 0xc], dx
xor edx, edx
mov word [ebx + 0xe], dx
xor edx, edx
mov word [ebx + 0x10], dx
xor edx, edx
test eax, eax
mov word [ebx + 0x12], dx
movzx edx, word [ebp + 4]
mov dword [ebx + 0x14], edx
je 0x405340
mov dword [esp + 4], eax
mov dword [esp], ecx
call fcn.00405e80
mov eax, dword [ebp + 8]
test eax, eax
je 0x405351
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.00405e80
mov eax, dword [esp + 0x28]
xor ebx, ebx
add esi, dword [esp + 0x2c]
mov word [eax], bx
mov eax, dword [ebp]
and esi, 0xfffffffc
add dword [esp + 0x24], esi
mov eax, dword [eax + 0x1c]
test eax, eax
je 0x4052c3
call eax
add dword [esp + 0x20], 1
add ebp, 0x18
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x84], eax
je 0x405390
mov eax, dword [ebp]
mov ebx, dword [esp + 0x30]
add ebx, dword [esp + 0x24]
mov eax, dword [eax]
test eax, eax
jne 0x405210
mov eax, dword [ebp + 8]
mov dword [esp + 0x2c], 0x1f
mov edi, 2
test eax, eax
jne 0x405229
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov eax, dword [ebp + 0xc]
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.00405d80
lea esi, [eax + eax + 2]
jmp 0x405230
xor eax, eax
mov word [ebx + 0x18], ax
mov eax, dword [ebp + 8]
test eax, eax
jne 0x405297
mov eax, esi
mov dword [esp + 0x10], 0
mov dword [esp + 8], edi
shr eax, 1
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.00405d80
test eax, eax
jne 0x4052a3
xor eax, eax
mov word [edi], ax
jmp 0x4052a3
mov eax, dword [esp + 0x34]
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
xor edi, edi
mov word [ebx], di
mov ebx, dword [esp + 0x80]
test ebx, ebx
jne 0x405138
mov eax, dword [esp + 0x30]
and dword [eax + 0xc], 0xffffffbf
jmp 0x4051e9
mov dword [esp], 0x416ae8
call dword [sym.imp.KERNEL32.dll_lstrlenW]
sub esp, 4
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x80]
mov dword [esp + 0x28], 0
add eax, eax
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x80]
add eax, 0x1c
test ecx, ecx
jne 0x404fb8
mov eax, dword [esp + 0x80]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x20]
lea edx, [eax + 0x1e]
jmp 0x404fcd
mov eax, dword [esp + 0x78]
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.00405e80
mov ebp, dword [esp + 0x38]
test ebp, ebp
jg 0x405443
mov ebx, dword [esp + 0x28]
add ebx, ebx
jmp 0x4050f7
mov ebx, dword [esp + 0x28]
mov dword [esp + 4], 0x416ae8
lea eax, [esi + ebx*2]
mov dword [esp], eax
call fcn.00405e80
add ebx, dword [esp + 0x3c]
add ebx, ebx
jmp 0x4050f7
xor eax, eax
jmp 0x405394