Function at 0x401d50
Capabilities:
Move file
Set current directory

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov esi, dword [esp + 0x50]
mov ebx, dword [esp + 0x54]
cmp esi, 5
jg 0x401d70
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebx + 4]
mov dword [esp + 0x24], eax
mov eax, dword [ebx + 8]
mov dword [esp + 0x28], eax
mov eax, dword [ebx + 0xc]
mov dword [esp], eax
call sym._atoi
mov dword [esp + 0x20], eax
mov eax, dword [ebx + 0x10]
mov dword [esp], eax
call sym._atoi
mov edx, dword [ebx + 0x14]
mov edi, dword [ebx + 0x18]
mov dword [0x40c068], 0
mov dword [0x40c06c], edx
cmp eax, 1
je 0x401dbf
mov dword [esp], 0
call sym.unk_10
mov dword [esp], 0x40a162
xor ebp, ebp
call sym.unk_10
mov dword [esp], str._______________________
call sym.unk_10
mov dword [esp], str.STARTING
call sym.unk_10
mov dword [esp + 4], esi
mov dword [esp], str.Arguments:__d_n
call sym.unk_10
lea esi, [esi]
mov eax, dword [ebx + ebp*4]
mov dword [esp + 4], ebp
add ebp, 1
mov dword [esp], str.Argument__d:__s
mov dword [esp + 8], eax
call sym.unk_10
cmp esi, ebp
jne 0x401df8
mov dword [0x40c048], 0x30
mov dword [0x40c04c], 4
mov dword [0x40c050], 5
mov dword [0x40c054], 0
mov dword [0x40c058], 0
mov dword [0x40c05c], 0
mov dword [0x40c060], 0
mov dword [esp + 4], sym.unk_11
mov dword [esp], 0x40a162
call dword [sym.imp.ADVAPI32.dll_RegisterServiceCtrlHandlerA]
sub esp, 8
mov dword [0x40c044], eax
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
mov dword [esp + 4], 0x40c048
mov dword [esp + 0x2c], eax
call eax
mov edx, dword [0x40c044]
sub esp, 8
test edx, edx
je 0x402098
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
sub esp, 4
mov edi, dword [esp + 0x28]
mov dword [esp], str.Opening_temporary_output_file:__s
mov dword [esp + 4], edi
call sym.unk_10
mov dword [esp + 8], 0x40a1de
mov dword [esp + 4], edi
mov dword [esp], 0x40c064
call dword [sym.imp.msvcrt.dll_fopen_s]
mov ebp, eax
test eax, eax
jne 0x402050
mov eax, dword [esp + 0x20]
mov dword [esp + 0x1c], str.true
add ebx, 0x1c
test eax, eax
jle 0x401f66
lea esi, [esi]
lea esi, [esi]
mov esi, dword [ebx + 0xc]
mov edi, dword [esp + 0x1c]
mov ecx, 5
mov dword [esp + 0x1c], str.true
repe cmpsb byte [esi], byte es:[edi]
mov esi, dword [ebx + 8]
mov ecx, 5
mov edi, str.true
seta al
sbb al, 0
repe cmpsb byte [esi], byte es:[edi]
mov ecx, dword [ebx + 4]
mov esi, dword [ebx + 0x10]
mov dword [esp + 8], esi
seta dl
sbb dl, 0
test al, al
sete al
movzx eax, al
mov dword [esp + 4], eax
xor eax, eax
test dl, dl
sete al
add ebx, 0x14
mov dword [esp], eax
mov edx, dword [ebx - 0x14]
mov eax, ebp
add ebp, 1
call sym._go
cmp dword [esp + 0x20], ebp
jne 0x401f00
mov eax, dword [0x40c064]
mov dword [esp], eax
call sym._fclose
test eax, eax
jne 0x402030
mov eax, dword [esp + 0x24]
mov ebp, dword [esp + 0x28]
mov ebx, 9
mov dword [esp], str.Renaming_file__s____s
mov dword [esp + 8], eax
mov dword [esp + 4], ebp
call sym.unk_10
mov edi, dword [sym.imp.msvcrt.dll__errno]
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
lea esi, [esi]
nop
mov eax, dword [esp + 0x24]
mov dword [esp], ebp
mov dword [esp + 4], eax
call sym._rename
test eax, eax
je 0x402080
call edi
mov dword [esp + 8], ebx
mov eax, dword [eax]
mov dword [esp], str.Couldnt_rename_file:__d__will_try__d_more_times_
mov dword [esp + 4], eax
call sym.unk_10
mov dword [esp], 0x3e8
call esi
sub esp, 4
sub ebx, 1
jae 0x401fb0
mov dword [0x40c04c], 1
mov dword [0x40c054], 0
mov eax, dword [0x40c044]
mov dword [esp + 4], 0x40c048
mov dword [esp], eax
mov eax, dword [esp + 0x2c]
call eax
sub esp, 8
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov dword [esp], str.Couldnt_close_the_file:__d
mov dword [esp + 4], eax
call sym.unk_10
jmp 0x401f7b
mov dword [esp + 4], eax
mov dword [esp], str.Couldnt_open_output_file:__d
call sym.unk_10
mov dword [0x40c04c], 1
mov dword [0x40c054], 0xffffffff
jmp 0x402005
mov dword [esp], str.File_successfully_renamed_
call sym.unk_10
jmp 0x401ff1
mov dword [esp], str.Service_failed_to_start
call sym.unk_10
mov dword [0x40c04c], 1
mov dword [0x40c054], 0xffffffff
jmp 0x402005