Function at 0x407600
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 0x44fd18
xor edi, edi
push eax
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edi
call esi
test eax, eax
jbe 0x407642
mov eax, dword [0x44fd4c]
cmp eax, edi
je 0x407637
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 0x44fd18
push ecx
call esi
test eax, eax
jbe 0x40768e
mov ecx, dword [esp + 0x70]
call fcn.004075b0
mov dword [esp + 8], eax
cmp eax, edi
jne 0x407687
mov edx, dword [esp + 0x68]
mov dword [edx], 0xfffffffb
mov eax, dword [0x44fd4c]
cmp eax, edi
je 0x40767f
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 0x407627
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 0x4076b1
mov esi, 0x104
push esi
call ebp
add esp, 4
jmp 0x4076bf
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 0x407723
push esi
push edi
push 0
call ebx
cmp eax, esi
je 0x4076a0
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov esi, dword [esp + 0x10]
mov ebp, eax
test esi, esi
jne 0x407752
mov edx, dword [esp + 0x74]
push 0x40f444
push edx
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
test eax, eax
je 0x407706
mov eax, dword [esp + 0x78]
push eax
call fcn.004074c0
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x407756
mov eax, dword [0x44fd4c]
test eax, eax
je 0x407716
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 0x407706
mov ecx, dword [esp + 0x70]
mov dword [ecx], 0xfffffffa
mov eax, dword [0x44fd4c]
test eax, eax
je 0x4078d6
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 0x40776d
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 0x407776
mov ecx, 0x44
lea eax, [esp + 0x28]
mov byte [eax], 0
inc eax
sub ecx, 1
jne 0x407788
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 0x4077ea
test esi, esi
je 0x407706
mov ecx, dword [esp + 0x70]
mov dword [ecx], 0xfffffff8
mov eax, dword [0x44fd4c]
test eax, eax
je 0x4078d6
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 0x40786c
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 0x40783f
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 0x4078ca
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 0x4078ca
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 0x4078b0
mov eax, dword [0x44fd4c]
test eax, eax
je 0x4078a3
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 [0x44fd4c]
test eax, eax
je 0x4078d6
push eax
call esi
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x5c
ret