Function at 0x40be15
Capabilities:
Acquire debug privileges
Connect pipe
Copy file
Create directory
Create thread
Delete directory
Read file on windows
Set registry value
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd3c
mov eax, dword [ebp + 8]
push ebx
push esi
xor esi, esi
cmp word [eax], si
push edi
mov dword [ebp - 0x10], esi
jne 0x40be43
push 0x10
push str.tcmadmin
push str.This_program_is_internal_to_Total_Commander._Do_not_call_it_directly_
push esi
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x40bebf
mov edi, 0x103
lea eax, [ebp - 0xb3c]
push edi
push str..PipeTcInstallPipe
push eax
call fcn.0040c67c
lea eax, [ebp - 0xb3c]
push eax
call fcn.00413733
push edi
lea ebx, [ebp + eax*2 - 0xb3c]
push dword [ebp + 8]
lea eax, [ebp - 0xb3c]
push eax
call fcn.0040c719
push 0x20
push ebx
call fcn.00413ce4
add esp, 0x24
cmp eax, esi
je 0x40bea3
mov word [eax], si
add eax, 2
push edi
push eax
push 0x421f80
call fcn.0040c67c
add esp, 0xc
jmp 0x40beaa
mov word [0x421f80], si
lea eax, [ebp - 0xb3c]
push eax
call fcn.0040bc3d
cmp eax, 0xffffffff
pop ecx
mov dword [ebp - 0x18], eax
jne 0x40bec7
push 1
pop eax
jmp 0x40c638
lea eax, [ebp - 0x34]
mov dword [0x421f64], esi
push eax
lea eax, [ebp - 0xb3c]
push esi
push eax
push 0x40bdb6
push esi
push esi
call dword [sym.imp.KERNEL32.dll_CreateThread]
push esi
mov dword [ebp + 8], eax
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
push 1
test eax, eax
pop ebx
je 0x40befe
mov edi, ebx
jmp 0x40bf11
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
sub edi, 0x217
neg edi
sbb edi, edi
inc edi
push dword [ebp + 8]
mov dword [0x421f64], ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, esi
jne 0x40bf2b
mov esi, ebx
jmp 0x40c62d
push 9
lea eax, [ebp - 0x28]
pop ebx
push esi
push eax
lea eax, [ebp - 0x834]
push 0x800
push eax
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40c624
cmp dword [ebp - 0x28], esi
je 0x40c624
push 0x78
lea eax, [ebp - 0x834]
pop edi
mov dword [ebp - 0xc], esi
push 7
push str.MKLINK_t
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40bfc7
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
mov dword [ebp + 8], eax
je 0x40c5c8
add eax, 2
push ebx
push eax
mov dword [ebp - 8], eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
je 0x40c5c8
mov ecx, dword [ebp + 8]
push dword [ebp - 8]
mov word [ecx], si
mov word [eax], si
add eax, 2
push eax
push dword [ebp - 8]
call fcn.0040adce
add esp, 0xc
jmp 0x40c02a
push 5
lea eax, [ebp - 0x834]
push str.COPY_t
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40c036
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
mov dword [ebp + 8], eax
je 0x40c5c8
add eax, 2
push ebx
push eax
mov dword [ebp - 0xc], eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
je 0x40c5c8
mov ecx, dword [ebp + 8]
push 1
mov word [ecx], si
mov word [eax], si
add eax, 2
push eax
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CopyFileW]
mov edi, eax
neg edi
sbb edi, edi
inc edi
jmp 0x40c5c8
push 6
lea eax, [ebp - 0x834]
push str.MKDIR_t
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40c073
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
je 0x40c0a0
add eax, 2
push esi
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jmp 0x40c56b
push 6
lea eax, [ebp - 0x834]
push str.RMDIR_t
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40c0b7
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
jne 0x40c0a8
or edi, 0xffffffff
jmp 0x40c5c8
add eax, 2
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
jmp 0x40c56b
push 0xb
lea eax, [ebp - 0x834]
push 0x41da64
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40c380
lea eax, [ebp - 0x834]
push ebx
push eax
mov dword [ebp - 0x1c], esi
call fcn.00413ce4
pop ecx
or edi, 0xffffffff
cmp eax, esi
pop ecx
mov dword [ebp - 4], eax
mov dword [ebp + 8], esi
mov dword [ebp - 0x14], esi
mov dword [ebp - 8], esi
mov dword [ebp - 0x20], esi
je 0x40c185
add dword [ebp - 4], 2
push ebx
push dword [ebp - 4]
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
mov dword [ebp + 8], eax
je 0x40c185
push dword [ebp - 4]
add dword [ebp + 8], 2
mov word [eax], si
call fcn.00414307
push ebx
mov dword [ebp - 8], eax
push dword [ebp + 8]
call fcn.00413ce4
add esp, 0xc
cmp eax, esi
mov dword [ebp - 4], eax
je 0x40c168
add dword [ebp - 4], 2
push ebx
push dword [ebp - 4]
mov word [eax], si
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
mov dword [ebp - 0x14], eax
je 0x40c168
push dword [ebp - 4]
add dword [ebp - 0x14], 2
mov word [eax], si
call fcn.00414307
pop ecx
mov dword [ebp - 0x20], eax
cmp dword [ebp - 8], esi
je 0x40c185
cmp dword [ebp - 0x14], esi
je 0x40c185
push dword [ebp - 8]
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_OpenProcess]
cmp eax, esi
mov dword [ebp - 0x1c], eax
jne 0x40c1c0
cmp dword [0x420bec], esi
jne 0x40c309
push 1
pop ebx
push ebx
push str.SeDebugPrivilege
mov dword [0x420bec], ebx
call fcn.0040ba32
pop ecx
pop ecx
push dword [ebp - 8]
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_OpenProcess]
cmp eax, esi
mov dword [ebp - 0x1c], eax
je 0x40c309
jmp 0x40c1c3
push 1
pop ebx
push 0x57
mov dword [ebp - 0xc], ebx
push dword [ebp + 8]
mov dword [ebp - 0x24], 0x80000000
call fcn.0040bda0
pop ecx
test eax, eax
pop ecx
je 0x40c1e4
mov dword [ebp - 0x24], 0xc0000000
push 0x72
mov dword [ebp - 8], esi
push dword [ebp + 8]
call fcn.0040bda0
pop ecx
test eax, eax
pop ecx
je 0x40c1fa
mov dword [ebp - 8], ebx
push 0x77
push dword [ebp + 8]
call fcn.0040bda0
pop ecx
test eax, eax
pop ecx
je 0x40c20e
or dword [ebp - 8], 2
push 0x4e
mov dword [ebp - 4], 3
push dword [ebp + 8]
call fcn.0040bda0
pop ecx
test eax, eax
pop ecx
je 0x40c22a
mov dword [ebp - 4], ebx
jmp 0x40c273
push 0x41
push dword [ebp + 8]
call fcn.0040bda0
pop ecx
test eax, eax
pop ecx
je 0x40c243
mov dword [ebp - 4], 2
jmp 0x40c273
push 0x4f
push dword [ebp + 8]
call fcn.0040bda0
pop ecx
test eax, eax
pop ecx
je 0x40c25c
mov dword [ebp - 4], 4
jmp 0x40c273
push 0x54
push dword [ebp + 8]
call fcn.0040bda0
pop ecx
test eax, eax
pop ecx
je 0x40c273
mov dword [ebp - 4], 5
push esi
push dword [ebp - 0x20]
push dword [ebp - 4]
push esi
push dword [ebp - 8]
push dword [ebp - 0x24]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40c309
push 2
push 1
lea eax, [ebp - 0x2c]
push esi
push eax
push dword [ebp - 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x40c2bb
push ebx
xor edi, edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0x2c]
cmp ebx, 0xffffffff
je 0x40c309
lea eax, [ebp - 0x834]
push 0xa
push eax
push esi
call fcn.004142d5
lea eax, [ebp - 0x834]
push eax
call fcn.00413733
lea eax, [ebp + eax*2 - 0x832]
push 0xa
push eax
push ebx
mov dword [ebp + 8], eax
call fcn.004142d5
push dword [ebp + 8]
call fcn.00413733
mov ebx, eax
lea eax, [ebp - 0x834]
push eax
call fcn.00413733
add esp, 0x24
jmp 0x40c360
lea eax, [ebp - 0x834]
push 0xa
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004142d5
lea eax, [ebp - 0x834]
push eax
call fcn.00413733
add esp, 0x10
lea ebx, [ebp + eax*2 - 0x832]
push 0xa
push ebx
call fcn.00413733
pop ecx
lea eax, [ebx + eax*2 + 2]
push eax
push 0xffffffffffffffff
call fcn.004142d5
push ebx
call fcn.00413733
mov ebx, eax
lea eax, [ebp - 0x834]
push eax
call fcn.00413733
add esp, 0x14
add ebx, eax
cmp dword [ebp - 0x1c], esi
lea eax, [ebx + ebx + 4]
mov dword [ebp + 8], eax
je 0x40c5c3
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40c5c3
push ebx
lea eax, [ebp - 0x834]
push str.CREATEKEY
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40c40e
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
mov dword [ebp + 8], eax
je 0x40c5c8
add eax, 2
push ebx
push eax
mov dword [ebp - 0xc], eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
je 0x40c5c8
mov ecx, dword [ebp + 8]
push esi
mov word [ecx], si
mov word [eax], si
mov ax, word [eax + 2]
lea ecx, [ebp - 0x10]
sub ax, 0x31
push ecx
neg ax
sbb eax, eax
push esi
and al, 0
add eax, 0x100
or al, 2
push eax
push esi
push esi
push esi
push dword [ebp - 0xc]
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x40c573
jmp 0x40c56f
push 0xc
lea eax, [ebp - 0x834]
push str.REGSETSTRING
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40c4ca
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
mov dword [ebp + 8], eax
je 0x40c5c8
add eax, 2
push ebx
push eax
mov dword [ebp - 0xc], eax
call fcn.00413ce4
mov ebx, eax
pop ecx
cmp ebx, esi
pop ecx
je 0x40c5c8
mov eax, dword [ebp + 8]
push esi
push esi
push 0xfe
mov word [eax], si
lea eax, [ebp - 0xc3c]
mov edi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push eax
push 0xffffffffffffffff
mov word [ebx], si
push dword [ebp - 0xc]
push esi
push esi
call edi
push esi
push esi
lea eax, [ebp - 0x934]
push 0xfe
push eax
add ebx, 2
push 0xffffffffffffffff
push ebx
push esi
push esi
call edi
cmp dword [ebp - 0x10], esi
je 0x40c573
lea eax, [ebp - 0x934]
push eax
call fcn.00413210
pop ecx
inc eax
push eax
lea eax, [ebp - 0x934]
push eax
push 1
push esi
lea eax, [ebp - 0xc3c]
jmp 0x40c561
push 0xb
lea eax, [ebp - 0x834]
push str.REGSETDWORD
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40c57d
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.00413ce4
pop ecx
cmp eax, esi
pop ecx
mov dword [ebp + 8], eax
je 0x40c5c8
add eax, 2
push 9
push eax
mov dword [ebp - 0xc], eax
call fcn.00413ce4
mov ebx, eax
pop ecx
cmp ebx, esi
pop ecx
je 0x40c5c8
mov eax, dword [ebp + 8]
push esi
push esi
push 0xfe
mov word [eax], si
lea eax, [ebp - 0xd3c]
push eax
push 0xffffffffffffffff
push dword [ebp - 0xc]
mov word [ebx], si
push esi
push esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
add ebx, 2
push ebx
call fcn.00414307
cmp dword [ebp - 0x10], esi
pop ecx
mov dword [ebp - 0x30], eax
je 0x40c573
lea eax, [ebp - 0x30]
push 4
push eax
push 4
push esi
lea eax, [ebp - 0xd3c]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
je 0x40c573
xor edi, edi
jmp 0x40c5c8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x40c5c8
push 8
lea eax, [ebp - 0x834]
push str.CLOSEKEY
push eax
call fcn.00414330
add esp, 0xc
test eax, eax
jne 0x40c5aa
cmp dword [ebp - 0x10], esi
je 0x40c5a5
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x10], esi
jmp 0x40c5c8
lea eax, [ebp - 0x834]
push str.QUIT
push eax
call fcn.00413eff
pop ecx
test eax, eax
pop ecx
jne 0x40c5c8
xor edi, edi
cmp dword [ebp - 0xc], esi
jne 0x40c5ed
lea eax, [ebp - 0x834]
push 0xa
push eax
push edi
call fcn.004142d5
lea eax, [ebp - 0x834]
push eax
call fcn.00413733
lea eax, [eax + eax + 2]
add esp, 0x10
mov dword [ebp + 8], eax
lea eax, [ebp - 0x28]
push esi
push eax
lea eax, [ebp - 0x834]
push dword [ebp + 8]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c624
lea eax, [ebp - 0x834]
push str.QUIT
push eax
call fcn.0041951d
pop ecx
test eax, eax
pop ecx
jne 0x40bf2b
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret