Function at 0x4f004440
Capabilities:
Get keyboard layout
Get system information on windows
Get thread local storage value
Set thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x4f01a01c]
xor eax, ebp
mov dword [ebp - 4], eax
sub edx, 0
je 0x4f004506
sub edx, 1
je 0x4f00447e
sub edx, 2
je 0x4f00454d
mov eax, 1
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.4f0051a0
mov esp, ebp
pop ebp
ret 4
test ecx, ecx
je 0x4f004488
mov dword [0x4f01a5a4], ecx
cmp byte [0x4f01a5a0], 0
jne 0x4f0044ee
push 0x4f01a5c0
call dword [sym.imp.ntdll.dll_RtlInitializeCriticalSection]
test eax, eax
js 0x4f006e8c
push 0
push 0x2c
lea eax, [ebp - 0x30]
push eax
push 0
call dword [sym.imp.ntdll.dll_NtQuerySystemInformation]
test eax, eax
js 0x4f006e8c
push 4
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 0
push eax
push 0xb
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessMitigationPolicy]
test eax, eax
je 0x4f0044e7
mov eax, dword [ebp - 0x34]
and eax, 0xf
mov dword [0x4f01ac20], eax
mov byte [0x4f01a5a0], 1
push 0x19650412
call dword [sym.imp.USER32.dll_User32InitializeImmEntryTable]
test eax, eax
jne 0x4f004469
jmp 0x4f006e8c
cmp byte [0x4f01a5a0], 0
je 0x4f004469
push 0x4f01a5c0
call dword [sym.imp.ntdll.dll_RtlEnterCriticalSection]
cmp dword [0x4f01a034], 0xffffffff
jne 0x4f0046c2
push 0x4f01a5c0
call dword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
push 0x4f01a5c0
call dword [sym.imp.ntdll.dll_RtlDeleteCriticalSection]
mov byte [0x4f01a5a0], 0
jmp 0x4f004469
mov eax, dword [0x4f01a034]
push esi
cmp eax, 0xffffffff
je 0x4f004569
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x4f006d14
mov ecx, dword [0x4f01ac28]
mov eax, ecx
or eax, dword [0x4f01ac2c]
je 0x4f0046bc
test byte [ecx], 4
je 0x4f0046bc
mov ecx, dword fs:[0x18]
mov eax, dword [ecx + 0xfdc]
test eax, eax
jns 0x4f004599
add ecx, eax
mov eax, dword [ecx + 0x78]
or eax, dword [ecx + 0x7c]
je 0x4f0046bc
push ebx
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push 4
mov dword [ebp - 0x38], eax
call dword [sym.imp.win32u.dll_NtUserGetThreadState]
mov edx, dword [0x4f01ac28]
mov ebx, eax
mov ecx, edx
or ecx, dword [0x4f01ac2c]
je 0x4f0046bb
test byte [edx], 4
je 0x4f0046bb
test ebx, ebx
je 0x4f0046bb
mov ecx, dword fs:[0x18]
mov eax, dword [ecx + 0xfdc]
test eax, eax
jns 0x4f0045f3
add ecx, eax
mov eax, dword [0x4f01ac28]
xor esi, esi
push edi
movzx edx, bx
cmp esi, dword [eax + 0xc]
jb 0x4f004612
ja 0x4f006d55
cmp edx, dword [eax + 8]
jae 0x4f006d55
mov eax, dword [0x4f01a9f0]
imul eax, edx
add eax, dword [0x4f01a9e8]
cdq
mov esi, eax
mov dword [ebp - 0x3c], edx
mov eax, ebx
shr eax, 0x10
cmp ax, word [esi + 0x1a]
jne 0x4f006d3e
test byte [esi + 0x19], 1
jne 0x4f006d55
cmp byte [esi + 0x18], 0x11
jne 0x4f006d55
mov edx, dword [ecx + 0x820]
mov eax, edx
or eax, dword [ecx + 0x824]
je 0x4f006d62
mov eax, dword [esi + 0x10]
cmp eax, dword [edx]
jne 0x4f006d62
mov eax, dword [esi + 0x14]
cmp eax, dword [edx + 4]
jne 0x4f006d62
mov edi, dword [ecx + 0x828]
add edi, dword [esi]
mov eax, dword [ecx + 0x82c]
adc eax, dword [esi + 4]
mov ecx, edi
or ecx, eax
je 0x4f006d55
mov eax, dword [edi]
mov ecx, dword [0x4f01a9e8]
movzx eax, ax
imul eax, dword [0x4f01a9f0]
mov esi, dword [eax + ecx + 8]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp esi, eax
jne 0x4f0046ba
mov edi, dword [edi + 0x18]
test edi, edi
jne 0x4f006d74
pop edi
pop ebx
pop esi
jmp 0x4f004469
call fcn.4f002675
push dword [0x4f01a034]
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x4f01a034], 0xffffffff
jmp 0x4f00452b
push 0
push dword [0x4f01a034]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x4f004569
push esi
push 0
push dword [0x4f01a9dc]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4f004569
test ax, ax
je 0x4f004635
mov edx, 0xffff
cmp ax, dx
je 0x4f004635
push 6
call dword [sym.imp.ntdll.dll_RtlSetLastWin32Error]
jmp 0x4f0046ba
push 0x38
push ebx
call dword [sym.imp.win32u.dll_NtUserCallOneParam]
mov edi, eax
xor eax, eax
jmp 0x4f004685
test byte [edi + 8], 0x40
jne 0x4f0046ba
lea eax, [edi + 4]
mov dword [ebp - 0x34], eax
lock inc dword [eax]
mov ecx, dword [edi]
test ecx, ecx
je 0x4f006e7a
push ecx
call dword [sym.imp.KERNEL32.dll_LocalLock]
mov esi, eax
mov dword [ebp - 0x3c], esi
test esi, esi
jne 0x4f006dac
mov eax, dword [ebp - 0x34]
lock dec dword [eax]
jmp 0x4f0046ba
mov ecx, ebx
call fcn.4f017f23
mov eax, dword [ebp - 0x38]
cmp dword [edi + 0x2c], eax
jne 0x4f006e13
push eax
call sym.IMM32.dll_ImmLockImeDpi
mov dword [ebp - 0x34], eax
test eax, eax
je 0x4f006e0c
test byte [eax + 0x50], 4
jne 0x4f006de3
mov esi, dword [eax + 0x7c]
mov ecx, esi
push 0
push ebx
call dword [0x4f01b2cc]
call esi
mov esi, dword [ebp - 0x3c]
jmp 0x4f006e04
mov ecx, dword [0x4f01ac28]
mov eax, ecx
or eax, dword [0x4f01ac2c]
je 0x4f006e04
test byte [ecx], 4
je 0x4f006e04
push dword [ebp - 0x38]
push 0
push ebx
call dword [sym.imp.MSCTF.dll_CtfImeSelectEx]
push dword [ebp - 0x34]
call sym.IMM32.dll_ImmUnlockImeDpi
mov dword [edi + 0x2c], 0
mov eax, dword [esi + 0x124]
test eax, eax
je 0x4f006e24
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esi + 0x12c]
test eax, eax
je 0x4f006e35
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esi + 0x120]
test eax, eax
je 0x4f006e46
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esi + 0x11c]
test eax, eax
je 0x4f006e57
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esi + 0x118]
test eax, eax
je 0x4f006e68
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov ecx, esi
call fcn.4f0073b0
push dword [edi]
call dword [sym.imp.KERNEL32.dll_LocalUnlock]
lea eax, [edi + 4]
or dword [edi + 8], 0x40
lock dec dword [eax]
push edi
call sym.IMM32.dll_ImmUnlockClientImc
jmp 0x4f0046ba
xor eax, eax
jmp 0x4f00446e