Function at 0x407340
Capabilities:
Accept command line arguments
Create process on windows
Query environment variable
Resume thread
Set environment variable
Terminate process

Disassembly:
sub esp, 0x5c
mov eax, dword [esp + 0x6c]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
push edi
push 0x32
push 0x414868
xor edi, edi
push eax
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edi
call esi
test eax, eax
jbe 0x407382
mov eax, dword [0x41489c]
cmp eax, edi
je 0x407377
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov eax, 1
pop esi
add esp, 0x5c
ret
mov ecx, dword [esp + 0x6c]
push 0x32
push 0x414868
push ecx
call esi
test eax, eax
jbe 0x4073ce
mov ecx, dword [esp + 0x70]
call fcn.004072f0
mov dword [esp + 8], eax
cmp eax, edi
jne 0x4073c7
mov edx, dword [esp + 0x68]
mov dword [edx], 0xfffffffb
mov eax, dword [0x41489c]
cmp eax, edi
je 0x4073bf
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
xor eax, eax
pop esi
add esp, 0x5c
ret
mov eax, dword [eax + 8]
test eax, eax
jne 0x407367
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push ebp
mov ebp, dword [sym.imp.msvcrt.dll_malloc]
xor esi, esi
xor eax, eax
test esi, esi
jne 0x4073f1
mov esi, 0x104
push esi
call ebp
add esp, 4
jmp 0x4073ff
lea esi, [eax + eax]
push esi
push edi
call dword [sym.imp.msvcrt.dll_realloc]
add esp, 8
mov edi, eax
test edi, edi
je 0x407463
push esi
push edi
push 0
call ebx
cmp eax, esi
je 0x4073e0
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov esi, dword [esp + 0x10]
mov ebp, eax
test esi, esi
jne 0x407492
mov edx, dword [esp + 0x74]
push 0x40f434
push edx
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
test eax, eax
je 0x407446
mov eax, dword [esp + 0x78]
push eax
call fcn.00407200
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x407496
mov eax, dword [0x41489c]
test eax, eax
je 0x407456
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebp
pop ebx
pop edi
mov eax, 1
pop esi
add esp, 0x5c
ret
cmp dword [esp + 0x10], 0
je 0x407446
mov ecx, dword [esp + 0x70]
mov dword [ecx], 0xfffffffa
mov eax, dword [0x41489c]
test eax, eax
je 0x407616
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x5c
ret
mov ebx, dword [esp + 0x14]
mov edx, 0x1000200
test esi, esi
je 0x4074ad
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [esi + 8], eax
mov edx, 0x1000204
mov ecx, 0x10
lea eax, [esp + 0x18]
mov byte [eax], 0
inc eax
sub ecx, 1
jne 0x4074b6
mov ecx, 0x44
lea eax, [esp + 0x28]
mov byte [eax], 0
inc eax
sub ecx, 1
jne 0x4074c8
lea ecx, [esp + 0x18]
push ecx
lea eax, [esp + 0x2c]
push eax
push 0
push 0
push edx
push 1
push 0
push 0
push ebp
push edi
mov dword [esp + 0x50], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x40752a
test esi, esi
je 0x407446
mov ecx, dword [esp + 0x70]
mov dword [ecx], 0xfffffff8
mov eax, dword [0x41489c]
test eax, eax
je 0x407616
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x5c
ret
test esi, esi
je 0x4075ac
mov eax, dword [esi]
mov ecx, dword [esp + 0x18]
push 2
push 1
push 0
lea edx, [esi + 0xc]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x40757f
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov eax, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [esp + 0x1c]
push ecx
call esi
mov edx, dword [esp + 0x70]
mov dword [edx], 0
jmp 0x40760a
mov eax, dword [esp + 0x18]
push 0xfffffffffffffff7
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov ecx, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [esp + 0x1c]
push edx
call esi
mov eax, dword [esp + 0x70]
mov dword [eax], 0xfffffff6
jmp 0x40760a
mov ecx, dword [esp + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [esp + 0x18]
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0xffffffffffffffff
push edx
call edi
mov eax, dword [esp + 0x18]
push eax
call esi
mov eax, dword [ebx + 0xc]
cmp eax, 0xffffffff
jne 0x4075f0
mov eax, dword [0x41489c]
test eax, eax
je 0x4075e3
push eax
call esi
pop ebp
pop ebx
pop edi
mov eax, 1
pop esi
add esp, 0x5c
ret
push 0xffffffffffffffff
push eax
call edi
mov ecx, dword [esp + 0x70]
mov edx, dword [ebx + 0xc]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
mov eax, dword [ebx + 0xc]
push eax
call esi
mov eax, dword [0x41489c]
test eax, eax
je 0x407616
push eax
call esi
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x5c
ret