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

Disassembly:
sub esp, 0x98
push ebx
push ebp
push esi
push edi
push dword [esp + 0xac]
mov ebx, ecx
call fcn.100406ca
pop ecx
test eax, eax
js 0x1004075e
mov eax, dword [ebx]
xor esi, esi
test eax, eax
jne 0x10040776
push 0x26
call fcn.1004e8da
mov dword [esp + 0x4c], eax
pop ecx
test eax, eax
je 0x10040770
inc dword [0x101b44cc]
xor ecx, ecx
and dword [eax + 0x10], ecx
and dword [eax + 0x14], ecx
mov word [eax + 0x24], cx
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], 0x10
mov dword [eax + 0x20], ecx
mov dword [ebx], eax
test eax, eax
jne 0x10040774
mov eax, 0x80004005
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x98
ret 4
and dword [ebx], esi
jmp 0x1004075e
xor esi, esi
push dword [esp + 0xac]
mov ecx, eax
call fcn.10040d25
test eax, eax
js 0x1004075e
cmp byte [ebx + 0x2d], 0
je 0x10040796
mov byte [ebx + 0x2c], 1
xor eax, eax
jmp 0x10040763
push esi
lea edi, [ebx + 0x2e]
xor ebp, ebp
push edi
mov edx, 0x400
inc ebp
push ebp
push 0x1a
push esi
mov dword [ebx + 0x3e], edx
mov dword [ebx + 0x3a], edx
mov eax, dword [0x101b44bc]
push ebp
push edx
push edx
mov ecx, dword [eax]
push eax
call dword [ecx + 0x5c]
test eax, eax
js 0x1004075e
mov ecx, dword [0x101b44bc]
lea eax, [ebx + 0x32]
push esi
push eax
imul eax, dword [ebx + 0x36], 0x54
mov edx, dword [ecx]
push ebp
push esi
push 8
push eax
push ecx
call dword [edx + 0x68]
test eax, eax
jns 0x100407f4
mov ecx, dword [edi]
test ecx, ecx
je 0x1004075e
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [edi], esi
jmp 0x1004075e
mov eax, dword [ebx + 0x3a]
xorps xmm0, xmm0
mov dword [esp + 0x80], eax
mov eax, dword [ebx + 0x3e]
neg eax
movlpd qword [esp + 0x90], xmm0
push 0x20
mov dword [esp + 0x88], eax
pop eax
push esi
movlpd qword [esp + 0x9c], xmm0
mov dword [esp + 0xa4], esi
mov dword [esp + 0x80], 0x28
mov word [esp + 0x8c], bp
mov dword [esp + 0x90], esi
mov dword [esp + 0x44], eax
mov word [esp + 0x8e], ax
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
push esi
mov ebp, eax
lea eax, [esp + 0x64]
push esi
push eax
push esi
lea eax, [esp + 0x8c]
mov dword [esp + 0x58], ebp
push eax
push ebp
call dword [sym.imp.GDI32.dll_CreateDIBSection]
push 1
push ebp
mov dword [esp + 0x2c], eax
call dword [sym.imp.GDI32.dll_SetMapMode]
push 0x5a
push ebp
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
imul eax, dword [ebx + 0x24]
lea esi, [ebx + 4]
push 0xffffffffffffffb8
pop ecx
push esi
push 2
cdq
idiv ecx
push 2
mov ecx, eax
mov edx, 0x2bc
xor eax, eax
push eax
push 4
push 1
push eax
push eax
mov eax, dword [ebx + 0x28]
and eax, 2
test byte [ebx + 0x28], 1
push eax
mov eax, 0x190
cmovne eax, edx
push eax
xor eax, eax
push eax
push eax
push eax
push ecx
call dword [sym.imp.GDI32.dll_CreateFontA]
mov dword [esp + 0x44], eax
test eax, eax
jne 0x1004090f
push esi
push str.CreateFont____s_FAIL_
call fcn.1004cd68
mov esi, dword [sym.imp.GDI32.dll_DeleteObject]
pop ecx
pop ecx
push dword [esp + 0x24]
call esi
push ebp
call dword [sym.imp.GDI32.dll_DeleteDC]
push 0
call esi
mov ecx, dword [edi]
test ecx, ecx
je 0x1004075e
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
and dword [edi], 0
jmp 0x1004075e
push dword [esp + 0x24]
mov esi, dword [sym.imp.GDI32.dll_SelectObject]
push ebp
call esi
push dword [esp + 0x44]
push ebp
call esi
mov eax, dword [ebx + 0x3a]
xor edi, edi
dec eax
mov dword [esp + 0x6c], edi
push 0xff00
mov dword [esp + 0x74], edi
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], eax
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
mov esi, eax
lea eax, [esp + 0x6c]
push esi
push eax
push ebp
call dword [sym.imp.USER32.dll_FillRect]
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
push 1
push ebp
call dword [sym.imp.GDI32.dll_SetBkMode]
push edi
push ebp
call dword [sym.imp.GDI32.dll_SetTextAlign]
lea eax, [esp + 0x14]
mov byte [esp + 0x13], 0x20
push eax
push 1
lea eax, [esp + 0x1b]
push eax
push ebp
call dword [sym.imp.GDI32.dll_GetTextExtentPoint32A]
mov ecx, dword [esp + 0x14]
lea eax, [ecx + 3]
cdq
and edx, 3
add eax, edx
sar eax, 2
test byte [ebx + 0x28], 4
mov dword [ebx + 0x42], eax
mov eax, dword [esp + 0x18]
movd xmm0, eax
cvtdq2ps xmm0, xmm0
movss dword [ebx + 0xe46], xmm0
je 0x100409bd
add ecx, 2
add eax, 2
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], eax
lea eax, [ecx + 3]
cdq
and edx, 3
push 0x20
lea esi, [edx + eax]
lea eax, [ebx + 0x4e]
sar esi, 2
mov dword [esp + 0x24], eax
pop eax
mov byte [esp + 0x13], al
lea eax, [esp + 0x14]
push eax
push 1
lea eax, [esp + 0x1b]
push eax
push ebp
call dword [sym.imp.GDI32.dll_GetTextExtentPoint32A]
mov eax, dword [ebx + 0x28]
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], eax
test al, 4
je 0x10040a0c
add edx, 3
add ecx, 3
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ecx
mov eax, dword [ebx + 0x42]
add eax, esi
add eax, edx
cmp eax, dword [ebx + 0x3a]
jle 0x10040a49
mov esi, dword [ebx + 0x42]
lea eax, [ecx + 1]
lea eax, [edi + eax*2]
cmp eax, dword [ebx + 0x3e]
jge 0x10040a2f
mov eax, dword [esp + 0x1c]
inc edi
add edi, ecx
jmp 0x10040a45
push str.BUG:_Font_does_not_fit_in_texture.
call fcn.1004cd68
mov eax, dword [ebx + 0x28]
mov edx, dword [esp + 0x18]
pop ecx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], eax
test byte [esp + 0x1c], 4
lea eax, [esi + edx]
mov dword [esp + 0x30], eax
lea eax, [edi + ecx]
mov dword [esp + 0x58], esi
mov dword [esp + 0x5c], edi
mov dword [esp + 0x3c], esi
mov dword [esp + 0x38], edi
mov dword [esp + 0x50], esi
mov dword [esp + 0x4c], edi
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x34], eax
je 0x10040b9d
push 0
push ebp
call dword [sym.imp.GDI32.dll_SetTextColor]
push 0
push 1
lea eax, [esp + 0x1b]
inc esi
push eax
lea eax, [esp + 0x34]
mov dword [esp + 0x60], esi
push eax
push 4
push dword [esp + 0x60]
inc edi
push dword [esp + 0x68]
mov dword [esp + 0x38], edi
mov edi, dword [sym.imp.GDI32.dll_ExtTextOutA]
push ebp
call edi
push 0
push 1
lea eax, [esp + 0x1b]
push eax
lea eax, [esp + 0x34]
push eax
push 4
push dword [esp + 0x4c]
push esi
push ebp
call edi
push 0
push 1
lea eax, [esp + 0x1b]
push eax
lea eax, [esp + 0x34]
push eax
push 4
push dword [esp + 0x4c]
lea edi, [esi + 1]
push edi
push ebp
call dword [sym.imp.GDI32.dll_ExtTextOutA]
mov esi, dword [esp + 0x1c]
lea eax, [esp + 0x13]
push 0
push 1
push eax
lea eax, [esp + 0x34]
push eax
push 4
push esi
push edi
push ebp
call dword [sym.imp.GDI32.dll_ExtTextOutA]
push 0
push 1
lea eax, [esp + 0x1b]
inc esi
push eax
lea eax, [esp + 0x34]
push eax
push 4
push esi
push edi
push ebp
call dword [sym.imp.GDI32.dll_ExtTextOutA]
mov edi, dword [esp + 0x54]
lea eax, [esp + 0x13]
push 0
push 1
push eax
lea eax, [esp + 0x34]
push eax
push 4
push esi
push edi
push ebp
call dword [sym.imp.GDI32.dll_ExtTextOutA]
push 0
push 1
lea eax, [esp + 0x1b]
push eax
lea eax, [esp + 0x34]
push eax
push 4
push esi
push dword [esp + 0x54]
push ebp
call dword [sym.imp.GDI32.dll_ExtTextOutA]
mov esi, dword [esp + 0x1c]
lea eax, [esp + 0x13]
push 0
push 1
push eax
lea eax, [esp + 0x34]
push eax
push 4
push esi
push dword [esp + 0x54]
push ebp
call dword [sym.imp.GDI32.dll_ExtTextOutA]
push 0xff
push ebp
call dword [sym.imp.GDI32.dll_SetTextColor]
push 0
push 1
lea eax, [esp + 0x1b]
push eax
lea eax, [esp + 0x34]
push eax
push 4
push esi
push edi
jmp 0x10040bbb
push 0xff
push ebp
call dword [sym.imp.GDI32.dll_SetTextColor]
push 0
push 1
lea eax, [esp + 0x1b]
push eax
lea eax, [esp + 0x34]
push eax
push 4
push edi
push esi
push ebp
call dword [sym.imp.GDI32.dll_ExtTextOutA]
mov ecx, dword [esp + 0x58]
mov eax, ecx
sub eax, dword [ebx + 0x42]
movd xmm0, dword [ebx + 0x3a]
cvtdq2ps xmm0, xmm0
mov edi, dword [esp + 0x20]
mov edx, dword [esp + 0x5c]
movd xmm1, eax
cvtdq2ps xmm1, xmm1
divss xmm1, xmm0
movss dword [edi - 8], xmm1
mov eax, dword [ebx + 0x42]
movd xmm0, dword [ebx + 0x3a]
add eax, ecx
add eax, dword [esp + 0x14]
cvtdq2ps xmm0, xmm0
movd xmm1, eax
cvtdq2ps xmm1, xmm1
mov eax, dword [esp + 0x18]
add eax, edx
divss xmm1, xmm0
movss dword [edi], xmm1
movd xmm0, dword [ebx + 0x3e]
movd xmm1, edx
cvtdq2ps xmm1, xmm1
cvtdq2ps xmm0, xmm0
divss xmm1, xmm0
movss dword [edi - 4], xmm1
movd xmm0, dword [ebx + 0x3e]
movd xmm1, eax
cvtdq2ps xmm1, xmm1
cvtdq2ps xmm0, xmm0
divss xmm1, xmm0
movss dword [edi + 4], xmm1
add edi, 0x10
mov eax, dword [ebx + 0x42]
mov dword [esp + 0x20], edi
mov edi, edx
lea esi, [ecx + eax*2]
mov eax, dword [esp + 0x40]
add esi, dword [esp + 0x14]
inc eax
mov dword [esp + 0x40], eax
cmp eax, 0x100
jl 0x100409d4
mov eax, dword [ebx + 0x2e]
lea edx, [esp + 0x64]
push 0
push 0
push edx
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x4c]
mov eax, dword [esp + 0x68]
xor esi, esi
mov dword [esp + 0x20], eax
cmp dword [ebx + 0x3e], esi
jle 0x10040cf3
xor edi, edi
mov ebp, eax
cmp dword [ebx + 0x3a], edi
jle 0x10040ce1
mov ecx, dword [ebx + 0x3a]
mov eax, dword [esp + 0x60]
imul ecx, esi
add ecx, edi
mov ecx, dword [eax + ecx*4]
mov eax, ecx
shr eax, 0x10
shr al, 4
movzx edx, al
mov al, 0xf
shr ecx, 8
shr cl, 4
sub al, cl
movzx eax, al
shl ax, 4
or ax, dx
shl ax, 4
or ax, dx
shl ax, 4
or ax, dx
inc edi
mov word [ebp], ax
lea ebp, [ebp + 2]
cmp edi, dword [ebx + 0x3a]
jl 0x10040c94
mov eax, dword [esp + 0x20]
add eax, dword [esp + 0x64]
inc esi
mov dword [esp + 0x20], eax
cmp esi, dword [ebx + 0x3e]
jl 0x10040c8b
mov ebp, dword [esp + 0x48]
mov eax, dword [ebx + 0x2e]
push 0
push eax
mov ecx, dword [eax]
call dword [ecx + 0x50]
push dword [esp + 0x24]
mov esi, dword [sym.imp.GDI32.dll_DeleteObject]
call esi
push ebp
call dword [sym.imp.GDI32.dll_DeleteDC]
push dword [esp + 0x44]
call esi
xor eax, eax
inc eax
mov byte [ebx + 0x2c], al
mov byte [ebx + 0x2d], al
jmp 0x10040792