Function at 0x40b300
Capabilities:
Link many functions at runtime
Log keystrokes via polling

Disassembly:
push 0xffffffffffffffff
push 0x4a818e
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x1dc
push ebx
mov ebx, ecx
push ebp
xor eax, eax
push esi
push edi
lea edi, [ebx + 0x225]
mov dword [esp + 0x48], edi
mov ecx, 0x40
rep stosd dword es:[edi], eax
lea ecx, [ebx + 0x52c]
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
mov ecx, 0x40
lea edi, [ebx + 0x620]
rep stosd dword es:[edi], eax
xor edx, edx
lea eax, [ebx + 0x720]
mov dword [eax], edx
mov dword [eax + 4], edx
mov dword [eax + 8], edx
lea eax, [ebx + 0x20]
lea ebp, [ebx + 0x1c]
push 0x114
mov dword [esp + 0x50], ebx
mov byte [ebx + 0x24], dl
mov dword [ebp], edx
mov dword [esp + 0x14], eax
mov dword [eax], edx
call fcn.00496f9b
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
mov dword [esp + 0x1f4], 0
je 0x40b3a3
mov ecx, eax
call fcn.0048b760
mov edi, eax
jmp 0x40b3a5
xor edi, edi
push 1
push str.keycode.cfg
mov dword [esp + 0x1fc], 0xffffffff
call fcn.004893e0
add esp, 4
push eax
mov ecx, edi
call fcn.0048b7c0
test al, al
je 0x40b3f4
push 1
push 0x100
lea esi, [ebx + 0x25]
push esi
mov ecx, edi
call fcn.0048c290
mov ecx, edi
call fcn.0048bcb0
mov byte [0x4cfbbc], 1
mov byte [0x8dd83b], 0
jmp 0x40b40b
xor eax, eax
lea esi, [ebx + 0x25]
mov byte [esi + eax], al
inc eax
cmp eax, 0x100
jl 0x40b3f9
mov byte [0x4cfbbc], 0
test edi, edi
je 0x40b41f
mov ecx, edi
call fcn.0048bcb0
push edi
call fcn.0048d4e6
add esp, 4
lea edi, [ebx + 0x125]
mov ecx, 0x40
rep movsd dword es:[edi], dword [esi]
mov al, byte [0x8dd83b]
test al, al
je 0x40b4b1
mov ecx, dword [ebx + 0xb40]
push 0
push ebp
push 0x4a94a0
push 0x800
push ecx
call sub.DINPUT8.dll_DirectInput8Create
test eax, eax
jl 0x40b4b1
mov eax, dword [ebp]
mov ebp, dword [esp + 0x10]
mov edx, dword [eax]
push 0
push ebp
push 0x4a9480
push eax
call dword [edx + 0xc]
test eax, eax
jl 0x40b4b5
mov eax, dword [ebp]
mov ecx, dword [eax]
push 0x4c2a2c
push eax
call dword [ecx + 0x2c]
test eax, eax
jl 0x40b4b5
mov ecx, dword [ebx + 0xb3c]
mov eax, dword [ebp]
mov edx, dword [eax]
push 6
push ecx
push eax
call dword [edx + 0x34]
test eax, eax
jl 0x40b4b5
mov eax, dword [ebp]
mov edx, dword [eax]
push eax
call dword [edx + 0x1c]
mov ecx, 0x40
xor eax, eax
lea edi, [ebx + 0x425]
mov byte [ebx + 0x24], 1
rep stosd dword es:[edi], eax
jmp 0x40b4b5
mov ebp, dword [esp + 0x10]
xor eax, eax
mov ecx, 0x38
lea edi, [ebx + 0x540]
rep stosd dword es:[edi], eax
call dword [sym.imp.WINMM.dll_joyGetNumDevs]
xor edi, edi
test eax, eax
mov dword [ebx + 0x53c], eax
mov dword [esp + 0x14], edi
jle 0x40b7b8
lea esi, [ebx + 0x554]
cmp edi, 4
jge 0x40b7b8
push 0x194
lea eax, [esp + 0x5c]
push eax
push edi
call dword [sym.imp.WINMM.dll_joyGetDevCapsA]
test eax, eax
jne 0x40b785
mov eax, dword [esp + 0xc0]
cmp eax, 1
mov dword [esi - 0x14], eax
jb 0x40b767
mov ebx, dword [esp + 0x7c]
mov edi, dword [esp + 0x80]
xor edx, edx
xor ebp, ebp
mov eax, ebx
add eax, edi
adc edx, ebp
mov ecx, 1
call fcn.00497530
mov ecx, eax
mov dword [esp + 0x34], edx
mov dword [esp + 0x30], ecx
mov eax, ebx
add eax, ecx
mov ecx, dword [esp + 0x34]
mov edx, ebp
adc edx, ecx
mov ecx, 1
call fcn.00497530
mov ebx, dword [esp + 0x30]
mov dword [esi - 0x10], eax
mov eax, edi
mov edi, dword [esp + 0x34]
add eax, ebx
mov edx, ebp
adc edx, edi
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0x84]
mov edi, dword [esp + 0x88]
mov dword [esi - 0xc], eax
xor edx, edx
xor ebx, ebx
mov eax, ebp
add eax, edi
adc edx, ebx
mov ecx, 1
call fcn.00497530
mov ecx, eax
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], ecx
mov eax, ebp
add eax, ecx
mov ecx, dword [esp + 0x1c]
mov edx, ebx
adc edx, ecx
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0x18]
mov dword [esi - 8], eax
mov eax, edi
mov edi, dword [esp + 0x1c]
add eax, ebp
mov edx, ebx
adc edx, edi
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0x8c]
mov edi, dword [esp + 0x90]
mov dword [esi - 4], eax
xor edx, edx
mov eax, ebp
add eax, edi
adc edx, ebx
mov ecx, 1
call fcn.00497530
mov ecx, eax
mov dword [esp + 0x2c], edx
mov dword [esp + 0x28], ecx
mov eax, ebp
add eax, ecx
mov ecx, dword [esp + 0x2c]
mov edx, ebx
adc edx, ecx
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0x28]
mov dword [esi], eax
mov eax, edi
add eax, ebp
mov edx, ebx
adc edx, dword [esp + 0x2c]
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0xa0]
mov edi, dword [esp + 0xa4]
mov dword [esi + 4], eax
xor edx, edx
mov eax, ebp
add eax, edi
adc edx, ebx
mov ecx, 1
call fcn.00497530
mov ecx, eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], ecx
mov eax, ebp
add eax, ecx
mov ecx, dword [esp + 0x24]
mov edx, ebx
adc edx, ecx
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0x20]
mov dword [esi + 8], eax
mov eax, edi
mov edi, dword [esp + 0x24]
add eax, ebp
mov edx, ebx
adc edx, edi
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0xa8]
mov edi, dword [esp + 0xac]
mov dword [esi + 0xc], eax
xor edx, edx
mov eax, ebp
add eax, edi
adc edx, ebx
mov ecx, 1
call fcn.00497530
mov ecx, eax
mov dword [esp + 0x44], edx
mov dword [esp + 0x40], ecx
mov eax, ebp
add eax, ecx
mov ecx, dword [esp + 0x44]
mov edx, ebx
adc edx, ecx
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0x40]
mov dword [esi + 0x10], eax
mov eax, edi
mov edi, dword [esp + 0x44]
add eax, ebp
mov edx, ebx
adc edx, edi
mov ecx, 1
call fcn.00497530
mov ebp, dword [esp + 0xb0]
mov edi, dword [esp + 0xb4]
mov dword [esi + 0x14], eax
xor edx, edx
mov eax, ebp
add eax, edi
mov dword [esp + 0x54], edx
adc edx, ebx
mov ecx, 1
call fcn.00497530
mov ecx, eax
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0x54]
mov eax, ebp
mov ebp, dword [esp + 0x3c]
add eax, ecx
mov dword [esp + 0x38], ecx
adc edx, ebp
mov ecx, 1
call fcn.00497530
mov dword [esi + 0x18], eax
mov edx, dword [esp + 0x38]
mov eax, edi
add eax, edx
mov ecx, ebp
mov edx, ebx
adc edx, ecx
mov ecx, 1
call fcn.00497530
mov ebx, dword [esp + 0x4c]
mov edi, dword [esp + 0x14]
mov ebp, dword [esp + 0x10]
mov dword [esi + 0x1c], eax
mov ecx, dword [esp + 0x94]
cmp ecx, 0x10
jbe 0x40b778
mov ecx, 0x10
mov edx, 1
shl edx, cl
dec edx
mov dword [esi + 0x20], edx
jmp 0x40b7a2
mov eax, 0x3fff
mov dword [esi - 8], eax
mov dword [esi - 0x10], eax
mov eax, 0xbfff
mov dword [esi - 4], eax
mov dword [esi - 0xc], eax
mov dword [esi + 0x20], 0xf
mov eax, dword [ebx + 0x53c]
inc edi
add esi, 0x38
cmp edi, eax
mov dword [esp + 0x14], edi
jl 0x40b4e4
push 0x14
mov byte [ebx + 0x72c], 0
mov byte [ebx + 0x526], 0
mov byte [ebx + 0x525], 0
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
and al, 1
mov byte [ebx + 0x527], al
mov byte [ebx + 0x528], 0
mov eax, dword [0x4cfbf8]
cmp dword [eax], 0
je 0x40b809
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x40b804
mov eax, dword [esp + 0x48]
push eax
call ecx
mov eax, dword [0x4cfbf8]
add esp, 4
cmp dword [eax], 0
jne 0x40b810
mov byte [0x8dd850], 0
mov eax, dword [0x4cfbfc]
test eax, eax
je 0x40b82c
mov ecx, dword [eax]
test ecx, ecx
je 0x40b82c
test ecx, ecx
je 0x40b82c
mov eax, dword [eax + 8]
test eax, eax
je 0x40b82c
call eax
mov esi, dword [0x4cfc00]
test esi, esi
je 0x40b852
mov eax, dword [esi]
test eax, eax
je 0x40b849
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [esi], 0
push esi
call fcn.0048d4e6
add esp, 4
cmp dword [ebp], 0
je 0x40b9a6
push 0x40
call fcn.00496f9b
mov esi, eax
add esp, 4
test esi, esi
je 0x40b94e
push str.keyemudi.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
mov dword [esi], eax
je 0x40b950
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.ked_create
push eax
call edi
mov ecx, dword [esi]
push str.ked_create_did8
push ecx
mov dword [esi + 4], eax
call edi
mov edx, dword [esi]
push str.ked_release
push edx
mov dword [esi + 8], eax
call edi
mov dword [esi + 0xc], eax
mov eax, dword [esi]
push str.ked_reset
push eax
call edi
mov ecx, dword [esi]
push str.ked_clear
push ecx
mov dword [esi + 0x10], eax
call edi
mov edx, dword [esi]
push str.ked_acquire
push edx
mov dword [esi + 0x14], eax
call edi
mov dword [esi + 0x18], eax
mov eax, dword [esi]
push str.ked_get
push eax
call edi
mov ecx, dword [esi]
push str.ked_setdelay
push ecx
mov dword [esi + 0x1c], eax
call edi
mov edx, dword [esi]
push str.ked_usemmtimer
push edx
mov dword [esi + 0x20], eax
call edi
mov dword [esi + 0x24], eax
mov eax, dword [esi]
push str.ked_updatecounter
push eax
call edi
mov ecx, dword [esi]
push str.ked_setconverttable
push ecx
mov dword [esi + 0x28], eax
call edi
mov edx, dword [esi]
push str.ked_getconverttable
push edx
mov dword [esi + 0x30], eax
call edi
mov dword [esi + 0x2c], eax
mov eax, dword [esi]
push str.ked_getdevicestate
push eax
call edi
mov ecx, dword [esi]
push str.ked_setnumlock
push ecx
mov dword [esi + 0x34], eax
call edi
mov edx, dword [esi]
push 0x4abac8
push edx
mov dword [esi + 0x38], eax
call edi
mov dword [esi + 0x3c], eax
jmp 0x40b950
xor esi, esi
mov eax, esi
mov dword [0x4cfc00], eax
cmp dword [esi], 0
je 0x40b973
mov esi, dword [esi + 8]
test esi, esi
je 0x40b973
mov eax, dword [ebp]
push eax
push 0
call esi
mov eax, dword [0x4cfc00]
add esp, 8
cmp dword [eax], 0
je 0x40b9a6
mov ecx, dword [eax + 0x24]
test ecx, ecx
je 0x40b98b
push 0
call ecx
mov eax, dword [0x4cfc00]
add esp, 4
cmp dword [eax], 0
je 0x40b9a6
mov eax, dword [eax + 0x20]
test eax, eax
je 0x40b9a6
push 0x4b00000
push 0x2ee00000
call eax
add esp, 8
mov ecx, dword [esp + 0x1ec]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x1e8
ret