Function at 0x49f580
Capabilities:
Get keyboard layout

Disassembly:
sub esp, 0x20
mov dh, byte [esp + 0x28]
mov eax, ecx
push ebx
push ebp
push esi
push edi
xor esi, esi
mov dword [esp + 0x2c], eax
xor edi, edi
mov dword [esp + 0x18], esi
xor ecx, ecx
mov dword [esp + 0x24], edi
mov word [esp + 0x1e], cx
test dh, dh
je 0x49f5b1
cmp byte [eax + 0x45], cl
je 0x49f5b1
mov dl, 1
jmp 0x49f5b3
xor dl, dl
mov ebx, dword [esp + 0x34]
lea ecx, [eax + 0x54]
mov dword [esp + 0x28], ecx
mov ebp, ebx
lea ecx, [eax + 0x154]
mov byte [esp + 0x11], dl
mov dword [esp + 0x20], ecx
cmp word [ebx], si
je 0x49f922
mov bh, byte [esp + 0x3c]
mov bl, byte [esp + 0x38]
nop
xor eax, eax
mov word [esp + 0x1c], ax
movzx ecx, word [ebp]
mov eax, ecx
sub eax, 0x7b
je 0x49f636
sub eax, 2
je 0x49f66a
test dl, dl
je 0x49f602
inc edi
mov dword [esp + 0x24], edi
jmp 0x49f66a
push 0
mov word [esp + 0x20], cx
mov byte [esp + 0x40], 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push 1
push 1
lea eax, [esp + 0x48]
push eax
lea eax, [esp + 0x2c]
push eax
call fcn.00443470
add esp, 0x14
mov byte [esp + 0x14], al
xor bl, bl
jmp 0x49f7ee
lea esi, [ebp + 2]
push 0x7d
push esi
call sub.VCRUNTIME140.dll_wcschr
mov edi, eax
add esp, 8
test edi, edi
je 0x49f65e
mov ecx, edi
sub ecx, ebp
sar ecx, 1
sub ecx, 1
jne 0x49f6d2
add edi, 2
cmp word [edi], 0x7d
je 0x49f6d7
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x18]
mov dl, byte [esp + 0x11]
add ebp, 2
cmp word [ebp], 0
jne 0x49f5e0
mov ebx, dword [esp + 0x34]
test edi, edi
je 0x49f91a
mov esi, dword [esp + 0x2c]
mov eax, dword [esi + 0x1c]
cmp edi, eax
jbe 0x49f89d
test eax, eax
je 0x49f6a3
push dword [esi + 0x18]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
lea eax, [edi*2 + 2]
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov dword [esi + 0x18], eax
test eax, eax
jne 0x49f89a
push eax
call fcn.004654c0
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 0x10
cmp ecx, 1
jne 0x49f6f9
mov dl, byte [esp + 0x11]
test dl, dl
je 0x49f6f1
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x18]
inc edi
mov dword [esp + 0x24], edi
jmp 0x49f66a
mov ax, word [esi]
mov word [esp + 0x1c], ax
xor eax, eax
mov word [edi], ax
push eax
mov byte [esp + 0x16], al
mov byte [esp + 0x40], al
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
push 1
push 1
lea eax, [esp + 0x48]
push eax
push esi
call fcn.00443470
add esp, 0x14
mov byte [esp + 0x14], al
test al, al
je 0x49f7c7
movzx eax, word [esi]
mov esi, eax
test eax, 0xffffff80
je 0x49f73c
xor eax, eax
jmp 0x49f746
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_islower]
add esp, 4
mov ecx, esi
and ecx, 0xffdf
test eax, eax
movzx edx, cx
mov ecx, esi
cmove edx, ecx
cmp dx, 0x56
jne 0x49f799
movzx eax, word [ebp + 4]
mov esi, eax
test eax, 0xffffff80
je 0x49f76f
xor eax, eax
jmp 0x49f779
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_islower]
add esp, 4
mov ecx, esi
and ecx, 0xffdf
test eax, eax
movzx edx, cx
mov ecx, esi
cmove edx, ecx
cmp dx, 0x4b
jne 0x49f799
mov esi, dword [esp + 0x18]
mov bl, 1
jmp 0x49f7dc
push 1
push dword [esp + 0x18]
xor bl, bl
call fcn.00443f60
movzx esi, ax
add esp, 8
mov dword [esp + 0x18], esi
test si, si
je 0x49f7dc
xor esi, 0x100
xor al, al
mov dword [esp + 0x18], esi
mov byte [esp + 0x14], al
jmp 0x49f7e0
lea eax, [esp + 0x12]
push eax
push esi
call fcn.00443130
movzx esi, ax
add esp, 8
mov dword [esp + 0x18], esi
mov al, byte [esp + 0x14]
mov ecx, 0x7d
mov ebp, edi
mov word [edi], cx
mov edi, dword [esp + 0x24]
test al, al
je 0x49f828
cmp word [esp + 0x1c], 0
je 0x49f856
cmp byte [esp + 0x38], 0
je 0x49f856
push dword [esp + 0x1c]
call dword [sym.imp.USER32.dll_IsCharAlphaW]
test eax, eax
jne 0x49f852
movzx eax, byte [esp + 0x14]
mov ecx, dword [esp + 0x28]
add ecx, eax
mov al, byte [esp + 0x3c]
and al, 0x30
neg al
sbb al, al
add al, 2
or byte [ecx], al
mov edx, dword [esp + 0x20]
test si, si
jne 0x49f83c
cmp byte [esp + 0x12], 0
je 0x49f666
movzx ecx, si
mov al, bh
not al
and al, byte [ecx + edx]
or al, byte [esp + 0x40]
mov byte [ecx + edx], al
jmp 0x49f666
mov al, byte [esp + 0x14]
mov ecx, dword [esp + 0x28]
movzx eax, al
add ecx, eax
mov al, bh
not al
mov byte [esp + 0x13], al
and al, byte [ecx]
or al, byte [esp + 0x40]
mov byte [ecx], al
test bh, bh
je 0x49f828
test bl, bl
jne 0x49f828
push 0
push dword [esp + 0x18]
call fcn.00443f60
mov edx, dword [esp + 0x28]
add esp, 8
movzx eax, ax
test ax, ax
je 0x49f82c
mov cl, byte [esp + 0x13]
and byte [eax + edx], cl
jmp 0x49f82c
mov dword [esi + 0x1c], edi
movzx eax, word [ebx]
mov esi, dword [esi + 0x18]
test ax, ax
je 0x49f906
mov ecx, eax
nop word [eax + eax]
movzx eax, cx
sub eax, 0x7b
je 0x49f8c5
sub eax, 2
je 0x49f8f8
mov word [esi], cx
add esi, 2
jmp 0x49f8f8
lea edi, [ebx + 2]
push 0x7d
push edi
call sub.VCRUNTIME140.dll_wcschr
add esp, 8
test eax, eax
je 0x49f8f8
cmp eax, edi
jne 0x49f8e6
cmp word [eax + 2], 0x7d
lea ecx, [eax + 2]
cmove eax, ecx
lea ecx, [ebx + 4]
cmp eax, ecx
jne 0x49f8f6
mov cx, word [edi]
mov word [esi], cx
add esi, 2
mov ebx, eax
movzx eax, word [ebx + 2]
add ebx, 2
mov ecx, eax
test ax, ax
jne 0x49f8b0
xor eax, eax
pop edi
mov word [esi], ax
mov eax, 1
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 0x10
mov eax, dword [esp + 0x2c]
mov dh, byte [esp + 0x38]
test dh, dh
je 0x49f948
cmp dword [eax + 0x1c], 0
je 0x49f941
mov eax, dword [eax + 0x18]
xor ecx, ecx
pop edi
pop esi
pop ebp
mov word [eax], cx
lea eax, [ecx + 1]
pop ebx
add esp, 0x20
ret 0x10
mov dword [eax + 0x18], 0x4f5b70
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x20
ret 0x10