Function at 0x50cd50
Capabilities:
Set global application hook

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc
push ebx
push esi
mov esi, dword [ebp + 8]
cmp esi, 0x4a
push edi
mov ebx, ecx
ja 0x50cfb2
je 0x50cf06
lea eax, [esi - 2]
cmp eax, 0x22
ja case.0x50cd83.3
movzx eax, byte [eax + 0x50d204]
jmp dword [eax*4 + 0x50d1e4]
mov edi, ebx
call fcn.0050cd10
jmp case.0x50cd83.3
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x50cda6
mov eax, ebx
call fcn.0050d2d0
jmp 0x50cdaf
cmp eax, 1
je case.0x50cd83.3
cmp byte [ebx + 0x2c], 0
jne case.0x50cd83.3
mov eax, dword [ebp + 0x10]
mov edx, dword [ebx + 0x3e]
mov edx, dword [edx]
mov edi, eax
lea ecx, [ebx + 0x3e]
shr edi, 0x10
movzx eax, ax
push edi
push eax
call edx
jmp case.0x50cd83.3
mov eax, dword [ebx + 0x3e]
mov eax, dword [eax + 4]
lea edx, [esp + 0x10]
lea ecx, [ebx + 0x3e]
push edx
lea edx, [esp + 0x18]
push edx
call eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [esp + 0x14]
mov edx, dword [eax + 0x20]
cmp ecx, edx
mov edi, dword [esp + 0x10]
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], edi
jg 0x50ce04
mov ecx, edx
mov dword [eax + 0x20], ecx
mov ecx, dword [eax + 0x24]
cmp edi, ecx
jle 0x50ce10
mov ecx, edi
mov dword [eax + 0x24], ecx
jmp case.0x50cd83.3
cmp byte [ebx + 0x13b], 0
jne 0x50d1d5
mov esi, ebx
call fcn.0050c6a0
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push ebx
call fcn.0050d3b0
call fcn.004a8740
mov edx, dword [ebx]
mov eax, dword [edx + 0x28]
push str.MainWindow
mov ecx, ebx
mov dword [0x735b84], 3
call eax
lea edi, [ebx + 0x13b]
call fcn.004a0f20
push 0
call dword [sym.imp.USER32.dll_PostQuitMessage]
jmp case.0x50cd83.3
cmp dword [ebp + 0xc], 0
je 0x50ce93
mov byte [ebx + 0x13b], 1
mov byte [ebx + 0x13d], 1
mov ecx, dword [ebx + 4]
push ecx
call dword [sym.imp.USER32.dll_DestroyWindow]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
call fcn.00401510
test al, al
je case.0x50cd83.3
call fcn.00422fc0
test al, al
je 0x50ced8
mov eax, dword [ebx + 0x2141]
test eax, eax
je case.0x50cd83.3
push eax
call dword [sym.imp.USER32.dll_UnhookWindowsHookEx]
mov dword [ebx + 0x2141], 0
jmp case.0x50cd83.3
cmp dword [ebx + 0x2141], 0
jne case.0x50cd83.3
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push 0
push 0x50d4d0
push 3
call dword [sym.imp.USER32.dll_SetWindowsHookExW]
mov dword [ebx + 0x2141], eax
jmp case.0x50cd83.3
mov eax, dword [ebp + 0x10]
cmp dword [eax + 4], 0x10404
jne 0x50cff1
mov eax, dword [eax + 8]
mov esi, dword [eax]
test esi, esi
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], esi
je 0x50cff1
xor ecx, ecx
mov eax, esi
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0069c0de
add esp, 4
xor edi, edi
test esi, esi
mov dword [esp + 0x14], eax
jle 0x50cf8f
mov eax, dword [esp + 0xc]
add eax, 4
mov dword [esp + 0xc], eax
push 0x208
call fcn.0069c0de
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
add esp, 4
mov esi, eax
mov dword [ecx + edi*4], eax
call fcn.004011d0
add dword [esp + 0xc], 0x208
add edi, 1
cmp edi, dword [esp + 0x10]
jl 0x50cf5b
mov esi, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
mov eax, dword [ebx + 4]
push edx
push esi
push 0x406
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp esi, 0x406
ja 0x50d0f1
je 0x50d070
mov eax, esi
sub eax, 0x110
je 0x50d064
sub eax, 1
je 0x50cffc
sub eax, 2
jne case.0x50cd83.3
mov eax, dword [ebp + 0xc]
mov esi, ebx
call fcn.0050cc80
test al, al
je 0x50d156
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp + 0x10]
mov edi, dword [ebp + 0xc]
push ecx
push edi
push 0x111
push ebx
lea eax, [ebx + 0x28]
call fcn.0051d3c0
test eax, eax
jne 0x50d1da
mov esi, dword [0x735b84]
mov eax, edi
shr eax, 0x10
movzx edx, di
push eax
mov eax, ebx
mov dword [0x735b84], edx
call fcn.0050c9f0
cmp esi, 5
jne 0x50d047
mov ecx, dword [0x735b84]
mov dword [0x735b88], ecx
mov edx, dword [ebx]
mov eax, dword [edx + 0x18]
mov ecx, ebx
mov dword [0x735b84], esi
call eax
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, ebx
call fcn.0050c8a0
jmp case.0x50cd83.3
mov esi, dword [ebp + 0x10]
test esi, esi
je 0x50d1d5
mov edi, dword [ebp + 0xc]
cmp edi, 1
mov byte [ebx + 0x4e], 1
jne 0x50d0d0
mov eax, ebx
call fcn.0050c5c0
push edi
lea edx, [ebx + 0x4a]
mov ecx, esi
call fcn.0049ba80
xor esi, esi
test edi, edi
jle 0x50d0b6
nop
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + esi*4]
push eax
call fcn.0069c8fa
add esi, 1
add esp, 4
cmp esi, edi
jl 0x50d0a0
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.0069c8fa
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp edi, 2
jne 0x50d08e
mov ecx, dword [esi + 4]
push ecx
call fcn.00556350
test al, al
je 0x50d08e
mov eax, dword [esi + 4]
mov ecx, 0x736c44
call fcn.004bff00
jmp 0x50d099
mov eax, esi
sub eax, 0x466
je 0x50d1b7
sub eax, 0x7c01
je 0x50d11f
sub eax, 7
jne case.0x50cd83.3
mov esi, ebx
call fcn.004224d0
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp byte [ebx + 0x2c], 0
jne case.0x50cd83.3
mov eax, dword [ebp + 0x10]
cmp eax, 0x205
jg 0x50d19b
je 0x50d186
cmp eax, 0x7b
je 0x50d186
cmp eax, 0x202
jne 0x50d1d5
mov eax, ebx
call fcn.0050c5c0
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov esi, dword [ebp + 8]
cmp esi, dword [ebx + 0x553]
jne 0x50d16d
push ebx
call fcn.0050d3b0
push ebx
call fcn.0050d300
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
push edx
push eax
push esi
mov ecx, ebx
call fcn.0051cb70
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edx, dword [ebx]
mov eax, dword [edx + 0x40]
call eax
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp eax, 0x405
jne 0x50d1d5
mov edx, dword [ebx]
mov eax, dword [edx + 0x44]
call eax
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ebp + 0x10], 0
jne 0x50d1cb
mov byte [ebx + 0x13b], 1
mov byte [ebx + 0x13d], 1
mov ecx, dword [ebx + 4]
push ecx
call dword [sym.imp.USER32.dll_DestroyWindow]
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc