Function at 0x422610
Capabilities:
Create thread

Disassembly:
sub esp, 0x38
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov eax, dword [edi + 0xc0]
test eax, eax
je 0x422668
mov eax, dword [edi + 0xb8]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [edi + 0xc0]
push 0xbb8
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x422651
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
mov edx, dword [edi + 0xc0]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0xc0], 0
mov eax, dword [edi + 0x200]
push 0x83
push eax
call dword [sym.imp.USER32.dll_LoadMenuA]
push 0
push eax
mov dword [esp + 0x24], eax
call dword [sym.imp.USER32.dll_GetSubMenu]
mov ebp, eax
mov eax, dword [edi + 0x98c]
test eax, eax
mov dword [esp + 0x10], ebp
jne 0x4226a5
push 1
push 0x4f96
push ebp
call dword [sym.imp.USER32.dll_EnableMenuItem]
mov ecx, dword [0x4eb43c]
neg ecx
sbb ecx, ecx
and ecx, 8
push ecx
push 0x4f17
push ebp
call dword [sym.imp.USER32.dll_CheckMenuItem]
mov edx, dword [edi + 0x24]
mov ebx, dword [sym.imp.USER32.dll_SendMessageA]
push 0
push 0
push 0x1004
push edx
call ebx
mov esi, eax
xor eax, eax
cmp esi, eax
mov dword [esp + 0x18], esi
je 0x4227be
mov edx, dword [edi + 0x24]
lea ecx, [esp + 0x20]
push ecx
push eax
push 0x1005
push edx
mov dword [esp + 0x30], 4
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
call ebx
mov ecx, dword [esp + 0x40]
neg eax
sbb eax, eax
xor ebp, ebp
and eax, ecx
test esi, esi
mov eax, dword [eax + 0xc]
mov dword [esp + 0x14], eax
jle 0x4227ba
cmp ebp, 0xffffffff
mov eax, ebp
jne 0x422735
mov ecx, dword [edi + 0x24]
push 2
push ebp
push 0x100c
push ecx
call ebx
lea edx, [esp + 0x20]
mov dword [esp + 0x24], eax
mov eax, dword [edi + 0x24]
push edx
push 0
push 0x1005
push eax
mov dword [esp + 0x30], 4
mov dword [esp + 0x38], 0
call ebx
mov edx, dword [esp + 0x40]
mov esi, eax
neg esi
sbb esi, esi
and esi, edx
mov eax, dword [esi + 0xc]
test eax, eax
je 0x4227ad
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x422795
cmp eax, ecx
je 0x422795
mov ecx, dword [esp + 0x10]
push 0
push 0
push 0x800
push ecx
call dword [sym.imp.USER32.dll_AppendMenuA]
mov edx, dword [esi + 0xc]
mov dword [esp + 0x14], edx
mov ecx, dword [esp + 0x10]
lea eax, [ebp + 0x7594]
push esi
push eax
push 0x100
push ecx
call dword [sym.imp.USER32.dll_AppendMenuA]
mov eax, dword [esp + 0x18]
inc ebp
cmp ebp, eax
jl 0x422720
mov ebp, dword [esp + 0x10]
mov edx, dword [edi + 8]
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x4c]
push 0
push edx
push 0
push eax
push ecx
push 0
push ebp
call dword [sym.imp.USER32.dll_TrackPopupMenu]
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.USER32.dll_DestroyMenu]
mov eax, dword [edi + 0xc0]
xor esi, esi
cmp eax, esi
je 0x422837
mov eax, dword [edi + 0xb8]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [edi + 0xc0]
push 0xbb8
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x42281e
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
mov edx, dword [edi + 0xc0]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
mov dword [edi + 0xc0], esi
cmp eax, esi
jne 0x422864
mov eax, dword [edi + 0xb8]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
lea ecx, [esp + 0x4c]
mov dword [edi + 0x42c], esi
push ecx
push esi
push edi
push 0x40a3a0
push esi
push esi
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [edi + 0xc0], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret 8