Function at 0x4985f9
Capabilities:
Log keystrokes via polling
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x9c
mov dword [ebp - 0x64], 0x51ea60
mov dword [ebp - 0x60], 0x51f652
lea eax, [ebp - 0x5c]
lea edx, [ebp - 0x18]
mov dword [eax], edx
mov edx, 0x498ead
mov dword [eax + 4], edx
mov dword [eax + 8], esp
lea eax, [ebp - 0x7c]
mov dword [esp], eax
call fcn.004b1180
mov dword [ebp - 0x1c], 0
jmp 0x49863e
nop
jmp 0x49863e
nop
mov eax, dword [0x6826c4]
cmp eax, 1
jne 0x49867b
mov dword [0x6826c4], 2
jmp 0x49866c
mov dword [esp], 1
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x78], 0xffffffff
call eax
sub esp, 4
mov eax, dword [0x6826c4]
cmp eax, 2
sete al
test al, al
jne 0x498654
mov eax, dword [0x692764]
test eax, eax
je 0x498691
mov eax, dword [0x692760]
test eax, eax
je 0x498db9
call fcn.0043ecc3
mov dword [0xa197e4], eax
mov edx, dword [0xa197e4]
mov eax, dword [0x69cea4]
mov ecx, edx
sub ecx, eax
mov eax, ecx
mov dword [0xa197e4], eax
mov edx, dword [0xa197e4]
mov eax, dword [0x69cea0]
add eax, edx
mov dword [0xa197e4], eax
mov ecx, dword [0xa197e4]
mov edx, 0x31b5d43b
mov eax, ecx
mul edx
mov eax, edx
shr eax, 0x18
imul eax, eax, 0x5265c00
mov edx, ecx
sub edx, eax
mov eax, edx
mov dword [0xa197e4], eax
mov eax, dword [0xa197e4]
mov edx, 0
mov dword [ebp - 0x88], eax
mov dword [ebp - 0x84], edx
fild qword [ebp - 0x88]
fld qword [0x5513e8]
fmulp st(1)
fnstcw word [ebp - 0x7e]
movzx eax, word [ebp - 0x7e]
mov ah, 0xc
mov word [ebp - 0x80], ax
fldcw word [ebp - 0x80]
fistp qword [ebp - 0x88]
fldcw word [ebp - 0x7e]
mov eax, dword [ebp - 0x88]
mov edx, dword [ebp - 0x84]
mov dword [0xa197e4], eax
mov eax, dword [0xa197e4]
mov byte [0x56d70c], al
mov eax, dword [0xa197e4]
shr eax, 8
mov byte [0x56d70d], al
mov eax, dword [0xa197e4]
shr eax, 0x10
mov byte [0x56d70e], al
mov eax, dword [0xa181b0]
test eax, eax
je 0x498799
mov eax, dword [0xa181b0]
cmp eax, 0xffffffff
je 0x49877c
mov dword [0xa181b0], 0xffffffff
jmp 0x498bcc
mov dword [esp], 0x40
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x78], 0xffffffff
call eax
sub esp, 4
jmp 0x49863e
mov dword [esp], 0xf
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x78], 0xffffffff
call eax
sub esp, 4
mov dword [0x69ceb4], 1
mov dword [0x69ceb0], 1
mov dword [esp], 1
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
call eax
sub esp, 4
movzx eax, byte [0x56d268]
test al, al
je 0x4987f0
mov dword [0x6826c4], 2
jmp 0x498dba
mov eax, dword [0x67db4c]
test eax, eax
jne 0x4987fe
call fcn.0046c21d
mov eax, dword [0x67db4c]
test eax, eax
je 0x498b03
mov dword [ebp - 0x28], 0
mov eax, dword [0x521054]
mov dword [esp + 8], eax
mov dword [esp + 4], str.input__d.txt
mov dword [esp], str.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
call sub.msvcrt.dll_sprintf
mov dword [esp + 4], 0x53dfbf
mov dword [esp], str.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
mov dword [ebp - 0x78], 0xffffffff
call sub.msvcrt.dll_fopen
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x498b03
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_ftell
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_rewind
cmp dword [ebp - 0x2c], 0
jle 0x498af1
mov eax, dword [ebp - 0x2c]
add eax, 1
mov dword [esp + 4], eax
mov dword [esp], 1
call sub.msvcrt.dll_calloc
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
je 0x498af1
mov eax, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x28]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_fread
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x34]
jne 0x498ae6
mov eax, dword [ebp - 0x2c]
lea edx, [eax - 1]
mov eax, dword [ebp - 0x30]
add eax, edx
movzx eax, byte [eax]
cmp al, 0x2a
jne 0x498ae6
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x24], eax
jmp 0x498933
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x30]
add eax, edx
movzx eax, byte [eax]
test al, al
je 0x498ab6
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x30]
add eax, edx
movzx eax, byte [eax]
cmp al, 0x3a
je 0x498945
add dword [ebp - 0x24], 1
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x2c]
setl al
test al, al
jne 0x49890d
jmp 0x498ab7
nop
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x30]
add eax, edx
movzx eax, byte [eax]
movsx eax, al
mov dword [ebp - 0x38], eax
add dword [ebp - 0x20], 1
cmp dword [ebp - 0x38], 0x4d
jne 0x4989a0
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x30]
add edx, eax
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x40]
mov dword [esp + 8], eax
mov dword [esp + 4], str._d__d
mov dword [esp], edx
call sub.msvcrt.dll_sscanf
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], edx
mov dword [esp], eax
mov dword [ebp - 0x78], 1
call fcn.00495797
cmp dword [ebp - 0x38], 0x4c
jne 0x4989ed
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x30]
add edx, eax
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x40]
mov dword [esp + 8], eax
mov dword [esp + 4], str._d__d
mov dword [esp], edx
call sub.msvcrt.dll_sscanf
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x40]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], 0
mov dword [ebp - 0x78], 1
call fcn.004954b2
cmp dword [ebp - 0x38], 0x6c
jne 0x498a3a
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x30]
add edx, eax
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x40]
mov dword [esp + 8], eax
mov dword [esp + 4], str._d__d
mov dword [esp], edx
call sub.msvcrt.dll_sscanf
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x40]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], 0
mov dword [ebp - 0x78], 1
call fcn.004952b8
cmp dword [ebp - 0x38], 0x44
jne 0x498a71
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x30]
add edx, eax
lea eax, [ebp - 0x40]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x53c43a
mov dword [esp], edx
call sub.msvcrt.dll_sscanf
mov eax, dword [ebp - 0x40]
mov dword [esp], eax
mov dword [ebp - 0x78], 1
call fcn.0043f56e
cmp dword [ebp - 0x38], 0x55
jne 0x498aa8
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x30]
add edx, eax
lea eax, [ebp - 0x40]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x53c43a
mov dword [esp], edx
call sub.msvcrt.dll_sscanf
mov eax, dword [ebp - 0x40]
mov dword [esp], eax
mov dword [ebp - 0x78], 1
call fcn.0043f629
mov eax, dword [ebp - 0x24]
add eax, 1
mov dword [ebp - 0x20], eax
jmp 0x498905
nop
mov eax, dword [0x521054]
add eax, 1
mov dword [0x521054], eax
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
mov dword [ebp - 0x78], 1
call sub.msvcrt.dll_fclose
jmp 0x49880b
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
mov dword [ebp - 0x78], 0xffffffff
call sub.msvcrt.dll_fclose
xor dword [ebp - 0x1c], 1
mov eax, dword [0x692720]
test eax, eax
jne 0x498bc6
mov dword [0x692734], 1
mov eax, dword [0x692730]
test eax, eax
je 0x498bbc
mov dword [esp + 8], 1
fld qword [0x551268]
fstp qword [esp]
mov dword [ebp - 0x78], 0xffffffff
call fcn.00460ece
fld qword [0x692728]
fsubp st(1)
fabs
fld qword [0x551320]
fxch st(1)
fucompi st(1)
fstp st(0)
setae al
test al, al
je 0x498bbc
mov eax, dword [0x692724]
mov dword [esp], eax
call fcn.00480b65
mov dword [0x692730], 0
call fcn.004722e5
mov dword [0xa197e8], eax
mov eax, dword [0x692724]
mov dword [esp], eax
call fcn.0047223c
mov dword [esp + 8], 2
mov dword [esp + 4], 0xf
mov dword [esp], 0
call fcn.0045c74d
mov eax, dword [0xa197e8]
mov dword [esp], eax
call fcn.0047223c
mov dword [0x692734], 0
cmp dword [ebp - 0x1c], 1
jne 0x498bee
mov eax, dword [0x5212d8]
test eax, eax
je 0x498be1
mov dword [ebp - 0x78], 0xffffffff
call fcn.00498f3e
mov eax, dword [0x69cd6c]
add eax, 1
mov dword [0x69cd6c], eax
mov dword [0x69ceb0], 0
mov eax, dword [0xa181b0]
test eax, eax
jne 0x49863a
cmp dword [ebp - 0x1c], 0
jne 0x49863d
mov dword [esp], 0x91
mov eax, dword [sym.imp.USER32.dll_GetKeyState]
mov dword [ebp - 0x78], 0xffffffff
call eax
sub esp, 4
cwde
mov edx, eax
and edx, 1
mov dword [ebp - 0x8c], edx
mov dword [esp], 0x30d4b
call fcn.0043eff2
cmp dword [ebp - 0x8c], eax
setne al
test al, al
je 0x498c87
mov dword [esp], 0x30d4b
call fcn.0043eff2
test eax, eax
setne al
test al, al
je 0x498c6f
mov dword [esp], 0x30d4b
call fcn.0043f351
jmp 0x498c7b
mov dword [esp], 0x30d4b
call fcn.0043f25f
mov dword [ebp - 0x78], 0xffffffff
call fcn.0049aecb
mov dword [esp], 0x14
mov eax, dword [sym.imp.USER32.dll_GetKeyState]
mov dword [ebp - 0x78], 0xffffffff
call eax
sub esp, 4
cwde
mov ecx, eax
and ecx, 1
mov dword [ebp - 0x90], ecx
mov dword [esp], 0x187cd
call fcn.0043eff2
cmp dword [ebp - 0x90], eax
setne al
test al, al
je 0x498d1a
mov dword [esp], 0x187cd
call fcn.0043eff2
test eax, eax
setne al
test al, al
je 0x498cf1
mov dword [0x692708], 0x12d
mov dword [esp], 0x187cd
call fcn.0043f629
jmp 0x498d0e
mov dword [0x692708], 0x12d
mov dword [esp], 0x187cd
mov dword [ebp - 0x78], 0xffffffff
call fcn.0043f56e
mov dword [ebp - 0x78], 0xffffffff
call fcn.0049aecb
mov dword [esp], 0x90
mov eax, dword [sym.imp.USER32.dll_GetKeyState]
mov dword [ebp - 0x78], 0xffffffff
call eax
sub esp, 4
cwde
mov edx, eax
and edx, 1
mov dword [ebp - 0x94], edx
mov dword [esp], 0x187cc
call fcn.0043eff2
cmp dword [ebp - 0x94], eax
setne al
test al, al
je 0x498dad
mov dword [esp], 0x187cc
call fcn.0043eff2
test eax, eax
setne al
test al, al
je 0x498d84
mov dword [0x692708], 0x12c
mov dword [esp], 0x187cc
call fcn.0043f629
jmp 0x498da1
mov dword [0x692708], 0x12c
mov dword [esp], 0x187cc
mov dword [ebp - 0x78], 0xffffffff
call fcn.0043f56e
mov dword [ebp - 0x78], 0xffffffff
call fcn.0049aecb
mov eax, dword [0xa181b0]
test eax, eax
jmp 0x49863d
nop
mov byte [0x56d299], 1
mov dword [0x56d294], 1
jmp 0x498de5
mov dword [esp], 0x10
mov eax, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x78], 0xffffffff
call eax
sub esp, 4
mov eax, dword [0x69271c]
cmp eax, 3
setne al
test al, al
jne 0x498dcd
mov eax, dword [0x692730]
test eax, eax
je 0x498e0a
mov eax, dword [0x692724]
mov dword [esp], eax
call fcn.00480b65
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [ebp - 0x78], 0xffffffff
call fcn.00461d13
mov eax, dword [0x67db4c]
test eax, eax
jne 0x498e33
call fcn.0046c229
mov eax, dword [0x67db4c]
test eax, eax
je 0x498e9a
mov dword [esp + 4], 0x53c492
mov dword [esp], str..._final.txt
mov dword [ebp - 0x78], 0xffffffff
call sub.msvcrt.dll_fopen
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
je 0x498e8e
mov eax, dword [ebp - 0x3c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x17
mov dword [esp + 4], 1
mov dword [esp], str.Program_exited_normally
call sub.msvcrt.dll_fwrite
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [esp], 0
call sub.msvcrt.dll_exit
mov eax, dword [0x6826d8]
mov edx, dword [0x6826dc]
mov dword [esp], eax
call sub.msvcrt.dll_exit
lea ebp, [ebp + 0x18]
mov eax, dword [ebp - 0x74]
mov dword [esp], eax
mov dword [ebp - 0x78], 0xffffffff
call fcn.004b1620