Function at 0x140065500
Capabilities:
Get keyboard layout

Disassembly:
mov byte [rsp + 0x20], r9b
mov byte [rsp + 0x18], r8b
mov qword [rsp + 0x10], rdx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x48
mov r13, rcx
movzx esi, r9b
xor ecx, ecx
movzx edi, r8b
mov word [rsp + 0x36], cx
movzx ebp, cx
mov r12d, ecx
test r8b, r8b
je 0x140065546
cmp byte [r13 + 0x65], cl
je 0x140065546
mov bl, 1
jmp 0x140065548
xor bl, bl
mov r15, rdx
mov byte [rsp + 0x90], bl
cmp word [rdx], cx
je 0x140065a07
movzx r14d, byte [rsp + 0xa0]
mov edx, 0x7d
nop dword [rax]
mov word [rsp + 0x34], cx
movzx eax, word [r15]
cmp ax, 0x7b
je 0x14006578e
cmp ax, 0x7d
je 0x1400656fd
test bl, bl
je 0x140065599
inc r12d
jmp 0x1400656fd
xor ecx, ecx
mov word [rsp + 0x34], ax
mov byte [rsp + 0x30], 0
call qword [sym.imp.USER32.dll_GetKeyboardLayout]
mov r8, rax
movzx eax, word [rsp + 0x34]
test ax, ax
je 0x1400656c1
movzx ecx, word [rsp + 0x36]
test cx, cx
jne 0x1400655de
mov r9b, 1
lea rdx, [rsp + 0x30]
movzx ecx, ax
call fcn.1400241b0
movzx ebx, al
jmp 0x1400658e0
mov ebx, eax
test eax, 0xffffff80
je 0x1400655ef
xor r8d, r8d
mov edx, r8d
jmp 0x140065606
mov edx, 2
mov ecx, ebx
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__isctype]
movzx ecx, word [rsp + 0x36]
xor r8d, r8d
mov edx, eax
movzx eax, bx
mov r9d, 0xffdf
and ax, r9w
test edx, edx
cmove ax, bx
cmp ax, 0x56
jne 0x140065685
movzx ebx, cx
test ebx, 0xffffff80
je 0x14006562f
mov ecx, r8d
jmp 0x140065641
mov edx, 2
mov ecx, ebx
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__isctype]
mov ecx, eax
xor r8d, r8d
movzx eax, bx
mov edx, 0xffdf
and ax, dx
test ecx, ecx
cmove ax, bx
cmp ax, 0x4b
jne 0x140065685
mov r8d, reloc.WSOCK32.dll_recv
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x38]
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_wcstol]
xor ecx, ecx
mov ebx, ecx
movzx ecx, al
mov rax, qword [rsp + 0x38]
cmp word [rax], bx
cmove ebx, ecx
jmp 0x1400658e0
mov rdi, r8
lea rbx, str.Numpad0
nop
mov rcx, qword [rbx]
lea rdx, [rsp + 0x34]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
test eax, eax
je 0x14006577a
inc rdi
lea rax, [0x1401249c0]
add rbx, 0x10
cmp rbx, rax
jl 0x140065690
movzx ebx, byte [rsp + 0x90]
movzx edx, byte [rsp + 0xb0]
test bp, bp
jne 0x1400656d5
cmp byte [rsp + 0x31], bpl
je 0x1400656f0
movzx ecx, bp
movzx eax, sil
not al
and al, byte [rcx + r13 + 0x174]
or al, dl
mov byte [rcx + r13 + 0x174], al
movzx edi, byte [rsp + 0xa0]
xor ecx, ecx
lea edx, [rcx + 0x7d]
movzx esi, byte [rsp + 0xa8]
add r15, 2
cmp word [r15], 0
jne 0x140065570
mov r14, qword [rsp + 0x98]
test r12d, r12d
je 0x140065a07
mov eax, dword [r13 + 0x30]
cmp r12d, eax
jbe 0x140065988
test eax, eax
je 0x140065740
mov rcx, qword [r13 + 0x28]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea ecx, [r12*2 + 2]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [r13 + 0x28], rax
test rax, rax
jne 0x140065984
lea r8, [0x1400ef7e4]
lea rdx, str.Out_of_memory.
lea rcx, [0x14012afc0]
call fcn.14005fed0
jmp 0x140065a2c
add rdi, rdi
lea rax, str.Numpad0
movzx ebx, byte [rax + rdi*8 + 8]
jmp 0x1400658d8
lea rcx, [r15 + 2]
call qword [sym.imp.VCRUNTIME140.dll_wcschr]
mov rsi, rax
test rax, rax
je 0x1400656f0
sub rax, r15
sar rax, 1
sub rax, 1
jne 0x1400657c0
add rsi, 2
cmp word [rsi], 0x7d
jne 0x1400656f0
jmp 0x1400657c6
cmp rax, 1
jne 0x1400657dc
test bl, bl
je 0x1400657d2
inc r12d
jmp 0x1400656f0
movzx eax, word [r15 + 2]
mov word [rsp + 0x34], ax
xor ecx, ecx
mov word [rsi], cx
mov byte [rsp + 0x31], cl
mov byte [rsp + 0x30], cl
call qword [sym.imp.USER32.dll_GetKeyboardLayout]
mov r8b, 1
lea rdx, [rsp + 0x30]
lea rcx, [r15 + 2]
mov qword [rsp + 0x20], rax
call fcn.140024050
movzx ebx, al
test al, al
je 0x1400658b2
movzx edi, word [r15 + 2]
test edi, 0xffffff80
je 0x140065823
xor edx, edx
mov ecx, edx
jmp 0x140065834
mov edx, 2
mov ecx, edi
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__isctype]
mov ecx, eax
xor edx, edx
movzx eax, di
mov r14d, 0xffdf
and ax, r14w
test ecx, ecx
cmove ax, di
cmp ax, 0x56
jne 0x140065885
movzx edi, word [r15 + 4]
test edi, 0xffffff80
je 0x14006585e
mov ecx, edx
jmp 0x14006586d
mov edx, 2
mov ecx, edi
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__isctype]
mov ecx, eax
movzx eax, di
and ax, r14w
test ecx, ecx
cmove ax, di
cmp ax, 0x4b
jne 0x140065885
mov r14b, 1
jmp 0x140065888
xor r14b, r14b
cmp qword [r13 + 0x10], 0
je 0x1400658c3
test r14b, r14b
jne 0x1400658c3
mov dl, 1
movzx ecx, bl
call fcn.140024e60
movzx ebp, ax
test ax, ax
je 0x1400658c3
mov eax, 0x100
xor bp, ax
xor bl, bl
jmp 0x1400658c3
lea rdx, [rsp + 0x31]
lea rcx, [r15 + 2]
call fcn.140023f30
movzx ebp, ax
mov r15d, 0x7d
mov word [rsi], r15w
mov r15, rsi
movzx esi, byte [rsp + 0xa8]
movzx edi, byte [rsp + 0xa0]
test bl, bl
je 0x1400656b9
movzx ecx, word [rsp + 0x34]
test cx, cx
je 0x140065918
test dil, dil
je 0x140065918
call qword [sym.imp.USER32.dll_IsCharAlphaW]
test eax, eax
jne 0x140065918
test byte [rsp + 0x30], 0x30
movzx ecx, bl
sete al
inc al
or byte [rcx + r13 + 0x74], al
jmp 0x1400656b9
movzx edx, byte [rsp + 0xb0]
movzx edi, sil
movzx ecx, bl
not dil
movzx eax, dil
and al, byte [rcx + r13 + 0x74]
or al, dl
mov byte [rcx + r13 + 0x74], al
test sil, sil
je 0x140065977
test r14b, r14b
jne 0x140065977
xor edx, edx
movzx ecx, bl
call fcn.140024e60
movzx ebx, byte [rsp + 0x90]
movzx edx, byte [rsp + 0xb0]
test ax, ax
je 0x1400656c9
movzx eax, ax
and byte [rax + r13 + 0x174], dil
jmp 0x1400656c9
movzx ebx, byte [rsp + 0x90]
jmp 0x1400656c9
mov dword [r13 + 0x30], r12d
movzx eax, word [r14]
mov rbx, qword [r13 + 0x28]
test ax, ax
je 0x140065a00
mov r15d, 0x7d
nop dword [rax + rax]
cmp ax, 0x7b
je 0x1400659b5
cmp ax, r15w
je 0x1400659f2
mov word [rbx], ax
add rbx, 2
jmp 0x1400659f2
lea rdi, [r14 + 2]
mov edx, r15d
mov rcx, rdi
call qword [sym.imp.VCRUNTIME140.dll_wcschr]
test rax, rax
je 0x1400659f2
cmp rax, rdi
jne 0x1400659dc
cmp word [rax + 2], r15w
lea rcx, [rax + 2]
cmove rax, rcx
lea rcx, [r14 + 4]
cmp rax, rcx
jne 0x1400659ef
movzx ecx, word [rdi]
mov word [rbx], cx
add rbx, 2
mov r14, rax
movzx eax, word [r14 + 2]
add r14, 2
test ax, ax
jne 0x1400659a0
xor ecx, ecx
mov word [rbx], cx
jmp 0x140065a27
test dil, dil
je 0x140065a27
cmp dword [r13 + 0x30], 0
je 0x140065a1c
mov rax, qword [r13 + 0x28]
mov word [rax], cx
jmp 0x140065a27
lea rax, [0x1400ef7e4]
mov qword [r13 + 0x28], rax
mov eax, 1
add rsp, 0x48
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret