Function at 0x50c680
Capabilities:
Check os version
Get keyboard layout

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x158
test eax, eax
push ebx
mov ebx, ecx
jne 0x50c69d
xor al, al
pop ebx
add esp, 0x158
ret 4
mov dword [ebx + 0x58], eax
lea eax, [esp + 0x10]
push eax
mov dword [esp + 0x14], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
cmp ecx, 1
jne 0x50c6ce
cmp eax, 4
ja 0x50c6de
jne 0x50c6ce
cmp dword [esp + 0x18], 0xa
jae 0x50c6de
cmp ecx, 2
jne 0x50c6da
cmp eax, 4
ja 0x50c6de
je 0x50c6de
xor eax, eax
jmp 0x50c6e3
mov eax, 1
mov byte [ebx + 0x7e], al
call sub.IMM32.dll_ImmCreateContext
test eax, eax
mov dword [ebx + 0x60], eax
jne 0x50c6fe
xor al, al
pop ebx
add esp, 0x158
ret 4
mov ecx, dword [ebx + 0x58]
push ebp
push esi
push edi
push eax
push ecx
call sub.IMM32.dll_ImmAssociateContext
push 0
mov dword [ebx + 0x5c], eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
mov ecx, ebx
call fcn.0050d420
lea ecx, [esp + 0xb0]
call fcn.00511410
mov esi, dword [ebx + 0xb80]
add ebx, 0xb7c
test esi, esi
mov dword [esp + 0x14], eax
je 0x50c765
mov ebp, dword [ebx + 8]
mov eax, 0xb21642c9
mov ecx, ebp
sub ecx, esi
imul ecx
add edx, ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, 0x20
jae 0x50c98c
test esi, esi
jne 0x50c769
xor edx, edx
jmp 0x50c781
mov ecx, dword [ebx + 8]
mov eax, 0xb21642c9
sub ecx, esi
imul ecx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
mov ecx, dword [ebx + 8]
mov edi, dword [ebx + 0xc]
mov esi, 0x20
sub edi, ecx
mov eax, 0xb21642c9
sub esi, edx
imul edi
add edx, edi
mov ebp, ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, esi
jae 0x50c888
mov eax, dword [ebx + 4]
test eax, eax
je 0x50c7d8
sub ecx, eax
mov eax, 0xb21642c9
imul ecx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
cmp esi, edx
jae 0x50c7d8
mov ecx, ebx
call fcn.0050f1c0
mov edi, eax
jmp 0x50c7da
mov edi, esi
mov ecx, ebx
call fcn.0050f1c0
add eax, edi
mov dword [esp + 0x18], eax
jns 0x50c7eb
xor eax, eax
lea edx, [eax + eax*2]
shl edx, 3
sub edx, eax
shl edx, 3
push edx
call fcn.00672b70
add esp, 4
mov edi, eax
mov eax, dword [ebx + 4]
mov ecx, ebx
push edi
push ebp
push eax
call fcn.0050f220
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x10], eax
push ecx
push esi
push eax
mov ecx, ebx
call fcn.0050f510
mov eax, dword [esp + 0x10]
lea edx, [esi + esi*2]
shl edx, 3
sub edx, esi
lea ecx, [eax + edx*8]
mov edx, dword [ebx + 8]
push ecx
push edx
push ebp
mov ecx, ebx
call fcn.0050f220
mov eax, dword [ebx + 8]
mov ecx, dword [ebx + 4]
push eax
push ecx
mov ecx, ebx
call fcn.0050f1f0
mov edx, dword [ebx + 4]
push edx
call fcn.00672c80
mov eax, dword [esp + 0x1c]
add esp, 4
lea ecx, [eax + eax*2]
shl ecx, 3
sub ecx, eax
lea edx, [edi + ecx*8]
mov ecx, ebx
mov dword [ebx + 0xc], edx
call fcn.0050f1c0
add eax, esi
mov dword [ebx + 4], edi
lea ecx, [eax + eax*2]
shl ecx, 3
sub ecx, eax
lea edx, [edi + ecx*8]
mov dword [ebx + 8], edx
jmp 0x50c9dd
mov edi, ecx
mov eax, 0xb21642c9
sub edi, ebp
imul edi
add edx, edi
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, esi
jae 0x50c914
lea edi, [esi + esi*2]
shl edi, 3
sub edi, esi
shl edi, 3
mov dword [esp + 0x10], edi
lea edx, [edi + ebp]
push edx
push ecx
push ebp
mov ecx, ebx
call fcn.0050f220
mov eax, dword [esp + 0x14]
mov ecx, dword [ebx + 8]
push eax
sub ecx, ebp
mov eax, 0xb21642c9
imul ecx
add edx, ecx
mov eax, dword [ebx + 8]
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
mov ecx, ebx
sub esi, edx
push esi
push eax
call fcn.0050f510
mov eax, dword [ebx + 8]
cmp ebp, eax
je 0x50c90c
mov esi, dword [esp + 0x14]
mov edi, ebp
add ebp, 0xb8
mov ecx, 0x2e
cmp ebp, eax
rep movsd dword es:[edi], dword [esi]
jne 0x50c8f1
mov edi, dword [esp + 0x10]
add dword [ebx + 8], edi
jmp 0x50c9dd
test esi, esi
jbe 0x50c9dd
lea edi, [esi + esi*2]
push ecx
shl edi, 3
sub edi, esi
push ecx
shl edi, 3
sub ecx, edi
mov dword [esp + 0x18], edi
push ecx
mov ecx, ebx
call fcn.0050f220
mov edx, dword [ebx + 8]
mov eax, edx
sub eax, edi
cmp ebp, eax
je 0x50c960
sub eax, 0xb8
sub edx, 0xb8
mov ecx, 0x2e
mov esi, eax
mov edi, edx
cmp eax, ebp
rep movsd dword es:[edi], dword [esi]
jne 0x50c942
mov edi, dword [esp + 0x10]
lea eax, [edi + ebp]
cmp ebp, eax
je 0x50c90c
mov esi, dword [esp + 0x14]
mov edi, ebp
add ebp, 0xb8
mov ecx, 0x2e
cmp ebp, eax
rep movsd dword es:[edi], dword [esi]
jne 0x50c967
mov edi, dword [esp + 0x10]
mov eax, dword [ebx + 8]
add eax, edi
mov dword [ebx + 8], eax
jmp 0x50c9dd
jbe 0x50c9dd
mov eax, ebp
lea edx, [esi + 0x1700]
cmp eax, ebp
mov dword [esp + 0x10], edx
je 0x50c9bc
mov esi, eax
mov edi, edx
add eax, 0xb8
mov ecx, 0x2e
add edx, 0xb8
cmp eax, ebp
rep movsd dword es:[edi], dword [esi]
jne 0x50c99e
mov dword [esp + 0x10], edx
mov edi, dword [ebx + 8]
mov esi, edx
cmp edx, edi
je 0x50c9da
mov ecx, esi
call fcn.00511430
add esi, 0xb8
cmp esi, edi
jne 0x50c9c5
mov edx, dword [esp + 0x10]
mov dword [ebx + 8], edx
lea ecx, [esp + 0xb0]
call fcn.00511430
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x158
ret 4