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

Disassembly:
sub esp, 0x8a0
push ebx
push ebp
mov ebp, dword [esp + 0x8ac]
test ebp, ebp
mov ebx, edx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x34], ecx
jne 0x50056a
pop ebp
xor eax, eax
pop ebx
add esp, 0x8a0
ret 8
cmp ebp, dword [ebx + 0x6cc]
je 0x500587
mov eax, dword [ebp + 0x44]
mov ecx, dword [eax + 8]
cmp ecx, dword [ebp + 8]
jne 0x500587
mov ebp, eax
cmp ebp, dword [ebx + 0x6cc]
jne 0x500572
mov ecx, dword [ebx + 0x6e4]
xor edx, edx
cmp ebp, ecx
mov ecx, dword [ebp]
sete dl
mov dword [esp + 0x20], ebp
mov dword [esp + 0x4c], edx
lea edx, [esp + 0x4c0]
sub edx, ecx
mov al, byte [ecx]
mov byte [edx + ecx], al
inc ecx
test al, al
jne 0x5005a8
mov ecx, dword [ebp + 0x40]
test ecx, ecx
lea eax, [ebp + 0x40]
push esi
push edi
mov dword [esp + 0x30], eax
je 0x500673
jmp 0x5005d0
mov eax, dword [ebp + 8]
cmp eax, dword [ecx + 8]
jne 0x500673
mov ebp, ecx
mov eax, dword [ebp + 0x10]
test eax, eax
mov edx, dword [ebp]
jle 0x500608
cmp byte [edx], 0x20
jne 0x5005fe
lea ecx, [ecx]
test eax, eax
jle 0x5005fe
mov cl, byte [edx + 1]
inc edx
dec eax
cmp cl, 0x20
je 0x5005f0
cmp byte [edx], 0
jne 0x500608
mov edx, 0x5842b8
lea ecx, [esp + 0x4c8]
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x500612
sub ecx, esi
mov esi, ecx
mov ecx, edx
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x500622
sub ecx, edi
add ecx, esi
cmp ecx, 0x3b5
ja 0x500673
mov ecx, edx
mov al, byte [ecx]
inc ecx
test al, al
jne 0x500637
sub ecx, edx
lea edi, [esp + 0x4c8]
mov eax, ecx
dec edi
lea ebx, [ebx]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x500650
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0x40]
test ecx, ecx
jne 0x5005d0
lea eax, [esp + 0x4c8]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x500680
sub eax, edx
mov esi, eax
test esi, esi
jg 0x5006b1
mov ecx, dword [esp + 0x8b8]
pop edi
mov dword [ebp + 0x14], ecx
mov edx, dword [ebx + 0x9e8]
pop esi
mov dword [ebp + 0x18], edx
mov eax, ebp
pop ebp
pop ebx
add esp, 0x8a0
ret 8
mov edi, dword [esp + 0x30]
mov edx, dword [edi]
test edx, edx
mov ebp, dword [esp + 0x28]
je 0x5006ec
nop
mov eax, dword [ebp + 8]
cmp eax, dword [edx + 8]
jne 0x5006ec
mov ecx, dword [ebx + 0x6cc]
call fcn.004c7fe0
mov ecx, dword [ebx + 0x6f8]
dec ecx
mov dword [ebx + 0x6cc], eax
mov dword [ebx + 0x6f8], ecx
mov edx, dword [edi]
test edx, edx
jne 0x5006c0
mov ecx, dword [ebx + 0x6f8]
mov eax, dword [0x59bcec]
mov edx, dword [0x5ae228]
mov dword [esp + 0x58], ecx
mov ecx, dword [0x5ae230]
mov dword [esp + 0x6c], eax
mov eax, dword [ebp + 8]
mov dword [0x5ae228], eax
mov dword [esp + 0x70], edx
mov edx, dword [0x5ae254]
mov dword [esp + 0x64], ecx
mov ecx, dword [ebx + 0x6cc]
mov dword [ebx + 0x6cc], 0
mov dword [esp + 0x5c], edx
mov edx, dword [ebp + 0xc]
mov dword [0x59bcec], edx
mov edx, dword [ebp + 0x10]
test edx, edx
mov dword [0x5ae230], edx
mov eax, dword [ebp + 0x20]
mov dword [esp + 0x68], ecx
mov ecx, dword [ebp + 4]
mov dword [esp + 0x44], eax
mov dword [0x5ae254], ecx
mov byte [esp + 0x88], 0
jle 0x50079b
cmp edx, 0x19
jle 0x500777
mov edx, 0x19
mov dword [0x5ae230], edx
mov ecx, edx
mov ebp, ecx
shr ecx, 2
mov eax, 0x20202020
lea edi, [esp + 0x88]
rep stosd dword es:[edi], eax
mov ecx, ebp
and ecx, 3
rep stosb byte es:[edi], al
mov byte [esp + edx + 0x88], 0
mov edx, dword [ebx + 0x974]
mov edi, dword [esp + 0x3c]
xor eax, eax
push edx
push edi
mov dword [esp + 0x34], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x24], eax
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x20], eax
mov eax, dword [0x5b121c]
xor ebp, ebp
cmp eax, ebp
mov dword [esp + 0x30], 0xffffffff
je 0x5007e7
mov edx, dword [ebx + 0x9e4]
mov ecx, edi
call fcn.0048d6d0
mov dword [esp + 0x30], eax
cmp dword [0x59bcec], ebp
jg 0x50080b
lea eax, [esp + 0xa8]
push eax
push edi
call dword [sym.imp.GDI32.dll_GetTextMetricsA]
mov ecx, dword [esp + 0xc8]
mov dword [esp + 0x38], ecx
jmp 0x50080f
mov dword [esp + 0x38], ebp
lea esi, [esp + esi + 0x4c8]
lea eax, [esp + 0x4c8]
cmp eax, esi
lea edx, [esp + 0x4c8]
mov dword [esp + 0x24], ebp
mov dword [esp + 0x14], edx
mov dword [esp + 0x40], esi
jae 0x500cc9
mov eax, dword [esp + 0x24]
test eax, eax
je 0x50089b
mov eax, dword [0x5ae230]
test eax, eax
je 0x50089b
xor eax, eax
jmp 0x500850
mov cl, byte [esp + eax + 0x88]
mov byte [esp + eax + 0xe0], cl
inc eax
test cl, cl
jne 0x500850
mov eax, dword [esp + 0x14]
mov edx, eax
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x500870
lea edi, [esp + 0xe0]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x500881
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x5008b2
mov eax, dword [esp + 0x14]
lea edx, [esp + 0xe0]
sub edx, eax
mov cl, byte [eax]
mov byte [eax + edx], cl
inc eax
test cl, cl
jne 0x5008a8
lea eax, [esp + 0xe0]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x5008c0
mov edi, dword [0x59bcec]
sub eax, edx
dec eax
test edi, edi
mov dword [esp + 0x4c], eax
jg 0x500b67
xor edi, edi
test eax, eax
mov dword [esp + 0x18], 2
jl 0x500b38
mov ebp, dword [esp + 0x34]
mov ebx, dword [esp + 0x3c]
mov eax, dword [0x5b121c]
test eax, eax
je 0x500926
lea ecx, [esp + 0xe0]
push edi
push ecx
call fcn.00572da3
add esp, 8
cmp eax, 1
mov dword [esp + 0x50], eax
je case.0x50094c.4
cmp eax, 2
je case.0x50094c.4
movzx eax, byte [esp + edi + 0xe0]
lea esi, [esp + edi + 0xe0]
add eax, 0xfffffffe
cmp eax, 0x1d
mov dword [esp + 0x50], 0
ja case.0x50094c.4
movzx edx, byte [eax + 0x500da8]
jmp dword [edx*4 + 0x500d94]
mov ecx, dword [esp + 0x10]
xor eax, eax
test ecx, ecx
sete al
mov dword [esp + 0x1c], 1
mov dword [esp + 0x10], eax
jmp case.0x50094c.22
mov ecx, dword [0x5a54f8]
call fcn.004336b0
push eax
push 0
lea ecx, [esp + 0x7c]
push ecx
lea edx, [esp + 0x6c]
mov ecx, esi
call fcn.00500120
add edi, eax
jmp case.0x50094c.22
mov dword [esp + 0x10], 0
mov dword [esp + 0x1c], 1
jmp case.0x50094c.22
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x500a8b
mov edx, dword [esp + 0x10]
cmp dword [esp + 0x48], edx
mov dword [esp + 0x1c], 0
je 0x500a8b
mov eax, dword [esp + 0x20]
mov esi, dword [sym.imp.GDI32.dll_SelectObject]
push eax
push ebx
call esi
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x5009e8
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x10]
test eax, eax
mov dword [esp + 0x48], eax
je 0x500a59
mov eax, dword [ebp + 0x9e0]
xor ecx, ecx
cmp eax, 0x190
setle cl
lea edx, [ebp + 0x978]
push edx
mov edx, dword [ebp + 0x9dc]
push 0
push 0
push 0
dec ecx
push 0
and ecx, 0xfffffed4
add ecx, 0x2bc
mov eax, ecx
mov ecx, dword [ebp + 0x9e4]
push ecx
push 0
push 0
push 0
push eax
push 0
push 0
push 0
neg edx
push edx
call dword [sym.imp.GDI32.dll_CreateFontA]
test eax, eax
mov dword [esp + 0x2c], eax
je 0x500a50
push eax
jmp 0x500a68
mov eax, dword [ebp + 0x974]
push eax
jmp 0x500a68
mov ecx, dword [ebp + 0x974]
mov dword [esp + 0x2c], 0
push ecx
push ebx
call esi
lea edx, [esp + 0xa8]
push edx
push ebx
mov dword [esp + 0x28], eax
call dword [sym.imp.GDI32.dll_GetTextMetricsA]
mov esi, dword [esp + 0xc8]
mov dword [esp + 0x38], esi
jmp 0x500a8f
mov esi, dword [esp + 0x38]
mov eax, dword [esp + 0x50]
test eax, eax
je 0x500ac8
cmp eax, 1
jne case.0x50094c.22
lea eax, [esp + 0x78]
push eax
push 2
lea ecx, [esp + edi + 0xe8]
push ecx
push ebx
call dword [sym.imp.GDI32.dll_GetTextExtentPointA]
mov edx, dword [esp + 0x78]
mov eax, dword [esp + 0x18]
sub edx, esi
add eax, edx
mov dword [esp + 0x18], eax
jmp case.0x50094c.22
cmp dword [ebp + 0x708], 9
jne 0x500af2
cmp byte [esp + edi + 0xe0], 9
jne 0x500af2
mov eax, dword [esp + 0x18]
push eax
mov edx, 2
mov ecx, ebp
call fcn.00500330
mov dword [esp + 0x18], eax
jmp case.0x50094c.22
lea ecx, [esp + 0x80]
push ecx
push 1
lea edx, [esp + edi + 0xe8]
push edx
push ebx
call dword [sym.imp.GDI32.dll_GetTextExtentPointA]
mov eax, dword [esp + 0x80]
mov ecx, dword [esp + 0x18]
sub eax, esi
add ecx, eax
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x8b8]
cmp dword [esp + 0x18], ecx
jge 0x500b38
mov eax, dword [esp + 0x4c]
inc edi
cmp edi, eax
jle 0x5008f6
dec edi
cmp edi, 0xa
jge 0x500b43
mov edi, 0xa
mov eax, dword [0x5b121c]
test eax, eax
je 0x500b63
lea edx, [esp + 0xe0]
push edi
push edx
call fcn.00572da3
add esp, 8
cmp eax, 1
jne 0x500b63
dec edi
mov eax, dword [esp + 0x4c]
cmp edi, eax
jg 0x500b6f
mov esi, edi
jne 0x500b78
mov eax, dword [esp + 0x40]
jmp 0x500c81
mov ebx, dword [esp + 0x10]
mov eax, edi
cdq
and edx, 3
add eax, edx
sar eax, 2
mov ebp, edi
sub ebp, eax
mov eax, dword [0x5b121c]
test eax, eax
mov dword [esp + 0x60], edi
je 0x500bb1
lea ecx, [esp + 0xe0]
push edi
push ecx
call fcn.00572da3
add esp, 8
cmp eax, 2
jne 0x500bb1
lea esi, [edi - 1]
cmp esi, ebp
jl 0x500bff
cmp byte [esp + esi + 0xe0], 0x20
je 0x500bfb
mov eax, dword [0x5b121c]
test eax, eax
je 0x500be3
lea edx, [esp + 0xe0]
push esi
push edx
call fcn.00572da3
add esp, 8
cmp eax, 1
je 0x500bf6
cmp eax, 2
je 0x500bf6
cmp byte [esp + esi + 0xe0], 2
jne 0x500bf6
xor eax, eax
test ebx, ebx
sete al
mov ebx, eax
dec esi
cmp esi, ebp
jge 0x500bb5
cmp esi, ebp
jg 0x500c03
mov esi, edi
jmp 0x500c15
cmp dword [esp + 0x10], ebx
je 0x500c15
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], 1
mov eax, dword [0x5b121c]
test eax, eax
je 0x500c39
lea ecx, [esp + 0xe0]
push esi
push ecx
call fcn.00572da3
add esp, 8
cmp eax, 1
jne 0x500c39
test esi, esi
jle 0x500c39
dec esi
mov ecx, dword [esp + 0x24]
test ecx, ecx
mov eax, dword [0x5ae230]
mov byte [esp + esi + 0xe1], 0
je 0x500c79
test eax, eax
je 0x500c69
lea edx, [esi + 1]
cmp edx, eax
jg 0x500c69
dec eax
mov dword [0x5ae230], eax
mov byte [esp + eax + 0x88], 0
jmp 0x500cbb
sub esi, eax
mov eax, dword [esp + 0x14]
lea ecx, [eax + esi + 1]
mov dword [esp + 0x14], ecx
jmp 0x500c85
mov edx, dword [esp + 0x14]
lea eax, [edx + esi + 1]
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x28]
mov eax, dword [edx + 0x1c]
push ecx
mov ecx, dword [esp + 0x8bc]
push eax
push ecx
mov ecx, dword [esp + 0x40]
lea edx, [esp + 0xec]
call fcn.005003d0
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x44], 0
mov dword [esp + 0x24], eax
mov edx, dword [esp + 0x14]
cmp edx, dword [esp + 0x40]
jb 0x500838
mov eax, dword [esp + 0x30]
test eax, eax
jl 0x500cda
push eax
call fcn.00572bf6
add esp, 4
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x3c]
push eax
push ecx
call dword [sym.imp.GDI32.dll_SelectObject]
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x500cf9
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x64]
mov edi, dword [esp + 0x34]
mov dword [0x59bcec], eax
mov eax, dword [esp + 0x54]
test eax, eax
mov dword [0x5ae228], edx
mov edx, dword [esp + 0x5c]
mov dword [0x5ae230], ecx
mov dword [0x5ae254], edx
je 0x500d38
mov eax, dword [edi + 0x6cc]
mov dword [edi + 0x6e4], eax
mov ebx, dword [edi + 0x6f8]
mov esi, dword [esp + 0x58]
mov eax, dword [edi + 0x6cc]
mov ecx, dword [esp + 0x68]
add esi, ebx
mov ebx, dword [esp + 0x28]
push eax
mov edx, ebx
mov dword [edi + 0x6cc], ecx
call fcn.004c8060
mov dword [edi + 0x6cc], eax
mov dword [edi + 0x6f8], esi
mov esi, dword [ebx + 0x44]
mov edx, ebx
mov ecx, eax
call fcn.004c7fe0
mov dword [edi + 0x6cc], eax
dec dword [edi + 0x6f8]
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x8a0
ret 8