Function at 0x406156
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x45f90c
mov eax, dword fs:[0]
push eax
sub esp, 0x870
push ebx
push esi
push edi
mov eax, dword [0x47c944]
xor eax, esp
push eax
lea eax, [esp + 0x880]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x20]
push eax
call dword [sym.imp.USER32.dll_SetForegroundWindow]
lea ecx, [esp + 0x1c]
push ecx
call dword [sym.imp.USER32.dll_GetCursorPos]
push esi
lea edx, [esp + 0x28]
push edx
call fcn.00413e60
xor esi, esi
mov dword [esp + 0x888], esi
call fcn.00419da5
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x405fb8
push 0x80004005
call fcn.004045a0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x10], eax
mov byte [esp + 0x888], 1
lea ecx, [esp + 0x14]
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], esi
push ecx
lea esi, [esp + 0x1c]
call fcn.00414fd0
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
push edx
lea edi, [esp + 0x14]
call fcn.00415390
mov eax, edi
push eax
lea ecx, [esp + 0x1c]
push 0x46b0cc
push ecx
call fcn.00407780
add esp, 0xc
push 0x46b0c8
push eax
lea edx, [esp + 0x1c]
mov ebx, 2
push edx
mov byte [esp + 0x894], bl
call fcn.00403ab0
add esp, 0xc
push eax
mov ecx, edi
mov byte [esp + 0x88c], 3
call fcn.00403e10
mov byte [esp + 0x888], bl
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406063
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x888], 1
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40608b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call dword [sym.imp.USER32.dll_CreatePopupMenu]
mov edi, dword [sym.imp.USER32.dll_AppendMenuW]
push 0x46b0dc
push 1
mov esi, eax
push 0
push esi
call edi
mov ecx, dword [esp + 0x10]
push ecx
push ebx
push 0
push esi
call edi
push 0x46b0ec
push 3
push 0
push esi
call edi
push 0
push 0
push 0x800
push esi
call edi
push 0x46b0f8
push 4
push 0
push esi
call edi
push 0x46b100
push 5
push 0
push esi
call edi
push 0x46b18c
push 6
push 0
push esi
call edi
call fcn.004245f3
test eax, eax
je 0x406100
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x74]
call eax
jmp 0x406102
xor eax, eax
mov ecx, dword [eax + 0x20]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
push 0
push ecx
push 0
push edx
push eax
push 0x128
push esi
call dword [sym.imp.USER32.dll_TrackPopupMenu]
dec eax
cmp eax, 5
ja case.default.0x40612a
jmp dword [eax*4 + 0x40622c]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x20]
push 0x112f
push 0x74
push pe_nt_image_headers32
push edx
call dword [sym.imp.USER32.dll_PostMessageW]
jmp case.default.0x40612a
mov eax, dword [ebp + 8]
call fcn.004071c0
jmp case.default.0x40612a
push 0
push 0
push 0
push 0x403790
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
xor eax, eax
mov ecx, 0x46a4fc
mov ebx, 0x46b128
call fcn.004037a0
add esp, 4
jmp case.default.0x40612a
push 1
mov ecx, 0x481358
call fcn.00402880
test eax, eax
jne 0x4061af
push eax
mov ecx, 0x46a4fc
mov ebx, 0x46b138
call fcn.004037a0
add esp, 4
jmp case.default.0x40612a
call fcn.00404f00
mov ebx, dword [ebp + 8]
call fcn.004074b0
push esi
call dword [sym.imp.USER32.dll_DestroyMenu]
mov byte [esp + 0x888], 0
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4061eb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x24]
mov dword [esp + 0x888], 0xffffffff
call fcn.00413fd0
mov ecx, dword [esp + 0x880]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea eax, [esp + 0x24]
mov ecx, eax
mov dword [0x481144], eax
call fcn.00421857
jmp case.default.0x40612a