Function at 0x401550
Capabilities:
Create directory
Enumerate files on windows
Get common file path
Hide graphical window
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xebc
mov eax, dword [0x41f004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0
push ecx
push 0
push 0
push 0
push 0
push 0
push 0
push 0xcf0000
push 0x421080
push 0x420fb8
mov ebx, edx
push 0
mov dword [ebp - 0xebc], ebx
call dword [sym.imp.USER32.dll_CreateWindowExW]
mov edi, eax
test edi, edi
je 0x401608
push 0
push edi
call dword [sym.imp.USER32.dll_ShowWindow]
mov ecx, ebx
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4015b0
sub ecx, edx
sar ecx, 1
jne 0x40161b
push str.ApticClientCmd___Copyright__c__Aptic_AB__2013_2023_r_n_r_n
lea eax, [ebp - 0x808]
push 0x3ff
push eax
call fcn.00405bf6
add esp, 0xc
lea eax, [ebp - 0x808]
push str.Usage:_r_n_C__number_sequence___search_value_______next_commmand_____Execute_quick_menu_command_sequence_r_n_M__message_____Show_message_to_the_user_r_n_N___Create_new_window_r_n_Q___Quit_Aptic_Client_r_n_L___Toggle_extended_logging_on_off_r_n
push 0x3ff
push eax
call fcn.00405c5a
add esp, 0xc
push 0x40
push 0x41c918
lea eax, [ebp - 0x808]
push eax
push edi
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401e06
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0xeb4]
mov dword [ebp - 0xeb4], 0
push eax
push 0x2001f
push 0
push str.SOFTWAREAptic_ABApticClientCmd
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40168d
mov dword [ebp - 0xc30], eax
lea eax, [ebp - 0xc2c]
push eax
lea eax, [ebp - 0xc30]
mov dword [ebp - 0xc2c], 4
push eax
push 0
push 0
push str.ExtendedLogging
push dword [ebp - 0xeb4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4016c8
cmp dword [ebp - 0xc30], eax
setne byte [0x420560]
jmp 0x4016c8
cmp eax, 2
jne 0x4016c8
push 0
lea eax, [ebp - 0xeb4]
push eax
push 0
push 0
push 0
push 0
push 0
push str.SOFTWAREAptic_ABApticClientCmd
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
mov ecx, dword [ebp - 0xeb4]
xor edx, edx
test eax, eax
cmovne ecx, edx
mov dword [ebp - 0xeb4], ecx
push 0x41cddc
push ebx
call fcn.00405ccf
add esp, 8
test eax, eax
jne 0x401795
push str.ApticClientCmd___Copyright__c__Aptic_AB__2013_2023_r_n_r_n
lea eax, [ebp - 0x808]
push 0x3ff
push eax
call fcn.00405bf6
mov ecx, dword [ebp - 0xeb4]
add esp, 0xc
cmp byte [0x420560], 0
mov esi, 0x40
sete al
mov byte [0x420560], al
test ecx, ecx
jne 0x401739
push str.No_valid_registry_key_found._r_n
lea eax, [ebp - 0x808]
push 0x3ff
push eax
call fcn.00405c5a
add esp, 0xc
mov esi, 0x10
push esi
jmp 0x4015f5
movzx eax, al
push 4
mov dword [ebp - 0xc2c], eax
lea eax, [ebp - 0xc2c]
push eax
push 4
push str.ExtendedLogging
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetKeyValueW]
test eax, eax
je 0x401766
push str.Error_setting_registry_key._r_n
jmp 0x40171a
cmp byte [0x420560], 0
mov ecx, str.Extended_logging_has_been_turned_off_r_n
mov eax, str.Extended_logging_has_been_turned_on_r_n
cmove eax, ecx
push eax
lea eax, [ebp - 0x808]
push 0x3ff
push eax
call fcn.00405c5a
add esp, 0xc
push esi
jmp 0x4015f5
push dword [ebp - 0xeb4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x41cf00
push 0x104
push 0x420778
call fcn.00405bf6
add esp, 0xc
push 0x104
push 0x420da8
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x420da8
push 0x104
push 0x420988
call fcn.00405bf6
add esp, 0xc
push 0x5c
push 0x420988
call fcn.0040296e
lea esi, [eax + 2]
push esi
push 0x104
push 0x420b98
call fcn.00405bf6
add esp, 0x14
xor eax, eax
mov word [esi], ax
mov dword [ebp - 0xeb8], eax
lea eax, [ebp - 0xeb8]
push eax
push 0
push 0x8000
push 0x417210
call dword [sym.imp.SHELL32.dll_SHGetKnownFolderPath]
push dword [ebp - 0xeb8]
push 0x104
push 0x420568
test eax, eax
jne 0x401851
call fcn.00405bf6
add esp, 0xc
push dword [ebp - 0xeb8]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
jmp 0x401859
call fcn.00405bf6
add esp, 0xc
push str.Aptic
push 0x104
push 0x420568
call fcn.00405c5a
mov esi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
add esp, 0xc
push 0
push 0x420568
call esi
push str.ApticClientCmd
push 0x104
push 0x420568
call fcn.00405c5a
add esp, 0xc
push 0
push 0x420568
call esi
lea eax, [ebp - 0xc38]
push eax
call fcn.00404039
add esp, 4
lea eax, [ebp - 0xc38]
push eax
lea eax, [ebp - 0xc5c]
push eax
call fcn.0040430c
push dword [ebp - 0xc50]
mov eax, dword [ebp - 0xc4c]
inc eax
push eax
mov eax, dword [ebp - 0xc48]
add eax, 0x76c
push eax
push 0x420568
lea eax, [ebp - 0xc28]
push str._s_apticclientcmd__04d__02d__02d.log
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0xc28]
push eax
push 0x104
push 0x420568
call fcn.00405bf6
add esp, 0x2c
lea eax, [ebp - 0xa18]
push 0x420988
push 0x104
push eax
call fcn.00405bf6
add esp, 0xc
lea eax, [ebp - 0xa18]
push str..exe
push 0x104
push eax
call fcn.00405c5a
add esp, 0xc
lea eax, [ebp - 0xeb0]
push eax
lea eax, [ebp - 0xa18]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x401997
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.ApticClientCmd___Copyright__c__Aptic_AB__2013_2023_r_n_r_n
lea eax, [ebp - 0x808]
push 0x3ff
push eax
call fcn.00405bf6
add esp, 0xc
push str.Error:_Unable_to_find_executable_file._No_read_access_to_folder_
lea eax, [ebp - 0x808]
push 0x3ff
push eax
call fcn.00405c5a
add esp, 0xc
push 0x10
jmp 0x4015f5
mov ebx, dword [sym.imp.KERNEL32.dll_FindNextFileW]
nop dword [eax]
test byte [ebp - 0xeb0], 0x10
jne 0x4019f2
lea eax, [ebp - 0xe84]
push str.apticclient.exe
push eax
call fcn.00405ccf
add esp, 8
test eax, eax
je 0x401a02
lea eax, [ebp - 0xe84]
push 0x420b98
push eax
call fcn.00405ccf
add esp, 8
test eax, eax
je 0x4019f2
lea eax, [ebp - 0xe84]
push eax
push 0x104
push 0x420778
call fcn.00405bf6
add esp, 0xc
lea eax, [ebp - 0xeb0]
push eax
push esi
call ebx
test eax, eax
jne 0x4019a0
jmp 0x401a19
push str.apticclient.exe
push 0x104
push 0x420778
call fcn.00405bf6
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, 0x420778
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x401a30
sub ecx, edx
sar ecx, 1
jne 0x401a64
push str.ApticClientCmd___Copyright__c__Aptic_AB__2013_2023_r_n_r_n
lea eax, [ebp - 0x808]
push 0x3ff
push eax
call fcn.00405bf6
add esp, 0xc
push str.Error:_Unable_to_find_executable_file.
jmp 0x40197c
cmp byte [0x420560], 0
je 0x401a84
push 0x420778
push 0x420b98
push str.ApticClientCmd_started_as__s__and_is_expecting_ARC_client__s
call fcn.00401000
add esp, 0xc
push dword [ebp - 0xebc]
push 1
push 0x111
push edi
call dword [sym.imp.USER32.dll_PostMessageW]
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401e06
mov esp, ebp
pop ebp
ret