Function at 0x10005bfc
Capabilities:
Check if file exists
Create process on windows
Delete file
Get common file path
Get file attributes
Query environment variable
Set current directory
Set environment variable
Set file attributes

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff3a4
push esi
push edi
push ebx
mov dword [ebp - 4], 0
mov esi, dword [ebp + 8]
test dword [esi + 0xd], 0x20
je 0x10005c20
call fcn.100040df
lea edi, [esi + 0x421]
push 0x400
lea eax, [ebp - 0x405]
push eax
push edi
call sub.kernel32.dll_ExpandEnvironmentStringsA
push 0x400
push 0x1000d8f1
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsA
push esi
mov esi, 0x1000d8f1
mov bl, 0
jmp 0x10005c76
lodsb al, byte [esi]
cmp al, 0x25
jne 0x10005c76
push 0x1000d8f1
call fcn.10006f00
push eax
push 0x1000d8f1
call sub.kernel32.dll_lstrcpyA
mov bl, 1
jmp 0x10005c7b
cmp byte [esi], 0
jne 0x10005c58
pop esi
mov edi, 0x1000d8f1
cmp byte [edi + 1], 0x3a
je 0x10005cd6
push 0x400
lea eax, [ebp - 0x405]
push eax
push 0
call sub.kernel32.dll_GetModuleFileNameA
lea eax, [ebp - 0x405]
push eax
call fcn.1000226a
cmp byte [edi], 0x5c
je 0x10005cbc
push 0x1000d795
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcatA
push edi
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcatA
lea eax, [ebp - 0x405]
push eax
push edi
call sub.kernel32.dll_lstrcpyA
push 0x400
push 0x1001e625
push 5
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x1001e625
call sym.dup2patcher.dll_AddMsg
push edi
call sym.dup2patcher.dll_AddMsg
cmp bl, 1
je 0x10005d0b
test dword [esi + 0xd], 1
je 0x10005d58
cmp byte [0x1000e93c], 0
jne 0x10005d4e
push edi
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcpyA
lea eax, [ebp - 0x405]
push eax
call fcn.1000226a
push edi
call fcn.10006f00
push eax
push dword [0x1000d886]
lea eax, [ebp - 0x405]
push eax
push str.All_Files
push edi
call fcn.10007160
jmp 0x10005d50
xor eax, eax
test al, al
je 0x1000608e
mov byte [ebp - 5], 0
push edi
call sub.kernel32.dll_GetFileAttributesA
cmp eax, 0xffffffff
je 0x10005e23
test dword [esi + 0xd], 0x10
je 0x10005d76
jmp 0x10005dc5
cmp byte [0x1000e93c], 0
jne 0x10005dab
push 0x400
push 0x1001ea25
push 0x29
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x24
push edi
push 0x1001ea25
push dword [0x1000d886]
call sub.user32.dll_MessageBoxA
jmp 0x10005dc0
cmp byte [0x1000e93e], 1
jne 0x10005dbb
mov eax, 6
jmp 0x10005dc0
mov eax, 7
cmp eax, 6
jne 0x10005dfd
mov byte [ebp - 5], 1
push edi
call fcn.10002313
push 0x80
push edi
call sub.kernel32.dll_SetFileAttributesA
push 0x400
push 0x1001ee25
push 0x2a
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x1001ee25
call sym.dup2patcher.dll_AddMsg
jmp 0x10005e23
push 0x400
push 0x1001f225
push 0x2b
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x1001f225
call sym.dup2patcher.dll_AddMsg
jmp 0x1000608e
cmp byte [edi + 1], 0x3a
jne 0x10005e54
cmp byte [edi + 2], 0x5c
jne 0x10005e54
push edi
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcpyA
lea eax, [ebp - 0x405]
push eax
call fcn.1000226a
lea eax, [ebp - 0x405]
push eax
call fcn.100071d0
mov eax, dword [esi + 5]
lea eax, [eax + esi]
push dword [esi + 1]
push eax
push edi
call sym.dup2patcher.dll_write_disk_file
or eax, eax
jne 0x10005e9d
push edi
call sub.kernel32.dll_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x1000608e
push 0x400
push 0x1001f625
push 0x2b
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x1001f625
call sym.dup2patcher.dll_AddMsg
jmp 0x1000608e
mov eax, dword [esi + 9]
or eax, eax
je 0x10005ed1
push eax
push edi
call sub.kernel32.dll_SetFileAttributesA
cmp eax, 1
jne 0x10005ed1
push 0x400
push 0x1001fa25
push 0x2c
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x1001fa25
call sym.dup2patcher.dll_AddMsg
test dword [esi + 0xd], 2
je 0x10006066
push 0x400
push 0x1001fe25
push 0x2d
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x1001fe25
call sym.dup2patcher.dll_AddMsg
cmp byte [edi + 1], 0x3a
jne 0x10005f2a
push edi
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcpyA
lea eax, [ebp - 0x405]
push eax
call fcn.1000226a
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_SetCurrentDirectoryA
lea ebx, [esi + 0x21]
cmp byte [ebx], 0
jne 0x10005f36
xor ebx, ebx
jmp 0x10005f4e
push 0x400
lea eax, [ebp - 0x805]
push eax
push ebx
call sub.kernel32.dll_ExpandEnvironmentStringsA
lea ebx, [ebp - 0x805]
test dword [esi + 0xd], 4
je 0x10006024
push 0x44
lea eax, [ebp - 0xc4c]
push eax
call sub.kernel32.dll_RtlZeroMemory
push 0x10
lea eax, [ebp - 0xc5c]
push eax
call sub.kernel32.dll_RtlZeroMemory
push 0x1000d7a6
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcpyA
cmp byte [edi + 1], 0x3a
je 0x10005fc3
lea eax, [ebp - 0xc05]
push eax
push 0x400
call sub.kernel32.dll_GetCurrentDirectoryA
lea eax, [ebp - 0xc05]
push eax
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcatA
push 0x1000d7a8
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcatA
push edi
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcatA
push 0x1000d7aa
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcatA
push ebx
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcatA
lea eax, [ebp - 0xc5c]
push eax
lea eax, [ebp - 0xc4c]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x405]
push eax
push edi
call sub.kernel32.dll_CreateProcessA
push 0xffffffffffffffff
push dword [ebp - 0xc5c]
call sub.kernel32.dll_WaitForSingleObject
jmp 0x10006036
push 0xa
push 0
push ebx
push edi
push str.open
push 0
call sub.shell32.dll_ShellExecuteA
test dword [esi + 0xd], 8
je 0x10006066
push 0x400
push 0x10020225
push 0x2e
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x10020225
call sym.dup2patcher.dll_AddMsg
push edi
call sub.kernel32.dll_DeleteFileA
push 0x400
push 0x10020625
push 0x2f
push dword [0x1000d882]
call sub.user32.dll_LoadStringA
push 0x10020625
call sym.dup2patcher.dll_AddMsg
mov dword [ebp - 4], 1
cmp byte [ebp - 5], 0
je 0x1000609c
push dword [ebp - 4]
call fcn.10002368
push edi
push str.dup2_last_file
call sub.kernel32.dll_SetEnvironmentVariableA
push edi
lea eax, [ebp - 0x405]
push eax
call sub.kernel32.dll_lstrcpyA
lea eax, [ebp - 0x405]
push eax
call fcn.1000226a
lea eax, [ebp - 0x405]
push eax
push str.dup2_last_path
call sub.kernel32.dll_SetEnvironmentVariableA
test dword [esi + 0xd], 0x20
je 0x100060df
call fcn.1000410a
mov eax, dword [ebp - 4]
pop ebx
pop edi
pop esi
leave
ret 4