Function at 0x40589e
Capabilities:
Accept command line arguments
Check if file exists
Copy file
Create process on windows
Get common file path
Get file attributes
Terminate process

Disassembly:
sub esp, 0x3ac
mov eax, dword [0x4271a0]
xor eax, esp
mov dword [esp + 0x3a8], eax
push ebx
push ebp
mov ebp, 0x104
lea eax, [esp + 0x9c]
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push str.lpk.dll
lea eax, [esp + 0xa0]
push ebp
push eax
call fcn.0040c1ac
add esp, 0xc
lea eax, [esp + 0x9c]
xor ebx, ebx
push 8
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0xa0]
push eax
push ebx
call ebp
push str..local
lea eax, [esp + 0xa0]
push 0x10a
push eax
call fcn.0040c1ac
add esp, 0xc
lea eax, [esp + 0x9c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x405938
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push esi
lea eax, [esp + 0xc]
mov dword [esp + 0xc], ebx
push edi
push eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ebx
call fcn.00405286
mov eax, dword [esp + 0x18]
mov edi, ebx
mov ebx, dword [esp + 0x14]
sub eax, ebx
pop ecx
push 0x18
cdq
pop ecx
idiv ecx
mov dword [esp + 0x1c], eax
test eax, eax
je 0x405996
mov esi, ebx
cmp dword [esi + 0x14], 0x10
mov eax, esi
jb 0x405977
mov eax, dword [esi]
push eax
push str._run1
call fcn.004108e5
pop ecx
pop ecx
test eax, eax
je 0x405bb3
inc edi
add esi, 0x18
cmp edi, dword [esp + 0x1c]
jb 0x40596d
push 0x104
lea eax, [esp + 0x1b4]
push eax
push 0
call ebp
xor eax, eax
lea edi, [esp + 0x74]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [esp + 0x74]
and dword [esp + 0x84], 0
push eax
mov dword [esp + 0x8c], 0xf
mov byte [esp + 0x78], 0
call fcn.004053fb
pop ecx
test eax, eax
je 0x4059e3
lea eax, [esp + 0x74]
push eax
call fcn.004051c2
pop ecx
push 0x10
pop ebp
cmp dword [esp + 0x88], ebp
lea eax, [esp + 0x1b0]
lea esi, [esp + 0x74]
cmovae esi, dword [esp + 0x74]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameA]
push eax
push esi
lea eax, [esp + 0x2bc]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineA]
push 1
lea eax, [esp + 0x2b8]
push eax
lea eax, [esp + 0x1b8]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x405b7b
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov esi, ebx
mov edi, eax
cmp dword [esi + 0x14], ebp
jb 0x405a45
mov ebx, dword [ebx]
push dword [esi + 0x10]
push ebx
push edi
call fcn.004109c0
xor ecx, ecx
add esp, 0xc
test eax, eax
setne cl
inc edi
add ecx, edi
add ecx, dword [esi + 0x10]
push ecx
lea ecx, [esp + 0x90]
call fcn.00404e45
mov esi, str.__run1__shortcut_
push esi
call fcn.0040c210
pop ecx
push eax
push esi
lea ecx, [esp + 0x94]
call fcn.00405754
mov esi, eax
lea eax, [esp + 0x1b0]
push eax
call fcn.0040c210
pop ecx
push eax
lea eax, [esp + 0x1b4]
mov ecx, esi
push eax
call fcn.00405754
mov edi, 0x41e690
mov esi, eax
push edi
call fcn.0040c210
pop ecx
push eax
push edi
mov ecx, esi
call fcn.00405754
mov eax, dword [esp + 0x9c]
inc eax
push eax
call fcn.00408809
cmp dword [esp + 0xa4], ebp
lea ecx, [esp + 0x90]
mov edi, eax
cmovae ecx, dword [esp + 0x90]
push ecx
mov ecx, dword [esp + 0xa4]
inc ecx
push ecx
push edi
call fcn.0040c152
push 0x44
pop esi
push esi
xor ebx, ebx
lea eax, [esp + 0x44]
push ebx
push eax
call fcn.004037f6
push ebp
lea eax, [esp + 0x40]
mov dword [esp + 0x50], esi
push ebx
push eax
call fcn.004037f6
add esp, 0x28
lea ecx, [esp + 0x20]
cmp dword [esp + 0x88], ebp
lea eax, [esp + 0x74]
cmovae eax, dword [esp + 0x74]
push ecx
lea ecx, [esp + 0x34]
push ecx
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push edi
lea eax, [esp + 0x2d8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x405b68
push 0xffffffffffffffff
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x20]
call esi
push edi
call fcn.00408812
pop ecx
lea ecx, [esp + 0x8c]
call fcn.004056a4
lea eax, [esp + 0x74]
push eax
call fcn.00405022
pop ecx
lea ecx, [esp + 0x74]
call fcn.004056a4
lea ecx, [esp + 0x10]
call fcn.00405634
xor eax, eax
mov ecx, dword [esp + 0x3b8]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00408783
add esp, 0x3ac
ret
lea ecx, [esp + 0x10]
call fcn.00405634
xor eax, eax
inc eax
jmp 0x405b9a