Function at 0x407580
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 0x4dfb70
xor edi, edi
push eax
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edi
call esi
test eax, eax
jbe 0x4075c2
mov eax, dword [0x4dfba4]
cmp eax, edi
je 0x4075b7
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 0x4dfb70
push ecx
call esi
test eax, eax
jbe 0x40760e
mov ecx, dword [esp + 0x70]
call fcn.00407530
mov dword [esp + 8], eax
cmp eax, edi
jne 0x407607
mov edx, dword [esp + 0x68]
mov dword [edx], 0xfffffffb
mov eax, dword [0x4dfba4]
cmp eax, edi
je 0x4075ff
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 0x4075a7
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 0x407631
mov esi, 0x104
push esi
call ebp
add esp, 4
jmp 0x40763f
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 0x4076a3
push esi
push edi
push 0
call ebx
cmp eax, esi
je 0x407620
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov esi, dword [esp + 0x10]
mov ebp, eax
test esi, esi
jne 0x4076d2
mov edx, dword [esp + 0x74]
push 0x42a73c
push edx
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
test eax, eax
je 0x407686
mov eax, dword [esp + 0x78]
push eax
call fcn.00407440
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4076d6
mov eax, dword [0x4dfba4]
test eax, eax
je 0x407696
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 0x407686
mov ecx, dword [esp + 0x70]
mov dword [ecx], 0xfffffffa
mov eax, dword [0x4dfba4]
test eax, eax
je 0x407856
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 0x4076ed
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 0x4076f6
mov ecx, 0x44
lea eax, [esp + 0x28]
mov byte [eax], 0
inc eax
sub ecx, 1
jne 0x407708
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 0x40776a
test esi, esi
je 0x407686
mov ecx, dword [esp + 0x70]
mov dword [ecx], 0xfffffff8
mov eax, dword [0x4dfba4]
test eax, eax
je 0x407856
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 0x4077ec
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 0x4077bf
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 0x40784a
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 0x40784a
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 0x407830
mov eax, dword [0x4dfba4]
test eax, eax
je 0x407823
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 [0x4dfba4]
test eax, eax
je 0x407856
push eax
call esi
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x5c
ret