Function at 0x401540
Capabilities:
Create process on windows
Get common file path

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0xac
mov edi, dword [esp + 0xc4]
mov ebp, dword [esp + 0xc0]
cmp word [edi], 0
je 0x401742
lea eax, [ebp - 0x44]
cmp ax, 1
jbe 0x401575
cmp bp, 0x54
jne 0x401742
mov esi, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [esp + 4], 0x800
mov dword [esp], 0x40
call esi
sub esp, 8
mov ebx, eax
mov dword [esp + 4], 0x800
mov dword [esp], 0x40
call esi
sub esp, 8
mov esi, eax
cmp bp, 0x45
je 0x401750
mov edx, dword [esp + 0xc8]
test edx, edx
jne 0x401710
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
sub esp, 4
mov dword [esp + 8], 0x400
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
sub esp, 0xc
test eax, eax
je 0x40172c
movzx ebp, bp
mov dword [esp + 0x10], edi
lea edi, [esp + 0x60]
mov dword [esp + 0xc], ebp
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x404048
mov dword [esp], esi
call dword [sym.imp.USER32.dll_wsprintfW]
mov eax, dword [esp + 0xc8]
mov ecx, 0x10
mov dword [esp + 0x5c], 0x44
rep stosd dword es:[edi], eax
lea eax, [esp + 0x4c]
mov dword [esp + 4], esi
mov dword [esp + 0x24], eax
lea eax, [esp + 0x5c]
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
sub esp, 0x28
test eax, eax
je 0x40172c
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 8
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
call edi
sub esp, 4
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call edi
sub esp, 4
mov eax, dword [esp + 0xc8]
test eax, eax
je 0x40172c
mov eax, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebp, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [esp + 0x3c], eax
mov dword [esp], str.KERNEL32
call ebp
sub esp, 4
mov dword [esp], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], str.Wow64EnableWow64FsRedirection
call eax
sub esp, 8
test eax, eax
je 0x40172c
mov dword [esp], 1
call eax
sub esp, 4
jmp 0x40172c
mov dword [esp + 4], 0x400
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
sub esp, 8
test eax, eax
jne 0x4017e0
mov dword [esp], ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalFree]
call ebx
sub esp, 4
mov dword [esp], esi
call ebx
sub esp, 4
add esp, 0xac
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], edi
lea edi, [esp + 0x60]
mov dword [esp + 4], 0x404028
mov dword [esp], eax
call dword [sym.imp.USER32.dll_wsprintfW]
xor eax, eax
mov ecx, 0x10
mov dword [esp + 0x5c], 0x44
rep stosd dword es:[edi], eax
lea eax, [esp + 0x4c]
mov dword [esp + 4], esi
mov dword [esp + 0x24], eax
lea eax, [esp + 0x5c]
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
sub esp, 0x28
test eax, eax
je 0x4016bc
jmp 0x401686
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x404060
mov dword [esp], esi
call dword [sym.imp.USER32.dll_wsprintfW]
mov dword [esp], str.KERNEL32
mov ebp, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
call ebp
sub esp, 4
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esp + 4], str.Wow64EnableWow64FsRedirection
mov dword [esp + 0x3c], eax
call eax
sub esp, 8
test eax, eax
je 0x401834
mov dword [esp], 0
call eax
sub esp, 4
lea edi, [esp + 0x60]
xor eax, eax
mov ecx, 0x10
mov dword [esp + 0x5c], 0x44
rep stosd dword es:[edi], eax
lea eax, [esp + 0x4c]
mov dword [esp + 4], esi
mov dword [esp + 0x24], eax
lea eax, [esp + 0x5c]
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
sub esp, 0x28
test eax, eax
je 0x4016d6
jmp 0x401686