Function at 0x405158
Capabilities:
Get common file path
Log keystrokes via polling

Disassembly:
push ebp
mov ebp, esp
mov ecx, 5
push 0
push 0
dec ecx
jne 0x405160
push ebx
push esi
push edi
xor eax, eax
push ebp
push 0x4054c7
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
call fcn.004045d8
mov byte [ebp - 0xd], al
cmp byte [ebp - 0xd], 0
jne 0x4051ec
call sub.rtl60.bpl__System_ParamCount_qqrv
mov esi, eax
test esi, esi
jle 0x4051ec
mov ebx, 1
lea edx, [ebp - 0x18]
mov eax, ebx
call sub.rtl60.bpl__System_ParamStr_qqri
mov eax, dword [ebp - 0x18]
lea edx, [ebp - 0x14]
call sub.rtl60.bpl__Sysutils_UpperCase_qqrx17System_AnsiString
mov eax, dword [ebp - 0x14]
mov edx, 0x4054e0
call sub.rtl60.bpl__System__LStrCmp_qqrv
je 0x4054ac
lea edx, [ebp - 0x20]
mov eax, ebx
call sub.rtl60.bpl__System_ParamStr_qqri
mov eax, dword [ebp - 0x20]
lea edx, [ebp - 0x1c]
call sub.rtl60.bpl__Sysutils_UpperCase_qqrx17System_AnsiString
mov eax, dword [ebp - 0x1c]
mov edx, 0x4054ec
call sub.rtl60.bpl__System__LStrCmp_qqrv
je 0x4054ac
inc ebx
dec esi
jne 0x405198
push 0x10
call sub.user32.dll_GetKeyState
test ax, ax
jge 0x405204
push 0x11
call sub.user32.dll_GetKeyState
test ax, ax
jl 0x405208
xor eax, eax
jmp 0x40520a
mov al, 1
mov byte [0x41c181], al
call fcn.00404d34
test al, al
je 0x4054ac
mov dl, 1
mov eax, dword [sym.imp.vcl60.bpl__Graphics_TBitmap_]
call sub.vcl60.bpl__Graphics_TBitmap__bctr_qqrv
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x4054a5
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
call fcn.00404db4
cmp byte [ebp - 0xd], 0
setne dl
mov eax, dword [ebp - 4]
call fcn.00404fd8
mov ecx, dword [sym.imp.vcl60.bpl__Forms_Application]
mov ecx, dword [ecx]
mov dl, 1
mov eax, dword [sym.imp.vcl60.bpl__Forms_TForm_]
call sub.vcl60.bpl__Forms_TCustomForm__bctr_qqrp18Classes_TComponent
mov dword [0x41c070], eax
mov edx, 0x4054f8
mov eax, dword [0x41c070]
mov ecx, dword [eax]
call dword [ecx + 0x18]
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x2c]
mov edx, eax
mov eax, dword [0x41c070]
call sub.vcl60.bpl__Controls_TControl_SetWidth_qqri
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x20]
mov edx, eax
mov eax, dword [0x41c070]
call sub.vcl60.bpl__Controls_TControl_SetHeight_qqri
mov edx, 0x8000000f
mov eax, dword [0x41c070]
call sub.vcl60.bpl__Controls_TControl_SetColor_qqr15Graphics_TColor
xor edx, edx
mov eax, dword [0x41c070]
call sub.vcl60.bpl__Forms_TCustomForm_SetBorderStyle_qqr22Forms_TFormBorderStyle
mov dl, 4
mov eax, dword [0x41c070]
call sub.vcl60.bpl__Forms_TCustomForm_SetPosition_qqr15Forms_TPosition
mov ecx, dword [0x41c070]
mov dl, 1
mov eax, dword [sym.imp.vcl60.bpl__Extctrls_TImage_]
call sub.vcl60.bpl__Extctrls_TImage__bctr_qqrp18Classes_TComponent
mov ebx, eax
mov dl, 5
mov eax, ebx
call sub.vcl60.bpl__Controls_TControl_SetAlign_qqr15Controls_TAlign
mov eax, dword [ebx + 0x168]
call sub.vcl60.bpl__Graphics_TPicture_GetBitmap_qqrv
mov edx, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx + 8]
mov eax, dword [ebx + 0x168]
call sub.vcl60.bpl__Graphics_TPicture_GetBitmap_qqrv
mov dl, 1
mov ecx, dword [eax]
call dword [ecx + 0x6c]
mov edx, dword [0x41c070]
mov eax, ebx
mov ecx, dword [eax]
call dword [ecx + 0x68]
mov dl, 1
mov eax, dword [0x41c070]
call sub.vcl60.bpl__Forms_TCustomForm_SetVisible_qqro
cmp byte [0x41c181], 0
je 0x405463
xor eax, eax
push ebp
push 0x405459
push dword fs:[eax]
mov dword fs:[eax], esp
push 0x405510
push 0xa
mov ecx, dword [0x41c004]
mov dl, 1
mov eax, dword [sym.imp.rtl60.bpl__Classes_TResourceStream_]
call sub.rtl60.bpl__Classes_TResourceStream__bctr_qqruix17System_AnsiStringpc
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x405448
push dword fs:[eax]
mov dword fs:[eax], esp
push 0x41c07c
push 0x105
call sub.kernel32.dll_GetTempPathA
mov edx, 0x40551c
mov eax, 0x41c07c
mov ecx, 0x105
call sub.rtl60.bpl__Sysutils_StrLCat_qqrpcpxcui
lea eax, [ebp - 0x24]
mov edx, 0x41c07c
mov ecx, 0x105
call sub.rtl60.bpl__System__LStrFromArray_qqrr17System_AnsiStringpci
mov eax, dword [ebp - 0x24]
call sub.rtl60.bpl__Sysutils_FileExists_qqrx17System_AnsiString
test al, al
jne 0x405432
push 0
push 0
mov eax, dword [ebp - 8]
call sub.rtl60.bpl__Classes_TStream_SetPosition_qqrxj
push 0xffff
lea eax, [ebp - 0x28]
mov edx, 0x41c07c
mov ecx, 0x105
call sub.rtl60.bpl__System__LStrFromArray_qqrr17System_AnsiStringpci
mov ecx, dword [ebp - 0x28]
mov dl, 1
mov eax, dword [sym.imp.rtl60.bpl__Classes_TFileStream_]
call sub.rtl60.bpl__Classes_TFileStream__bctr_qqrx17System_AnsiStringus
mov dword [ebp - 0xc], eax
xor eax, eax
push ebp
push 0x40541a
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 8]
call sub.rtl60.bpl__Classes_TStream_GetSize_qqrv
push edx
push eax
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
call sub.rtl60.bpl__Classes_TStream_CopyFrom_qqrp15Classes_TStreamj
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x405421
mov eax, dword [ebp - 0xc]
call sub.rtl60.bpl__System_TObject_Free_qqrv
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40544f
mov eax, dword [ebp - 8]
call sub.rtl60.bpl__System_TObject_Free_qqrv
ret
mov eax, dword [0x41c070]
mov edx, dword [eax]
call dword [edx + 0x88]
cmp byte [ebp - 0xd], 2
jne 0x40548f
mov byte [0x41c182], 1
mov al, 1
call fcn.004045d8
cmp al, 2
jne 0x40548f
xor eax, eax
call sub.rtl60.bpl__System__Halt_qqri
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4054ac
mov eax, dword [ebp - 4]
call sub.rtl60.bpl__System_TObject_Free_qqrv
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4054ce
lea eax, [ebp - 0x28]
mov edx, 6
call sub.rtl60.bpl__System__LStrArrayClr_qqrpvi
ret