Function at 0x40163d
Capabilities:
Accept command line arguments
Create process on windows
Get common file path
Read .ini file
Read file on windows
Set environment variable
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2b84
call fcn.004021c0
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov esi, 0x206
push esi
mov word [ebp - 0x4f0], ax
xor ebx, ebx
lea eax, [ebp - 0x4ee]
push ebx
push eax
call sub.MSVCR90.dll_memset
xor eax, eax
push esi
mov word [ebp - 0x2e8], ax
lea eax, [ebp - 0x2e6]
push ebx
push eax
call sub.MSVCR90.dll_memset
lea eax, [ebp - 0xb08]
push eax
lea eax, [ebp - 0x4f0]
push eax
call fcn.0040109e
push 0x44
pop esi
push esi
lea eax, [ebp - 0x2b84]
push ebx
push eax
call sub.MSVCR90.dll_memset
add esp, 0x2c
lea eax, [ebp - 0x2b84]
push eax
mov dword [ebp - 0x2b84], esi
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
mov esi, 0x104
push esi
lea eax, [ebp - 0x6f8]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x6f8]
push 0x5c
push eax
call dword [sym.imp.MSVCR90.dll_wcsrchr]
pop ecx
pop ecx
cmp eax, ebx
je 0x401730
mov edi, dword [sym.imp.MSVCR90.dll_wcsncpy]
lea ecx, [ebp - 0x6f8]
sub eax, ecx
sar eax, 1
inc eax
push eax
mov dword [ebp - 0x2b18], eax
mov eax, ecx
push eax
lea eax, [ebp - 0x2e8]
push eax
call edi
mov eax, dword [ebp - 0x2b18]
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp + eax*2 - 0x2e8]
push str.perftune.ini
push eax
call edi
add esp, 0x18
or dword [ebp - 0x2b2c], 0xffffffff
lea eax, [ebp - 0x900]
push eax
push esi
mov dword [ebp - 0x2b14], ebx
mov dword [ebp - 0x2b28], ebx
mov dword [ebp - 0x2b1c], ebx
mov byte [ebp - 0x2b0d], 1
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov dword [ebp - 0x2b20], eax
cmp eax, esi
jb 0x40176e
mov dword [ebp - 0x2b20], ebx
lea eax, [ebp - 0x2e8]
push eax
push 0x20
lea eax, [ebp - 0x60]
push eax
push 0x40328c
push 0x403290
push str.PerformanceTuning
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov ecx, 0x4032e0
lea eax, [ebp - 0x60]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4017be
cmp dx, bx
je 0x4017ba
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4017be
add eax, 4
add ecx, 4
cmp dx, bx
jne 0x401798
xor eax, eax
jmp 0x4017c3
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x401955
lea eax, [ebp - 0x2b30]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x401955
mov esi, dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
lea eax, [ebp - 0x2b24]
push eax
push ebx
push ebx
push 1
push dword [ebp - 0x2b30]
mov dword [ebp - 0x2b24], ebx
call esi
mov eax, dword [ebp - 0x2b24]
call fcn.00402230
mov edi, esp
lea eax, [ebp - 0x2b24]
push eax
push dword [ebp - 0x2b24]
push edi
push 1
push dword [ebp - 0x2b30]
call esi
push dword [ebp - 0x2b30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
xor eax, eax
mov dword [ebp - 0x1c], 0x30
lea edi, [ebp - 0x18]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x2b0c]
push eax
push ecx
mov dword [ebp - 0x2b0c], ebx
call fcn.0040145c
push 0x1000
lea eax, [ebp - 0x2b08]
push 0x4032e8
push eax
call dword [sym.imp.MSVCR90.dll_wcsncpy]
lea eax, [ebp - 0x2b08]
add esp, 0xc
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, bx
jne 0x401883
mov esi, dword [sym.imp.MSVCR90.dll_wcsncat]
sub eax, ecx
sar eax, 1
mov edi, 0xfff
mov ecx, edi
sub ecx, eax
push ecx
push dword [ebp - 0x2b0c]
lea eax, [ebp - 0x2b08]
push eax
call esi
lea eax, [ebp - 0x2b08]
add esp, 0xc
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, bx
jne 0x4018bc
sub eax, ecx
sar eax, 1
mov ecx, edi
sub ecx, eax
push ecx
lea eax, [ebp - 0x2b08]
push str._SingleOfficeIPC_
push eax
call esi
lea eax, [ebp - 0x2b08]
add esp, 0xc
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, bx
jne 0x4018e9
sub eax, ecx
sar eax, 1
sub edi, eax
push edi
push 0xa
lea eax, [ebp - 0x1c]
push eax
push 0x140
call dword [sym.imp.MSVCR90.dll__ultow]
add esp, 0xc
push eax
lea eax, [ebp - 0x2b08]
push eax
call esi
add esp, 0xc
push dword [ebp - 0x2b0c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push ebx
push 0x80
push 3
push ebx
push 3
push 0xc0000000
lea eax, [ebp - 0x2b08]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x2b0c], esi
cmp esi, 0xffffffff
jne 0x401c1b
cmp byte [ebp - 0x2b0d], bl
je 0x4019f3
lea eax, [ebp - 0x2b28]
push eax
call fcn.0040156e
mov edi, eax
mov eax, dword [edi]
pop ecx
mov dword [ebp - 0x2b1c], edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x40197b
sub eax, edx
xor esi, esi
inc esi
sar eax, 1
cmp dword [ebp - 0x2b28], esi
lea ecx, [eax + 2]
mov edx, esi
jle 0x4019cc
jmp 0x4019a1
mov edi, dword [ebp - 0x2b1c]
mov eax, dword [edi + edx*4]
lea edi, [eax + 2]
mov dword [ebp - 0x2b14], edi
mov di, word [eax]
inc eax
inc eax
cmp di, bx
jne 0x4019ad
sub eax, dword [ebp - 0x2b14]
sar eax, 1
inc edx
cmp edx, dword [ebp - 0x2b28]
lea ecx, [ecx + eax + 3]
jl 0x40199b
mov eax, dword [ebp - 0x2b20]
lea eax, [ecx + eax*4 + 0x12]
xor ecx, ecx
push 2
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
pop ecx
mov dword [ebp - 0x2b14], eax
jmp 0x4019f6
xor esi, esi
inc esi
push esi
push 0x40336c
push dword [ebp - 0x2b14]
call fcn.0040138e
mov ecx, dword [ebp - 0x2b1c]
push dword [ecx]
push eax
call fcn.004013b1
add esp, 0x14
cmp dword [ebp - 0x2b28], esi
mov dword [ebp - 0x2b0c], eax
mov edi, esi
jle 0x401a80
cmp byte [ebp - 0x2b0d], bl
jne 0x401a4d
mov eax, dword [ebp - 0x2b1c]
push 5
push 0x403370
push dword [eax + edi*4]
call dword [sym.imp.MSVCR90.dll_wcsncmp]
add esp, 0xc
test eax, eax
jne 0x401a77
push 3
push 0x40337c
push dword [ebp - 0x2b0c]
call fcn.0040138e
mov ecx, dword [ebp - 0x2b1c]
push dword [ecx + edi*4]
push eax
call fcn.004013b1
add esp, 0x14
mov dword [ebp - 0x2b0c], eax
inc edi
cmp edi, dword [ebp - 0x2b28]
jl 0x401a28
push 0x10
push str.____env:OOO_CWD
push dword [ebp - 0x2b0c]
call fcn.0040138e
add esp, 0xc
push esi
cmp dword [ebp - 0x2b20], ebx
jne 0x401aae
push 0x4033a8
push eax
call fcn.0040138e
add esp, 0xc
jmp 0x401ac9
push 0x4033ac
push eax
call fcn.0040138e
lea ecx, [ebp - 0x900]
push ecx
push eax
call fcn.004013d9
add esp, 0x14
push esi
push 0x4033b0
push eax
call fcn.0040138e
lea eax, [ebp - 0x2b18]
push eax
mov byte [ebp - 0x2b0d], bl
mov dword [ebp - 0x2b0c], ebx
call fcn.0040156e
add esp, 0x10
cmp dword [ebp - 0x2b18], esi
mov dword [ebp - 0x2b24], eax
jle 0x401b2c
mov edi, esi
mov eax, dword [ebp - 0x2b24]
push 9
push 0x4033b4
push dword [eax + edi*4]
call dword [sym.imp.MSVCR90.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x401b23
mov dword [ebp - 0x2b0c], esi
inc edi
cmp edi, dword [ebp - 0x2b18]
jl 0x401b00
push 0xa
lea eax, [ebp - 0xe0]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
call dword [sym.imp.MSVCR90.dll__ltow]
add esp, 0xc
test eax, eax
je 0x401b63
cmp dword [ebp - 0x2b0c], ebx
je 0x401b63
lea eax, [ebp - 0xe0]
push eax
push str.ATTACHED_PARENT_PROCESSID
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
lea eax, [ebp - 0x2b40]
push eax
lea eax, [ebp - 0x2b84]
push eax
lea eax, [ebp - 0xb08]
push eax
push ebx
push ebx
push esi
push ebx
push ebx
push dword [ebp - 0x2b14]
lea eax, [ebp - 0x4f0]
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov edi, eax
cmp edi, ebx
je 0x401bfc
push 0x4bf
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x2b40]
push eax
push esi
call dword [sym.imp.USER32.dll_MsgWaitForMultipleObjects]
cmp eax, esi
jne 0x401bc0
push esi
push ebx
push ebx
push ebx
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.USER32.dll_PeekMessageW]
jmp 0x401b96
lea eax, [ebp - 0x2b2c]
push eax
push dword [ebp - 0x2b40]
mov dword [ebp - 0x2b2c], ebx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
push dword [ebp - 0x2b40]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0x2b3c]
call esi
cmp dword [ebp - 0x2b2c], 0x4f
je 0x40176e
push dword [ebp - 0x2b14]
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
pop ecx
cmp edi, ebx
je 0x401d4c
mov eax, dword [ebp - 0x2b2c]
jmp 0x401d4f
lea eax, [ebp - 0x2b18]
push eax
mov dword [ebp - 0x2b18], ebx
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
mov dword [ebp - 0x2b1c], eax
lea eax, [ebp - 0x2b14]
push eax
push 0x16
push str.InternalIPC::Arguments
push esi
call edi
mov ebx, eax
test ebx, ebx
je 0x401c8e
cmp dword [ebp - 0x2b20], 0
jbe 0x401c79
lea eax, [ebp - 0x900]
push eax
push 0x32
push esi
call fcn.00401583
add esp, 0xc
movzx ebx, al
jmp 0x401c8e
push 0
lea eax, [ebp - 0x2b14]
push eax
push 1
push 0x40334c
push esi
call edi
mov ebx, eax
xor esi, esi
inc esi
test ebx, ebx
je 0x401d36
cmp esi, dword [ebp - 0x2b18]
jge 0x401cc2
mov eax, dword [ebp - 0x2b1c]
push dword [eax + esi*4]
push 0x2c
push dword [ebp - 0x2b0c]
call fcn.00401583
movzx ebx, al
add esp, 0xc
inc esi
test ebx, ebx
jne 0x401c99
test ebx, ebx
je 0x401d36
push 0
lea eax, [ebp - 0x2b14]
push eax
push 1
push 0x40320e
push dword [ebp - 0x2b0c]
call edi
mov ebx, eax
test ebx, ebx
je 0x401d36
and dword [ebp - 0x2b20], 0
push 0x1c
pop eax
call fcn.004021c0
mov edi, esp
push 0
lea eax, [ebp - 0x2b20]
push eax
push 0x1b
push edi
push dword [ebp - 0x2b0c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebx, eax
test ebx, ebx
je 0x401d36
mov eax, dword [ebp - 0x2b20]
mov byte [edi + eax], 0
push 0x1c
mov esi, str.InternalIPC::ProcessingDone
pop ecx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x401d30
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x401d36
xor ebx, ebx
push dword [ebp - 0x2b0c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
test ebx, ebx
setne al
dec eax
jmp 0x401d4f
or eax, 0xffffffff
lea esp, [ebp - 0x2b90]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004021ac
leave
ret 0x10