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

Disassembly:
push 0xffffffffffffffff
push 0x5882da
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xb4
push ebx
push ebp
push esi
mov ebp, ecx
push edi
mov dword [esp + 0x20], ebp
call fcn.00502540
test eax, eax
mov dword [esp + 0x24], eax
je 0x505c28
mov eax, dword [esp + 0xe8]
xor edx, edx
mov ecx, eax
mov edi, dword [esp + 0xe4]
and ecx, 0x1e
mov ebx, dword [esp + 0xe0]
cmp ecx, eax
sete dl
mov esi, edx
test esi, esi
jne 0x505395
push edi
push ebx
mov ecx, ebp
call fcn.00506200
test eax, eax
jne 0x505395
mov eax, dword [esp + 0xf0]
test eax, eax
je 0x505c28
push eax
call dword [sym.imp.USER32.dll_SetRectEmpty]
jmp 0x505c28
lea ecx, [esp + 0x88]
call fcn.005015f0
mov ecx, dword [esp + 0x24]
push 1
push edi
lea eax, [esp + 0x90]
push ebx
push eax
mov dword [esp + 0xdc], 0
call fcn.004ff8f0
cmp esi, 1
push edi
jne 0x5053e0
mov ecx, ebp
call fcn.00502070
push ebx
mov ecx, ebp
mov dword [esp + 0x30], eax
call fcn.00501f90
mov dword [esp + 0x30], eax
jmp 0x5053fc
lea ecx, [esp + 0x1c]
push ebx
push ecx
mov ecx, ebp
call fcn.00505f90
mov edx, eax
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
lea ecx, [esp + 0x88]
call fcn.005016d0
mov edi, eax
lea ecx, [esp + 0x88]
mov dword [esp + 0x44], eax
and edi, 0xf
call fcn.00501720
mov ebx, dword [esp + 0xdc]
mov edx, dword [esp + 0xd8]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x30]
add ecx, edx
add eax, ebx
mov esi, ebx
mov ebp, eax
mov eax, dword [esp + 0xf0]
test eax, eax
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], ebp
je 0x505465
mov dword [eax], edx
mov dword [eax + 4], esi
mov dword [eax + 8], ecx
mov dword [eax + 0xc], ebp
lea ecx, [esp + 0x88]
call fcn.004ffaf0
mov ebp, eax
cmp ebp, 0xff000000
mov dword [esp + 0x14], ebp
jne 0x50548a
mov edx, dword [esp + 0x20]
mov ebp, dword [edx + 0x40]
mov dword [esp + 0x14], ebp
mov eax, dword [esp + 0x20]
mov ecx, dword [eax + 0x6c]
test ecx, ecx
jne 0x5054c7
mov esi, dword [esp + 0x24]
mov ecx, esi
call fcn.004ff8d0
cmp dword [esp + 0xe0], eax
jl 0x5054b9
mov ecx, esi
call fcn.004ff8e0
cmp dword [esp + 0xe4], eax
jge 0x5054c7
push 0xf
call dword [sym.imp.USER32.dll_GetSysColor]
mov ebp, eax
mov dword [esp + 0x14], ebp
mov al, byte [esp + 0xe8]
mov esi, dword [esp + 0xd4]
test al, 0x20
je 0x505562
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0xec]
mov dword [esp + 0x54], ecx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x58], edx
test eax, eax
mov dword [esp + 0x60], ecx
je 0x505519
push eax
lea edx, [esp + 0x58]
lea eax, [esp + 0x58]
push edx
push eax
call dword [sym.imp.USER32.dll_IntersectRect]
push ebp
lea ecx, [esp + 0x1c]
call fcn.005814ff
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x18]
mov edx, dword [esi + 4]
neg eax
sbb eax, eax
and eax, ecx
lea ecx, [esp + 0x54]
push eax
push ecx
push edx
call dword [sym.imp.USER32.dll_FillRect]
mov dword [esp + 0x18], 0xbcec68
lea ecx, [esp + 0x18]
mov byte [esp + 0xcc], 1
call fcn.00581499
mov byte [esp + 0xcc], 0
test byte [esp + 0xe8], 1
je 0x505bdc
lea ecx, [esp + 0x88]
call fcn.005016a0
test eax, eax
jne 0x50584b
mov eax, dword [esp + 0x44]
test ah, 7
je 0x50569c
mov eax, dword [esp + 0x20]
xor edx, edx
mov ecx, dword [eax + 0x3c]
push ecx
mov ecx, dword [eax + 0x6c]
cmp ecx, 2
lea ecx, [esp + 0x1c]
setne dl
dec edx
and edx, 3
push edx
push 0
call fcn.005814af
lea eax, [esp + 0x18]
mov ecx, esi
push eax
mov byte [esp + 0xd0], 2
call fcn.00580a96
mov ebp, dword [esp + 0xd8]
push ebx
lea ecx, [esp + 0x58]
push ebp
push ecx
mov ecx, esi
mov dword [esp + 0x30], eax
call fcn.00580f87
mov eax, dword [esp + 0x44]
test ah, 1
je 0x5055f7
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
add edx, ebx
push edx
jmp 0x50566b
mov eax, dword [esp + 0x44]
test ah, 4
je 0x505633
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
add ecx, ebx
add edx, ebp
push ecx
push edx
mov ecx, esi
call fcn.00580fd3
mov eax, dword [esp + 0x2c]
push ebx
add eax, ebp
lea ecx, [esp + 0x58]
push eax
push ecx
mov ecx, esi
call fcn.00580f87
mov edx, dword [esp + 0x30]
add edx, ebx
push edx
push ebp
jmp 0x50566e
mov eax, dword [esp + 0x30]
mov ecx, esi
cdq
sub eax, edx
sar eax, 1
add eax, ebx
push eax
mov eax, dword [esp + 0x30]
add eax, ebp
push eax
call fcn.00580fd3
push ebx
lea ecx, [esp + 0x58]
push ebp
push ecx
mov ecx, esi
call fcn.00580f87
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
add edx, ebx
push edx
cdq
sub eax, edx
sar eax, 1
add eax, ebp
push eax
mov ecx, esi
call fcn.00580fd3
mov eax, dword [esp + 0x24]
mov ecx, esi
push eax
call fcn.00580a96
mov dword [esp + 0x18], 0xbcec68
lea ecx, [esp + 0x18]
mov byte [esp + 0xcc], 3
call fcn.00581499
jmp 0x5056a3
mov ebp, dword [esp + 0xd8]
mov eax, dword [esp + 0x48]
lea ecx, [esp + 0x34]
neg eax
push eax
push eax
push ecx
call dword [sym.imp.USER32.dll_InflateRect]
mov edx, dword [0xbfc648]
mov dword [esp + 0x10], edx
lea eax, [esp + 0x10]
lea ecx, [esp + 0x88]
push eax
mov byte [esp + 0xd0], 4
call fcn.005017c0
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx - 8]
test eax, eax
je 0x505835
mov dword [esp + 0x58], 0
mov dword [esp + 0x54], 0xbcec74
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x54]
push 0
lea eax, [esp + 0x8c]
push edx
push eax
mov byte [esp + 0xd8], 5
call fcn.005051a0
mov edx, dword [esi]
lea eax, [esp + 0x54]
push eax
mov ecx, esi
call dword [edx + 0x28]
cmp edi, 2
mov dword [esp + 0x24], eax
mov ebp, 0x800
je 0x505752
cmp edi, 5
je 0x505752
cmp edi, 8
je 0x505752
cmp edi, 3
je 0x50574b
cmp edi, 6
je 0x50574b
cmp edi, 9
jne 0x505757
mov ebp, 0x802
jmp 0x505757
mov ebp, 0x801
cmp edi, 4
je 0x50577a
cmp edi, 5
je 0x50577a
cmp edi, 6
je 0x50577a
cmp edi, 7
je 0x505775
cmp edi, 8
je 0x505775
cmp edi, 9
jne 0x50577d
or ebp, 8
jmp 0x50577d
or ebp, 4
push 0xd
lea ecx, [esp + 0x14]
call fcn.0057ac0f
cmp eax, 0xffffffff
jne 0x5057bc
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x18]
push edx
mov ecx, dword [eax - 8]
push ecx
push eax
mov eax, dword [esi + 8]
push eax
call dword [sym.imp.GDI32.dll_GetTextExtentPoint32A]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x18]
sub ecx, edx
cmp eax, ecx
jge 0x5057bc
or ebp, 0x20
jmp 0x5057bf
or ebp, 0x10
mov eax, dword [esp + 0x20]
test byte [eax + 0x44], 8
je 0x5057d6
mov ecx, dword [eax + 0x6c]
test ecx, ecx
je 0x5057d6
or ebp, 0x100
mov edi, dword [esi]
lea ecx, [esp + 0x88]
call fcn.0050ecf0
push eax
mov ecx, esi
call dword [edi + 0x30]
push 1
mov ecx, esi
call fcn.00580b72
mov eax, dword [esp + 0x10]
mov edx, dword [esi]
lea edi, [esp + 0x34]
push ebp
mov ecx, dword [eax - 8]
push edi
push ecx
push eax
mov ecx, esi
call dword [edx + 0x68]
mov ecx, dword [esp + 0x24]
mov eax, dword [esi]
push ecx
mov ecx, esi
call dword [eax + 0x28]
mov dword [esp + 0x54], 0xbcec68
lea ecx, [esp + 0x54]
mov byte [esp + 0xcc], 6
call fcn.00581499
mov ebp, dword [esp + 0xd8]
lea ecx, [esp + 0x10]
mov byte [esp + 0xcc], 0
call fcn.0057a794
jmp 0x505be3
cmp eax, 1
je 0x505859
cmp eax, 2
jne 0x505bdc
lea ecx, [esp + 0x88]
call fcn.00501730
test eax, eax
mov dword [esp + 0x24], eax
je 0x505bdc
mov eax, dword [esp + 0x48]
lea edx, [esp + 0x34]
neg eax
push eax
push eax
push edx
call dword [sym.imp.USER32.dll_InflateRect]
mov ecx, dword [esi + 8]
lea eax, [esp + 0x34]
push 2
push eax
push ecx
call dword [sym.imp.GDI32.dll_LPtoDP]
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 0x1c]
mov eax, dword [esi]
push 1
mov ecx, esi
call dword [eax + 0x34]
push 0
push 0
push 0
push 0
call dword [sym.imp.GDI32.dll_CreateRectRgn]
mov ecx, dword [esi + 4]
mov ebx, eax
push ebx
push ecx
mov dword [esp + 0x8c], ebx
call dword [sym.imp.GDI32.dll_GetClipRgn]
mov ebp, eax
mov dword [esp + 0x1c], 0
dec ebp
mov dword [esp + 0x18], 0xbcec80
neg ebp
sbb ebp, ebp
inc ebp
mov dword [esp + 0x54], ebp
mov edx, dword [esp + 0x20]
mov byte [esp + 0xcc], 7
test byte [edx + 0x44], 8
je 0x5058fe
mov eax, edx
mov ecx, dword [eax + 0x6c]
test ecx, ecx
jne 0x505921
lea ecx, [esp + 0x34]
push ecx
call dword [sym.imp.GDI32.dll_CreateRectRgnIndirect]
push eax
lea ecx, [esp + 0x1c]
call fcn.00581442
lea edx, [esp + 0x18]
push 1
push edx
mov ecx, esi
call fcn.00581080
mov edx, dword [esp + 0x24]
xor eax, eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x64]
push eax
push ecx
push edx
push esi
call fcn.004fa7c0
cmp eax, 1
jne 0x505b89
mov ebp, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
mov ebx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
sub ebx, ebp
sub ecx, eax
cmp edi, 0xa
mov dword [esp + 0x50], ebp
mov dword [esp + 0x10], eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x14], ecx
jne 0x505990
push 0xcc0020
push ecx
push ebx
push eax
push ebp
jmp 0x505b6a
cmp edi, 0xd
je 0x505a4f
cmp edi, 0xe
je 0x505a4f
cmp edi, 0xc
je 0x505a4f
cmp edi, 0xb
je 0x505a4f
cmp edi, 2
je 0x5059de
cmp edi, 5
je 0x5059de
cmp edi, 8
je 0x5059de
cmp edi, 3
je 0x5059d2
cmp edi, 6
je 0x5059d2
cmp edi, 9
jne 0x5059f1
sub ebx, dword [esp + 0x6c]
add ebx, ebp
mov dword [esp + 0x50], ebx
jmp 0x5059f1
mov edx, dword [esp + 0x6c]
mov eax, ebx
sub eax, edx
cdq
sub eax, edx
sar eax, 1
add eax, ebp
mov dword [esp + 0x50], eax
cmp edi, 4
je 0x505a21
cmp edi, 5
je 0x505a21
cmp edi, 6
je 0x505a21
cmp edi, 7
je 0x505a0f
cmp edi, 8
je 0x505a0f
cmp edi, 9
jne 0x505a38
mov edx, dword [esp + 0x70]
mov eax, dword [esp + 0x38]
sub ecx, edx
add ecx, eax
mov dword [esp + 0x10], ecx
jmp 0x505a38
mov ebx, dword [esp + 0x70]
mov eax, ecx
mov ecx, dword [esp + 0x38]
sub eax, ebx
cdq
sub eax, edx
sar eax, 1
add eax, ecx
mov dword [esp + 0x10], eax
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x50]
push 0xcc0020
push 0xffffffffffffffff
push 0xffffffffffffffff
push edx
jmp 0x505b69
mov edx, dword [esp + 0x70]
mov ebp, dword [esp + 0x6c]
cmp edi, 0xd
mov dword [esp + 0x48], edx
je 0x505acb
fild dword [esp + 0x6c]
fst qword [esp + 0x48]
fidivr dword [esp + 0x24]
fild dword [esp + 0x70]
fst qword [esp + 0x24]
fild dword [esp + 0x14]
fdiv st(1)
fstp qword [esp + 0x7c]
fstp st(0)
fcom qword [esp + 0x7c]
fnstsw ax
test ah, 1
jne 0x505a91
fstp st(0)
fld qword [esp + 0x7c]
cmp edi, 0xb
jne 0x505aad
fld qword [0xbcec90]
fcomp st(1)
fnstsw ax
test ah, 1
je 0x505aad
fstp st(0)
fld qword [0xbcec90]
fld qword [esp + 0x48]
fmul st(1)
call fcn.00569178
fld qword [esp + 0x24]
fmul st(1)
mov ebp, eax
call fcn.00569178
fstp st(0)
mov dword [esp + 0x48], eax
cmp edi, 0xc
je 0x505b3d
cmp edi, 0xb
je 0x505b3d
mov eax, dword [esp + 0x14]
mov dword [esp + 0x24], 0
test eax, eax
jle 0x505b74
mov eax, dword [esp + 0x24]
xor edi, edi
test ebx, ebx
jle 0x505b29
mov ecx, dword [esp + 0x10]
add eax, ecx
mov dword [esp + 0x7c], eax
mov edx, dword [esp + 0x48]
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x7c]
push 0xcc0020
push edx
push ebp
push eax
lea edx, [edi + ecx]
lea eax, [esp + 0x74]
push edx
push eax
call fcn.004fac00
add edi, ebp
cmp edi, ebx
jl 0x505afd
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x48]
mov ecx, dword [esp + 0x14]
add eax, edx
cmp eax, ecx
mov dword [esp + 0x24], eax
jl 0x505aed
jmp 0x505b74
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x38]
sub eax, ecx
cdq
sub eax, edx
push 0xcc0020
sar eax, 1
push ecx
add eax, edi
push ebp
push eax
mov eax, ebx
sub eax, ebp
cdq
sub eax, edx
mov edx, dword [esp + 0x44]
sar eax, 1
add eax, edx
push eax
lea ecx, [esp + 0x78]
push ecx
call fcn.004fac00
lea edx, [esp + 0x64]
push edx
call fcn.004fafa0
mov ebx, dword [esp + 0x84]
mov ebp, dword [esp + 0x54]
cmp ebp, 1
jne 0x505b9b
mov eax, dword [esi + 4]
push ebx
push eax
call dword [sym.imp.GDI32.dll_SelectClipRgn]
jmp 0x505ba4
push 0
mov ecx, esi
call fcn.00580ec3
push ebx
call dword [sym.imp.GDI32.dll_DeleteObject]
mov edx, dword [esi]
push 0xffffffffffffffff
mov ecx, esi
call dword [edx + 0x20]
mov dword [esp + 0x18], 0xbcec68
lea ecx, [esp + 0x18]
mov byte [esp + 0xcc], 8
call fcn.00581499
mov ebx, dword [esp + 0xdc]
mov byte [esp + 0xcc], 0
mov ebp, dword [esp + 0xd8]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0xe8]
push eax
mov eax, dword [esp + 0xe8]
lea edx, [esp + 0x30]
push ecx
mov ecx, dword [esp + 0xe8]
push edx
push eax
push ecx
mov ecx, dword [esp + 0x34]
push ebx
push ebp
push esi
call fcn.00505c50
lea ecx, [esp + 0x88]
mov dword [esp + 0xcc], 0xffffffff
call fcn.00501620
mov ecx, dword [esp + 0xc4]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xc0
ret 0x20