Function at 0x409040
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x4d4198
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push ebp
push esi
mov eax, dword [0x513330]
xor eax, esp
push eax
lea eax, [esp + 0x20]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x34]
mov eax, dword [0x51856c]
mov edx, dword [eax + 0xc]
mov ecx, 0x51856c
call edx
add eax, 0x10
mov dword [esp + 0x34], eax
mov esi, dword [esp + 0x30]
xor ebx, ebx
push ebx
push edi
add esi, 4
push esi
lea eax, [esp + 0x40]
mov dword [esp + 0x34], ebx
call fcn.0040ba90
mov eax, dword [ebp]
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x4090b1
push 0x80004005
call fcn.00405ef0
push eax
mov eax, dword [esp + 0x38]
push eax
call fcn.004a6488
add esp, 8
cmp eax, ebx
je 0x4090d2
mov ebp, dword [ebp]
push ebx
push ebp
push 1
push ebx
push edi
push esi
call fcn.0040c810
push 3
push edi
push esi
lea eax, [esp + 0x40]
call fcn.0040ba90
mov ebp, dword [esp + 0x38]
mov eax, dword [ebp]
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x4090fb
push 0x80004005
call fcn.00405ef0
mov ecx, dword [esp + 0x34]
push eax
push ecx
call fcn.004a6488
add esp, 8
cmp eax, ebx
je 0x40911d
mov eax, dword [ebp]
push ebx
push eax
push 1
push 3
push edi
push esi
call fcn.0040c810
push 4
push edi
push esi
lea eax, [esp + 0x40]
call fcn.0040ba90
mov ebp, dword [esp + 0x3c]
mov eax, dword [ebp]
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x409146
push 0x80004005
call fcn.00405ef0
mov edx, dword [esp + 0x34]
push eax
push edx
call fcn.004a6488
add esp, 8
cmp eax, ebx
je 0x409168
mov eax, dword [ebp]
push ebx
push eax
push 1
push 4
push edi
push esi
call fcn.0040c810
push 5
push edi
push esi
lea eax, [esp + 0x40]
call fcn.0040ba90
mov ebp, dword [esp + 0x40]
mov eax, dword [ebp]
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x409191
push 0x80004005
call fcn.00405ef0
push eax
mov eax, dword [esp + 0x38]
push eax
call fcn.004a6488
add esp, 8
cmp eax, ebx
je 0x4091b3
mov eax, dword [ebp]
push ebx
push eax
push 1
push 5
push edi
push esi
call fcn.0040c810
push 1
push edi
push esi
lea eax, [esp + 0x40]
call fcn.0040ba90
mov ebp, dword [esp + 0x44]
mov eax, dword [ebp]
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x4091dc
push 0x80004005
call fcn.00405ef0
mov ecx, dword [esp + 0x34]
push eax
push ecx
call fcn.004a6488
add esp, 8
cmp eax, ebx
je 0x4091fe
mov eax, dword [ebp]
push ebx
push eax
push 1
push 1
push edi
push esi
call fcn.0040c810
mov eax, dword [esi]
lea edx, [esp + 0x10]
push edx
push edi
push 0x100e
push eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x20], ebx
call dword [sym.imp.USER32.dll_SendMessageW]
mov edx, dword [esi]
push ebx
lea ecx, [esp + 0x14]
push ecx
push edx
call dword [sym.imp.USER32.dll_InvalidateRect]
mov esi, eax
mov dword [esp + 0x28], 0xffffffff
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40925b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x20]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0x18