Function at 0x405160
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x437b1a
mov eax, dword fs:[0]
push eax
sub esp, 0x168
mov eax, dword [0x442308]
xor eax, esp
mov dword [esp + 0x160], eax
push ebx
push esi
push edi
mov eax, dword [0x442308]
xor eax, esp
push eax
lea eax, [esp + 0x178]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
cmp dword [eax + 0x18], 8
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x4c], ecx
jb 0x4051b5
mov eax, dword [eax + 4]
jmp 0x4051b8
add eax, 4
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
xor edi, edi
mov ebx, 7
xor edx, edx
mov ecx, eax
mov dword [esp + 0x134], ebx
mov dword [esp + 0x130], edi
mov word [esp + 0x120], dx
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, di
jne 0x4051e3
sub ecx, esi
sar ecx, 1
push ecx
push eax
lea ecx, [esp + 0x124]
call fcn.00401820
mov dword [esp + 0x180], edi
cmp dword [esp + 0x130], edi
jne 0x405231
cmp dword [esp + 0x134], 8
jb 0x40522a
mov eax, dword [esp + 0x120]
push eax
call fcn.00423621
add esp, 4
xor eax, eax
jmp 0x405c35
xor ecx, ecx
push 0x31
mov word [esp + 0x5c], cx
push str.SystemCurrentControlSetControlKeyboard_Layouts
lea ecx, [esp + 0x5c]
mov dword [esp + 0x74], ebx
mov dword [esp + 0x70], edi
call fcn.00401820
lea edx, [esp + 0x54]
push edx
lea eax, [esp + 0x1c]
push reloc.OLEAUT32.dll_SysReAllocString
push eax
mov byte [esp + 0x18c], 1
call fcn.00404960
add esp, 0xc
mov byte [esp + 0x180], 3
cmp dword [esp + 0x6c], 8
jb 0x40528b
mov ecx, dword [esp + 0x58]
push ecx
call fcn.00423621
add esp, 4
mov esi, dword [esp + 0x24]
mov dword [esp + 0x68], edi
mov edi, dword [esp + 0x28]
xor edx, edx
mov ecx, edi
sub ecx, esi
mov word [esp + 0x58], dx
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x6c], ebx
jne 0x4052e9
lea ecx, [esp + 0x18]
call fcn.00405e70
cmp dword [esp + 0x134], 8
jb 0x40522a
mov ecx, dword [esp + 0x120]
push ecx
call fcn.00423621
add esp, 4
xor eax, eax
jmp 0x405c35
cmp esi, edi
jbe 0x4052f2
call fcn.00423d34
mov ebx, dword [esp + 0x18]
mov edi, esi
jmp 0x405300
mov esi, dword [esp + 0x28]
cmp dword [esp + 0x24], esi
jbe 0x40530f
call fcn.00423d34
test ebx, ebx
je 0x405319
cmp ebx, dword [esp + 0x18]
je 0x40531e
call fcn.00423d34
cmp edi, esi
je 0x4055ea
test ebx, ebx
jne 0x40534e
call fcn.00423d34
xor eax, eax
cmp edi, dword [eax + 0x10]
jb 0x40533b
call fcn.00423d34
cmp dword [edi + 0x18], 8
mov dword [esp + 0x50], 0
jb 0x405352
mov eax, dword [edi + 4]
jmp 0x405355
mov eax, dword [ebx]
jmp 0x405331
lea eax, [edi + 4]
lea edx, [esp + 0x50]
push edx
push 0x43c8c0
push eax
call fcn.0042416e
mov esi, dword [esp + 0x5c]
mov eax, 0x804
add esp, 0xc
cmp si, ax
jne 0x405583
mov eax, esi
shr eax, 0x10
test ax, ax
je 0x405583
mov ecx, 0x804
cmp ax, cx
je 0x405583
xor edx, edx
push edx
push 0x43c8ac
lea ecx, [esp + 0x108]
mov dword [esp + 0x120], 7
mov dword [esp + 0x11c], 0
mov word [esp + 0x10c], dx
call fcn.00401820
mov byte [esp + 0x180], 4
push 8
xor eax, eax
push str.Ime_File
lea ecx, [esp + 0x38]
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], 0
mov word [esp + 0x3c], ax
call fcn.00401820
mov byte [esp + 0x180], 5
test ebx, ebx
jne 0x405578
call fcn.00423d34
xor eax, eax
cmp edi, dword [eax + 0x10]
jb 0x405418
call fcn.00423d34
push edi
lea ecx, [esp + 0x74]
push str.SystemCurrentControlSetControlKeyboard_Layouts_
push ecx
call fcn.00406730
lea edx, [esp + 0x10c]
push edx
lea ecx, [esp + 0x40]
push ecx
push eax
lea edx, [esp + 0x150]
push reloc.OLEAUT32.dll_SysReAllocString
push edx
mov byte [esp + 0x1a0], 6
call fcn.00404810
add esp, 0x20
cmp dword [esp + 0x88], 8
jb 0x40546a
mov eax, dword [esp + 0x74]
push eax
call fcn.00423621
add esp, 4
xor ecx, ecx
mov eax, 8
mov dword [esp + 0x88], 7
mov dword [esp + 0x84], 0
mov word [esp + 0x74], cx
cmp dword [esp + 0x48], eax
jb 0x4054a4
mov edx, dword [esp + 0x34]
push edx
call fcn.00423621
add esp, 4
mov eax, 8
xor ecx, ecx
mov byte [esp + 0x180], 3
mov dword [esp + 0x48], 7
mov dword [esp + 0x44], 0
mov word [esp + 0x34], cx
cmp dword [esp + 0x118], eax
jb 0x4054e1
mov edx, dword [esp + 0x104]
push edx
call fcn.00423621
add esp, 4
mov eax, 8
mov ecx, dword [esp + 0x120]
cmp dword [esp + 0x134], eax
jae 0x4054f8
lea ecx, [esp + 0x120]
cmp dword [esp + 0x150], eax
mov eax, dword [esp + 0x13c]
jae 0x40550f
lea eax, [esp + 0x13c]
push ecx
push eax
call fcn.00424328
add esp, 8
test eax, eax
je 0x4055a4
test ebx, ebx
jne 0x40557f
call fcn.00423d34
xor eax, eax
cmp edi, dword [eax + 0x10]
jb 0x405536
call fcn.00423d34
add edi, 0x1c
cmp dword [esp + 0x150], 8
jb 0x405553
mov eax, dword [esp + 0x13c]
push eax
call fcn.00423621
add esp, 4
xor ecx, ecx
mov dword [esp + 0x150], 7
mov dword [esp + 0x14c], 0
mov word [esp + 0x13c], cx
jmp 0x405300
mov eax, dword [ebx]
jmp 0x40540e
mov eax, dword [ebx]
jmp 0x40552c
test ebx, ebx
jne 0x4055a0
call fcn.00423d34
xor eax, eax
cmp edi, dword [eax + 0x10]
jb 0x405598
call fcn.00423d34
add edi, 0x1c
jmp 0x405300
mov eax, dword [ebx]
jmp 0x40558e
cmp dword [esp + 0x150], 8
mov dword [esp + 0x14], esi
jb 0x4055c2
mov edx, dword [esp + 0x13c]
push edx
call fcn.00423621
add esp, 4
xor eax, eax
mov dword [esp + 0x150], 7
mov dword [esp + 0x14c], 0
mov word [esp + 0x13c], ax
test esi, esi
jne 0x40571e
mov edi, 0xe0200804
nop
push 0x10
push edi
lea esi, [esp + 0x94]
call fcn.00404610
sub esp, 0x14
mov ecx, esp
mov dword [esp + 0x30], esp
xor edx, edx
push 0xffffffffffffffff
mov byte [esp + 0x1a0], 7
push edx
mov dword [ecx + 0x18], 7
mov dword [ecx + 0x14], 0
push eax
mov word [ecx + 4], dx
call fcn.00401710
lea eax, [esp + 0xe8]
push eax
lea ecx, [esp + 0x38]
call fcn.00401680
lea ecx, [esp + 0xe0]
push ecx
lea ecx, [esp + 0x38]
mov esi, eax
call fcn.00401650
mov edx, dword [esi + 4]
mov ecx, dword [esi]
push edx
mov edx, dword [eax + 4]
mov eax, dword [eax]
push ecx
push edx
push eax
lea esi, [esp + 0x108]
call fcn.004067f0
add esp, 0x2c
push eax
lea ecx, [esp + 0xd8]
push ecx
lea ecx, [esp + 0x20]
call fcn.00401680
mov ecx, eax
call fcn.00401a40
lea ecx, [esp + 0x8c]
mov bl, al
mov byte [esp + 0x180], 3
call fcn.00401080
test bl, bl
jne 0x4056ac
add edi, 0x10000
jmp 0x4055f0
xor esi, esi
mov dword [esp + 0x14], edi
cmp edi, esi
jne 0x40571e
mov eax, dword [esp + 0x24]
cmp eax, esi
je 0x4056e0
mov edx, dword [esp + 0x4c]
push edx
mov edx, dword [esp + 0x2c]
lea ecx, [esp + 0x24]
push ecx
push edx
push eax
call fcn.00406b30
mov eax, dword [esp + 0x34]
push eax
call fcn.00423621
add esp, 0x14
mov ecx, dword [esp + 0x18]
push ecx
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], esi
call fcn.00423621
add esp, 4
cmp dword [esp + 0x134], 8
jb 0x40522a
mov edx, dword [esp + 0x120]
push edx
call fcn.00423621
add esp, 4
xor eax, eax
jmp 0x405c35
push 0x32
xor eax, eax
mov esi, 7
xor edi, edi
push str.SystemCurrentControlSetControlKeyboard_Layouts_
lea ecx, [esp + 0x15c]
mov dword [esp + 0x174], esi
mov dword [esp + 0x170], edi
mov word [esp + 0x160], ax
call fcn.00401820
mov ecx, dword [esp + 0x14]
push ecx
lea edx, [esp + 0x74]
push edx
mov byte [esp + 0x188], 8
call fcn.00404540
add esp, 8
push 0xffffffffffffffff
push edi
push eax
lea ecx, [esp + 0x160]
mov byte [esp + 0x18c], 9
call fcn.00401f40
mov byte [esp + 0x180], 8
cmp dword [esp + 0x88], 8
jb 0x4057a1
mov eax, dword [esp + 0x74]
push eax
call fcn.00423621
add esp, 4
xor ecx, ecx
push 8
mov word [esp + 0x108], cx
push str.Ime_File
lea ecx, [esp + 0x108]
mov dword [esp + 0x120], esi
mov dword [esp + 0x11c], edi
call fcn.00401820
lea edx, [esp + 0x11c]
push edx
lea ebx, [esp + 0x104]
lea eax, [esp + 0x158]
mov edx, reloc.OLEAUT32.dll_SysReAllocString
call fcn.004046b0
add esp, 4
cmp dword [esp + 0x118], 8
jb 0x405809
mov eax, dword [esp + 0x104]
push eax
call fcn.00423621
add esp, 4
xor ecx, ecx
push 9
mov word [esp + 0x108], cx
mov edi, 7
xor esi, esi
push str.kbdus.dll
lea ecx, [esp + 0x108]
mov dword [esp + 0x120], edi
mov dword [esp + 0x11c], esi
call fcn.00401820
mov byte [esp + 0x180], 0xa
push 0xb
xor edx, edx
push str.Layout_File
lea ecx, [esp + 0x38]
mov dword [esp + 0x50], edi
mov dword [esp + 0x4c], esi
mov word [esp + 0x3c], dx
call fcn.00401820
lea eax, [esp + 0x100]
push eax
lea ebx, [esp + 0x34]
lea eax, [esp + 0x158]
mov edx, reloc.OLEAUT32.dll_SysReAllocString
call fcn.004046b0
mov ebx, 8
add esp, 4
cmp dword [esp + 0x48], ebx
jb 0x40589a
mov ecx, dword [esp + 0x34]
push ecx
call fcn.00423621
add esp, 4
xor esi, esi
xor edx, edx
mov edi, 7
mov byte [esp + 0x180], bl
mov dword [esp + 0x48], edi
mov dword [esp + 0x44], esi
mov word [esp + 0x34], dx
cmp dword [esp + 0x118], ebx
jb 0x4058d0
mov eax, dword [esp + 0x104]
push eax
call fcn.00423621
add esp, 4
xor ecx, ecx
push 0xb
mov word [esp + 0x108], cx
push str.Layout_Text
lea ecx, [esp + 0x108]
mov dword [esp + 0x120], edi
mov dword [esp + 0x11c], esi
call fcn.00401820
mov edx, dword [esp + 0x4c]
push edx
lea ebx, [esp + 0x104]
lea eax, [esp + 0x158]
mov edx, reloc.OLEAUT32.dll_SysReAllocString
call fcn.004046b0
mov edi, 8
add esp, 4
cmp dword [esp + 0x118], edi
jb 0x405939
mov eax, dword [esp + 0x104]
push eax
call fcn.00423621
add esp, 4
xor esi, esi
cmp byte [ebp + 0x10], 0
je 0x405ba0
lea edi, [esi + 1]
xor ebx, ebx
xor ecx, ecx
push ebx
mov word [esp + 0x5c], cx
mov esi, 7
push 0x43c8ac
lea ecx, [esp + 0x5c]
mov dword [esp + 0x74], esi
mov dword [esp + 0x70], ebx
call fcn.00401820
mov byte [esp + 0x180], 0xb
push 0x17
xor edx, edx
push str.Keyboard_LayoutPreload
lea ecx, [esp + 0x38]
mov dword [esp + 0x50], esi
mov dword [esp + 0x4c], ebx
mov word [esp + 0x3c], dx
call fcn.00401820
push 0xa
push edi
lea esi, [esp + 0x78]
mov byte [esp + 0x188], 0xc
call fcn.00404610
lea ecx, [esp + 0x5c]
push ecx
push eax
lea edx, [esp + 0x40]
push edx
lea eax, [esp + 0x114]
push SysReAllocString
push eax
mov byte [esp + 0x19c], 0xd
call fcn.00404810
add esp, 0x1c
cmp dword [esp + 0x88], 8
jb 0x4059e7
mov ecx, dword [esp + 0x74]
push ecx
call fcn.00423621
add esp, 4
mov esi, 7
xor edx, edx
mov dword [esp + 0x88], esi
mov dword [esp + 0x84], ebx
mov word [esp + 0x74], dx
cmp dword [esp + 0x48], 8
jb 0x405a15
mov eax, dword [esp + 0x34]
push eax
call fcn.00423621
add esp, 4
xor ecx, ecx
mov dword [esp + 0x48], esi
mov dword [esp + 0x44], ebx
mov word [esp + 0x34], cx
mov byte [esp + 0x180], 0x11
cmp dword [esp + 0x6c], 8
jb 0x405a40
mov edx, dword [esp + 0x58]
push edx
call fcn.00423621
add esp, 4
xor eax, eax
mov dword [esp + 0x6c], esi
mov dword [esp + 0x68], ebx
mov word [esp + 0x58], ax
cmp dword [esp + 0x114], ebx
je 0x405ad3
mov ecx, dword [esp + 0x14]
push ecx
lea edx, [esp + 0x90]
push edx
call fcn.00404540
mov ecx, 8
add esp, 8
cmp dword [eax + 0x18], ecx
jb 0x405a7c
mov eax, dword [eax + 4]
jmp 0x405a7f
add eax, 4
cmp dword [esp + 0x118], ecx
mov ecx, dword [esp + 0x104]
jae 0x405a96
lea ecx, [esp + 0x104]
push eax
push ecx
call fcn.00424328
add esp, 8
test eax, eax
lea ecx, [esp + 0x8c]
sete bl
call fcn.00401080
lea ecx, [esp + 0x100]
mov byte [esp + 0x180], 8
call fcn.00401080
test bl, bl
jne 0x405b61
inc edi
jmp 0x405948
push str.Keyboard_LayoutPreload
lea ecx, [esp + 0x90]
call fcn.00401550
mov eax, dword [esp + 0x14]
push eax
lea ecx, [esp + 0xac]
push ecx
mov byte [esp + 0x188], 0x12
call fcn.00404540
mov ebx, eax
push 0xa
push edi
lea esi, [esp + 0xf4]
mov byte [esp + 0x190], 0x13
call fcn.00404610
push ebx
mov ebx, eax
lea eax, [esp + 0xa0]
mov edx, SysReAllocString
call fcn.004046b0
add esp, 0x14
mov ecx, esi
call fcn.00401080
lea ecx, [esp + 0xa8]
call fcn.00401080
lea ecx, [esp + 0x8c]
call fcn.00401080
lea ecx, [esp + 0x100]
mov byte [esp + 0x180], 8
call fcn.00401080
mov edx, dword [esp + 0x14]
push edx
lea eax, [esp + 0xac]
push eax
call fcn.00404540
add esp, 8
cmp dword [eax + 0x18], 8
jb 0x405b81
mov eax, dword [eax + 4]
jmp 0x405b84
add eax, 4
push 0x10
push eax
call dword [sym.imp.USER32.dll_LoadKeyboardLayoutW]
lea ecx, [esp + 0xa8]
call fcn.00401080
mov edi, 8
xor esi, esi
cmp dword [esp + 0x16c], edi
jb 0x405bb9
mov ecx, dword [esp + 0x158]
push ecx
call fcn.00423621
add esp, 4
mov eax, dword [esp + 0x24]
xor edx, edx
mov dword [esp + 0x16c], 7
mov dword [esp + 0x168], esi
mov word [esp + 0x158], dx
cmp eax, esi
je 0x405bff
mov ecx, dword [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x2c]
lea edx, [esp + 0x24]
push edx
push ecx
push eax
call fcn.00406b30
mov edx, dword [esp + 0x34]
push edx
call fcn.00423621
add esp, 0x14
mov eax, dword [esp + 0x18]
push eax
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], esi
call fcn.00423621
add esp, 4
cmp dword [esp + 0x134], edi
jb 0x405c31
mov ecx, dword [esp + 0x120]
push ecx
call fcn.00423621
add esp, 4
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x178]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x160]
xor ecx, esp
call fcn.0042364d
mov esp, ebp
pop ebp
ret 0xc