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

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, eax
push esi
push ebx
sub esp, 0x48
mov eax, dword [eax + 0x84]
mov dword [eax + 0x64], 2
mov edx, dword [edi + 8]
mov eax, dword [edi + 0x84]
mov ecx, dword [edx + 0xc]
cmp dword [eax + 0x48], ecx
je 0x40c740
mov dword [eax + 0x48], ecx
mov edx, dword [edi + 8]
mov eax, dword [edi + 0x84]
mov edx, dword [edx + 0x10]
mov dword [eax + 0x4c], edx
mov ecx, dword [edi + 8]
mov edx, dword [ecx + 0xc]
test edx, edx
jne 0x40c5d0
lea esi, [ebp - 0x1c]
mov eax, dword [edi + 0x84]
mov ecx, dword [ecx + 0x10]
mov dword [ebp - 0x20], esi
mov dword [eax + 0x54], edx
mov dword [eax + 0x5c], 0
mov dword [eax + 0x58], ecx
mov dword [eax + 0x60], 0
mov eax, dword [edi + 8]
mov esi, dword [eax + 0x7c]
lea ebx, [esi + 1]
mov esi, dword [eax + 0x80]
sub ebx, dword [eax + 0x74]
inc esi
sub esi, dword [eax + 0x78]
mov eax, dword [edi + 0x84]
mov dword [eax + 0x38], ebx
mov eax, dword [edi + 0x84]
mov dword [eax + 0x3c], esi
mov edx, dword [edi + 8]
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], 0
movsx eax, word [edx + 0x84]
imul eax, ebx
mov dword [ebp - 0x14], eax
movsx eax, word [edx + 0x86]
mov dword [esp + 4], 0xfffffff0
imul eax, esi
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetWindowLongW]
sub esp, 8
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], 0
mov dword [esp], eax
call dword [sym.imp.user32.dll_AdjustWindowRect]
mov eax, dword [edi + 8]
sub esp, 0xc
cmp dword [eax + 0xc], ebx
jbe 0x40c700
mov eax, dword [sym.imp.user32.dll_GetSystemMetrics]
mov dword [esp], 3
mov dword [ebp - 0x24], eax
call eax
sub esp, 4
mov dword [ebp - 0x28], eax
mov dword [esp + 0x10], 0
mov eax, dword [edi + 8]
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
sub eax, ebx
mov dword [esp + 0xc], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_SetScrollRange]
sub esp, 0x14
mov dword [esp + 0xc], 0
mov eax, dword [edi + 8]
mov eax, dword [eax + 0x78]
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_SetScrollPos]
mov ebx, dword [sym.imp.user32.dll_ShowScrollBar]
sub esp, 0x10
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call ebx
sub esp, 0xc
mov eax, dword [edi + 8]
cmp dword [eax + 0x10], esi
jbe 0x40c6d8
mov dword [esp], 2
mov eax, dword [ebp - 0x24]
call eax
sub esp, 4
mov dword [ebp - 0x2c], eax
mov dword [esp + 0x10], 0
mov eax, dword [edi + 8]
mov eax, dword [eax + 0x10]
mov dword [esp + 8], 0
mov dword [esp + 4], 1
sub eax, esi
mov dword [esp + 0xc], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_SetScrollRange]
sub esp, 0x14
mov dword [esp + 0xc], 0
mov eax, dword [edi + 8]
mov eax, dword [eax + 0x78]
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_SetScrollPos]
sub esp, 0x10
mov dword [esp + 8], 1
mov dword [esp + 4], 1
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call ebx
mov edx, dword [ebp - 0x2c]
sub esp, 0xc
mov eax, dword [ebp - 0x28]
add eax, dword [ebp - 0x10]
mov dword [esp + 0x18], 0x16
sub eax, dword [ebp - 0x18]
mov dword [esp + 0xc], 0
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 8], 0
add eax, edx
sub eax, dword [ebp - 0x1c]
mov dword [esp + 4], 0
mov dword [esp + 0x10], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_SetWindowPos]
mov eax, dword [ebp - 0x20]
sub esp, 0x1c
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0x30
call dword [sym.imp.user32.dll_SystemParametersInfoW]
mov ecx, dword [edi + 8]
mov eax, dword [ebp - 0x14]
sub eax, dword [ebp - 0x1c]
sub esp, 0x10
movsx ebx, word [ecx + 0x84]
cdq
idiv ebx
mov dword [ecx + 0x28], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x18]
mov dword [esp], 4
mov ebx, eax
mov eax, dword [ebp - 0x24]
call eax
mov ecx, dword [edi + 8]
mov edx, eax
mov eax, ebx
sub esp, 4
movsx ebx, word [ecx + 0x86]
sub eax, edx
cdq
idiv ebx
mov dword [ecx + 0x2c], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_InvalidateRect]
mov eax, dword [edi + 0xac]
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.user32.dll_UpdateWindow]
mov eax, dword [edi + 8]
mov dword [ebp - 0x2c], 1
sub esp, 4
mov eax, dword [eax + 0x74]
mov dword [ebp - 0x24], eax
mov eax, dword [edi + 0x84]
movzx esi, word [ebp - 0x24]
mov word [eax + 0x34], si
mov edx, dword [edi + 8]
mov eax, dword [edi + 0x84]
mov edx, dword [edx + 0x78]
mov word [eax + 0x36], dx
mov eax, dword [edi + 0x84]
mov ecx, dword [eax + 0x58]
mov edx, dword [eax + 0x60]
cmp ecx, edx
jg 0x40c3ca
mov ebx, dword [eax + 0x5c]
mov esi, dword [eax + 0x54]
mov dword [ebp - 0x20], ebx
cmp esi, ebx
jle 0x40c917
mov ecx, dword [edi + 8]
mov esi, dword [ebp - 0x2c]
mov edx, dword [ecx + 0x14]
test esi, esi
jne 0x40c3e0
cmp dword [eax + 0x40], edx
je 0x40c8cc
mov dword [eax + 0x40], edx
mov eax, dword [edi + 8]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x18]
mov dword [ebp - 0x20], esi
test ebx, ebx
jne 0x40c89b
mov eax, dword [edi + 0x84]
mov edx, dword [eax + 0x10]
test edx, edx
je 0x40c416
mov dword [esp], edx
call dword [sym.imp.gdi32.dll_DeleteObject]
mov eax, dword [edi + 0x84]
sub esp, 4
mov dword [eax + 0x10], 0
mov eax, dword [edi + 0x84]
cmp dword [ebp - 0x20], 0x64
mov dword [eax + 0x44], 0
je 0x40c541
mov esi, dword [edi + 8]
movsx ecx, word [esi + 0x84]
movsx ebx, word [esi + 0x86]
mov dword [ebp - 0x34], esi
lea eax, [ecx + 0xf]
mov word [ebp - 0x38], cx
and eax, 0xfffffff0
mov dword [ebp - 0x24], ecx
lea edx, [eax + 7]
mov dword [esp + 4], ebx
cmovs eax, edx
mov edx, eax
sar edx, 3
mov dword [ebp - 0x28], edx
mov dword [esp], edx
call dword [sym.imp.ucrtbase.dll_calloc]
mov esi, eax
test eax, eax
je 0x40c541
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x30], ebx
mov edx, 1
imul eax, ebx
cmp eax, 0xc7
jg 0x40c8fd
mov eax, ebx
sub ebx, edx
mov dword [ebp - 0x24], ebx
mov edx, ebx
cmp eax, ebx
jle 0x40c508
mov ebx, dword [ebp - 0x28]
imul ebx, edx
mov edx, ebx
movzx ebx, word [ebp - 0x38]
mov dword [ebp - 0x38], edi
mov edi, dword [ebp - 0x34]
lea esi, [esi]
xor eax, eax
test bx, bx
jle 0x40c4f0
mov dword [ebp - 0x20], edx
lea esi, [esi]
mov ebx, eax
mov ecx, eax
mov edx, pe_nt_image_headers32
inc eax
and ecx, 7
sar ebx, 3
add ebx, dword [ebp - 0x20]
sar edx, cl
or byte [esi + ebx], dl
movsx ecx, word [edi + 0x84]
mov ebx, ecx
cmp eax, ecx
jl 0x40c4c8
mov edx, dword [ebp - 0x20]
inc dword [ebp - 0x24]
movsx eax, word [edi + 0x86]
add edx, dword [ebp - 0x28]
cmp dword [ebp - 0x24], eax
jl 0x40c4b8
mov dword [ebp - 0x30], eax
mov edi, dword [ebp - 0x38]
mov eax, dword [ebp - 0x30]
mov ebx, dword [edi + 0x84]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 1
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov dword [esp], ecx
call dword [sym.imp.gdi32.dll_CreateBitmap]
sub esp, 0x14
mov dword [ebx + 0x10], eax
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_free]
mov ecx, dword [edi + 8]
mov eax, dword [edi + 0x84]
mov edx, dword [ecx + 0x18]
cmp edx, dword [eax + 0x44]
je 0x40c572
mov dword [eax + 0x44], edx
mov ebx, dword [edi + 0xac]
call dword [sym.imp.user32.dll_GetFocus]
cmp ebx, eax
je 0x40c9d0
mov ecx, dword [edi + 8]
mov eax, dword [edi + 0x84]
mov edx, dword [ebp - 0x2c]
test edx, edx
jne 0x40c888
mov esi, dword [ecx + 0xc]
mov ebx, dword [ecx + 0x1c]
lea edx, [esi - 1]
cmp edx, ebx
cmova edx, ebx
movsx ebx, word [eax + 0x50]
cmp ebx, edx
je 0x40c8ba
mov word [eax + 0x50], dx
mov edx, dword [edi + 8]
mov eax, dword [edi + 0x84]
mov edx, dword [edx + 0x20]
mov word [eax + 0x52], dx
mov eax, edi
call sym._update_window_cursor
mov eax, dword [edi + 0x84]
mov dword [eax + 0x64], 0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [ecx + 0x10]
mov eax, dword [edi + 0x84]
test ecx, ecx
je 0x40c6c8
mov ebx, dword [eax + 8]
test ebx, ebx
je 0x40c6c8
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetDC]
sub esp, 4
mov ebx, eax
test eax, eax
je 0x40c5bf
mov eax, dword [edi + 8]
movsx edx, word [eax + 0x86]
imul edx, dword [eax + 0x10]
mov dword [esp + 8], edx
movsx edx, word [eax + 0x84]
imul edx, dword [eax + 0xc]
mov dword [esp], ebx
mov dword [esp + 4], edx
call dword [sym.imp.gdi32.dll_CreateCompatibleBitmap]
sub esp, 0xc
mov esi, eax
mov dword [esp + 4], ebx
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_ReleaseDC]
sub esp, 8
mov dword [esp + 4], esi
mov eax, dword [edi + 0x84]
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.gdi32.dll_SelectObject]
mov eax, dword [edi + 0x84]
sub esp, 8
mov edx, dword [eax + 4]
test edx, edx
je 0x40c680
mov dword [esp], edx
call dword [sym.imp.gdi32.dll_DeleteObject]
mov eax, dword [edi + 0x84]
sub esp, 4
mov dword [eax + 4], esi
mov edx, dword [edi + 8]
mov eax, dword [edx + 0x10]
mov edx, dword [edx + 0xc]
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
dec eax
dec edx
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x14], edx
mov edx, eax
mov dword [ebp - 0x20], eax
mov eax, edi
call sym._fill_mem_dc
mov edx, dword [edi + 8]
mov eax, dword [edi + 0x84]
mov ecx, dword [edx + 0x10]
mov edx, dword [edx + 0xc]
jmp 0x40c0ac
lea esi, [ebp - 0x1c]
mov dword [ebp - 0x20], esi
jmp 0x40c0ac
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call ebx
xor edx, edx
sub esp, 0xc
jmp 0x40c292
mov dword [esp + 8], 0
mov ebx, dword [sym.imp.user32.dll_ShowScrollBar]
mov dword [esp + 4], 0
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call ebx
mov eax, dword [sym.imp.user32.dll_GetSystemMetrics]
mov dword [ebp - 0x28], 0
sub esp, 0xc
mov dword [ebp - 0x24], eax
jmp 0x40c1f1
mov esi, dword [edx + 0x10]
cmp dword [eax + 0x4c], esi
jne 0x40c07d
mov esi, dword [eax + 4]
test esi, esi
je 0x40ca2f
mov esi, dword [edx + 0x7c]
mov ecx, dword [edx + 0x74]
lea ebx, [esi + 1]
mov esi, dword [edx + 0x78]
mov dword [ebp - 0x24], ecx
sub ebx, ecx
mov dword [ebp - 0x28], esi
mov ecx, esi
mov esi, dword [edx + 0x80]
inc esi
sub esi, ecx
lea ecx, [ebp - 0x1c]
mov dword [ebp - 0x20], ecx
cmp dword [eax + 0x38], ebx
jne 0x40c0dc
cmp dword [eax + 0x3c], esi
jne 0x40c0dc
movsx esi, word [eax + 0x34]
movsx ebx, word [eax + 0x36]
cmp esi, dword [ebp - 0x24]
jne 0x40c7ab
mov dword [ebp - 0x2c], 0
cmp dword [ebp - 0x28], ebx
je 0x40c391
sub ebx, dword [ebp - 0x28]
sub esi, dword [ebp - 0x24]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
movsx eax, word [edx + 0x86]
imul ebx, eax
mov dword [esp + 8], ebx
movsx eax, word [edx + 0x84]
imul esi, eax
mov dword [esp + 4], esi
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_ScrollWindow]
mov ebx, dword [sym.imp.user32.dll_SetScrollPos]
sub esp, 0x14
mov dword [esp + 0xc], 1
mov eax, dword [edi + 8]
mov eax, dword [eax + 0x74]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call ebx
sub esp, 0x10
mov dword [esp + 0xc], 1
mov eax, dword [edi + 8]
mov eax, dword [eax + 0x78]
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call ebx
sub esp, 0x10
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_InvalidateRect]
mov eax, dword [edi + 8]
mov dword [ebp - 0x2c], 0
sub esp, 0xc
mov eax, dword [eax + 0x74]
mov dword [ebp - 0x24], eax
mov eax, dword [edi + 0x84]
jmp 0x40c391
mov esi, dword [ecx + 0xc]
mov ecx, dword [ecx + 0x1c]
lea edx, [esi - 1]
cmp edx, ecx
cmova edx, ecx
jmp 0x40c597
mov ebx, dword [edi + 0xac]
call dword [sym.imp.user32.dll_GetFocus]
cmp ebx, eax
jne 0x40c3f7
call dword [sym.imp.user32.dll_DestroyCaret]
jmp 0x40c3f7
movsx ebx, word [eax + 0x52]
cmp dword [ecx + 0x20], ebx
jne 0x40c597
jmp 0x40c5b8
mov edx, dword [ecx + 0x18]
cmp edx, dword [eax + 0x44]
je 0x40c57d
mov dword [eax + 0x44], edx
mov ebx, dword [edi + 0xac]
call dword [sym.imp.user32.dll_GetFocus]
cmp ebx, eax
je 0x40c9d0
mov ecx, dword [edi + 8]
mov eax, dword [edi + 0x84]
jmp 0x40c57d
mov edx, 0x51eb851f
mov dword [ebp - 0x20], eax
imul edx
mov eax, dword [ebp - 0x20]
sar eax, 0x1f
sar edx, 5
sub edx, eax
jmp 0x40c496
mov ebx, dword [edi + 8]
inc edx
mov ebx, dword [ebx + 0x74]
mov dword [ebp - 0x24], ebx
mov ebx, dword [edi + 8]
sub esi, dword [ebp - 0x24]
movsx ebx, word [ebx + 0x84]
mov dword [ebp - 0x28], ebx
imul esi, ebx
mov ebx, dword [ebp - 0x20]
inc ebx
sub ebx, dword [ebp - 0x24]
imul ebx, dword [ebp - 0x28]
mov dword [ebp - 0x1c], esi
mov esi, dword [edi + 8]
mov dword [ebp - 0x14], ebx
mov ebx, dword [edi + 8]
mov esi, dword [esi + 0x78]
movsx ebx, word [ebx + 0x86]
sub edx, esi
sub ecx, esi
imul ecx, ebx
imul ebx, edx
lea edx, [eax + 0x54]
mov eax, edi
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x10], ebx
call sym._fill_mem_dc
mov eax, dword [edi + 8]
mov ecx, dword [edi + 0x84]
mov edx, dword [eax + 0x10]
mov eax, dword [eax + 0xc]
mov dword [ecx + 0x5c], 0
mov dword [ecx + 0x60], 0
mov dword [ecx + 0x54], eax
lea eax, [ebp - 0x1c]
mov dword [ecx + 0x58], edx
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_InvalidateRect]
mov eax, dword [edi + 0xac]
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.user32.dll_UpdateWindow]
mov eax, dword [edi + 0x84]
sub esp, 4
jmp 0x40c3ca
mov eax, dword [edi + 0x84]
mov ecx, dword [eax + 0x44]
test ecx, ecx
je 0x40ca24
mov edx, dword [edi + 8]
movsx ecx, word [edx + 0x86]
mov dword [esp + 0xc], ecx
movsx edx, word [edx + 0x84]
mov dword [esp + 8], edx
mov eax, dword [eax + 0x10]
mov dword [esp + 4], eax
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_CreateCaret]
mov eax, edi
sub esp, 0x10
call sym._update_window_cursor
mov ecx, dword [edi + 8]
mov eax, dword [edi + 0x84]
jmp 0x40c572
call dword [sym.imp.user32.dll_DestroyCaret]
jmp 0x40c569
mov eax, dword [edi + 0xac]
mov dword [esp], eax
call dword [sym.imp.user32.dll_IsWindowVisible]
mov edx, dword [edi + 8]
sub esp, 4
test eax, eax
mov eax, dword [edi + 0x84]
je 0x40c757
mov ecx, dword [edx + 0xc]
jmp 0x40c07d