Function at 0x405cf2
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, 0x3b0
mov eax, dword [0x4241a4]
xor eax, esp
mov dword [esp + 0x3ac], eax
push ebx
push ebp
mov ebp, 0x104
lea eax, [esp + 0x1a4]
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push str.lpk.dll
lea eax, [esp + 0x1a8]
push ebp
push eax
call fcn.0040c51d
add esp, 0xc
lea eax, [esp + 0x1a4]
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 + 0x1a8]
push eax
push ebx
call ebp
push str..local
lea eax, [esp + 0x1a8]
push 0x10a
push eax
call fcn.0040c51d
add esp, 0xc
lea eax, [esp + 0x1a4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x405d8c
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push esi
lea eax, [esp + 0x10]
mov dword [esp + 0x10], ebx
push edi
push eax
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
call fcn.00404c78
mov eax, dword [esp + 0x1c]
mov edi, dword [esp + 0x18]
sub eax, edi
pop ecx
push 0x18
cdq
pop ecx
idiv ecx
mov dword [esp + 0x20], eax
test eax, eax
je 0x405dea
mov esi, edi
cmp dword [esi + 0x14], 0x10
jb 0x405dc9
mov eax, dword [esi]
jmp 0x405dcb
mov eax, esi
push eax
push str._run1
call fcn.0040f087
pop ecx
pop ecx
test eax, eax
je 0x405ee5
inc ebx
add esi, 0x18
cmp ebx, dword [esp + 0x20]
jb 0x405dbf
push 0x104
lea eax, [esp + 0xac]
xor ebx, ebx
push eax
push ebx
call ebp
lea eax, [esp + 0x78]
mov dword [esp + 0x8c], 0xf
push eax
mov dword [esp + 0x8c], ebx
mov byte [esp + 0x7c], bl
call fcn.00404dfe
pop ecx
test eax, eax
je 0x405e2c
lea eax, [esp + 0x78]
push eax
call fcn.00404b9f
pop ecx
push 0x10
pop ebp
cmp dword [esp + 0x8c], ebp
lea eax, [esp + 0xa8]
lea esi, [esp + 0x78]
cmovae esi, dword [esp + 0x78]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameA]
push eax
push esi
lea eax, [esp + 0x2c0]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineA]
push 1
lea eax, [esp + 0x2bc]
push eax
lea eax, [esp + 0xb0]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x405fec
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
lea esi, [edi + 0x10]
mov ebx, eax
cmp dword [edi + 0x14], ebp
jb 0x405e8f
mov edi, dword [edi]
push dword [esi]
push edi
push ebx
call fcn.0040f170
add esp, 0xc
lea ecx, [esp + 0x90]
neg eax
sbb al, al
add al, 1
push 0
pop eax
sete al
inc eax
add eax, ebx
add eax, dword [esi]
push eax
call fcn.0040495a
mov esi, str.__run1__shortcut_
push esi
call fcn.0040c590
pop ecx
push eax
push esi
lea ecx, [esp + 0x98]
call fcn.00405721
cmp byte [esp + 0xa8], 0
mov esi, eax
jne 0x405ef6
xor ebx, ebx
mov eax, ebx
jmp 0x405f06
lea ecx, [esp + 0x14]
call fcn.00405610
xor eax, eax
inc eax
jmp 0x406011
lea eax, [esp + 0xa8]
push eax
call fcn.0040c590
pop ecx
xor ebx, ebx
push eax
lea eax, [esp + 0xac]
mov ecx, esi
push eax
call fcn.00405721
mov edi, 0x41c630
mov esi, eax
push edi
call fcn.0040c590
pop ecx
push eax
push edi
mov ecx, esi
call fcn.00405721
mov eax, dword [esp + 0xa0]
inc eax
push eax
call fcn.00408b03
cmp dword [esp + 0xa8], ebp
lea ecx, [esp + 0x94]
mov edi, eax
cmovae ecx, dword [esp + 0x94]
push ecx
mov ecx, dword [esp + 0xa8]
inc ecx
push ecx
push edi
call fcn.0040c4c3
push 0x44
pop esi
push esi
lea eax, [esp + 0x48]
push ebx
push eax
call fcn.004037e9
push ebp
lea eax, [esp + 0x44]
mov dword [esp + 0x54], esi
push ebx
push eax
call fcn.004037e9
add esp, 0x28
lea ecx, [esp + 0x24]
cmp dword [esp + 0x8c], ebp
lea eax, [esp + 0x78]
cmovae eax, dword [esp + 0x78]
push ecx
lea ecx, [esp + 0x38]
push ecx
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push edi
lea eax, [esp + 0x2dc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x405fd6
push 0xffffffffffffffff
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x24]
call esi
push edi
call fcn.00408b0c
pop ecx
push ebx
push 1
lea ecx, [esp + 0x98]
call fcn.0040556e
lea eax, [esp + 0x78]
push eax
call fcn.00404a09
pop ecx
push ebx
push 1
lea ecx, [esp + 0x80]
call fcn.0040556e
lea ecx, [esp + 0x14]
call fcn.00405610
xor eax, eax
mov ecx, dword [esp + 0x3bc]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00408a7f
add esp, 0x3b0
ret