Function at 0x401523
Capabilities:
Create process on windows
Query environment variable
Terminate process

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x401a08
push 0x401fc3
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x7b0
push ebx
push esi
push edi
mov dword [ebp - 0x590], 0x44
xor ebx, ebx
mov dword [ebp - 0x58c], ebx
push 0xf
pop ecx
xor eax, eax
lea edi, [ebp - 0x588]
rep stosd dword es:[edi], eax
mov dword [ebp - 0x54c], ebx
mov edi, dword [ebp + 8]
mov esi, edi
cmp byte [edi], bl
je 0x401594
movsx eax, byte [esi]
push eax
call dword [sym.imp.MSVCRT.dll__ismbcspace]
pop ecx
test eax, eax
jne 0x401594
push esi
call dword [sym.imp.MSVCRT.dll__mbsinc]
pop ecx
mov esi, eax
cmp byte [esi], bl
jne 0x401577
sub esi, edi
cmp esi, 0x103
ja 0x401c9d
push esi
push edi
lea eax, [ebp - 0x124]
push eax
call dword [sym.imp.MSVCRT.dll__mbsnbcpy]
mov byte [ebp + esi - 0x124], bl
lea eax, [ebp - 0x440]
push eax
lea eax, [ebp - 0x340]
push eax
lea eax, [ebp - 0x540]
push eax
lea eax, [ebp - 0x544]
push eax
lea eax, [ebp - 0x124]
push eax
call dword [sym.imp.MSVCRT.dll__splitpath]
add esp, 0x20
mov byte [ebp - 0x23c], bl
cmp byte [ebp - 0x544], bl
jne 0x401ca7
cmp byte [ebp - 0x540], bl
jne 0x401cdd
cmp byte [ebp - 0x23c], bl
jne 0x401d13
mov dword [ebp - 0x6a0], ebx
push 0x100
lea eax, [ebp - 0x69c]
push eax
call dword [sym.imp.MSVCRT.dll__getcwd]
push 0x4019fc
call dword [sym.imp.MSVCRT.dll_getenv]
add esp, 0xc
mov dword [ebp - 0x59c], eax
cmp eax, ebx
je 0x401d20
cmp byte [ebp - 0x23c], bl
jne 0x401d2f
mov edi, dword [ebp - 0x59c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edx, ecx
lea edi, [ebp - 0x69c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [edx + ecx + 2]
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
pop ecx
mov dword [ebp - 0x598], eax
lea edi, [ebp - 0x69c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [ebp - 0x598]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x4019fa
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, dword [ebp - 0x598]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp - 0x59c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, dword [ebp - 0x598]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp byte [ebp - 0x440], bl
je 0x401d48
mov eax, dword [ebp - 0x6a0]
cmp eax, 5
jae 0x4017c7
lea eax, [eax*4 + 0x403170]
mov dword [ebp - 0x7c0], eax
lea edi, [ebp - 0x440]
lea edx, [ebp - 0x7a0]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edx, [ebp - 0x7a0]
mov eax, dword [ebp - 0x7c0]
mov edi, dword [eax]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebp - 0x594]
push eax
lea eax, [ebp - 0x124]
push eax
push 0x104
lea eax, [ebp - 0x7a0]
push eax
lea eax, [ebp - 0x340]
push eax
push dword [ebp - 0x598]
call dword [sym.imp.KERNEL32.dll_SearchPathA]
test eax, eax
je 0x401d57
lea eax, [ebp - 0x124]
mov dword [ebp - 0x54c], eax
push dword [ebp - 0x598]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
push ebx
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
lea eax, [ebp - 0x134]
push eax
lea eax, [ebp - 0x590]
push eax
push ebx
push ebx
push 0x200
push 1
push ebx
push ebx
push dword [ebp + 8]
push dword [ebp - 0x54c]
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x401d73
mov dword [ebp - 4], ebx
mov eax, dword [ebp - 0x134]
mov dword [0x403168], eax
or esi, 0xffffffff
push esi
push esi
call fcn.00401895
push esi
push ebx
push 0x403164
push 2
pop edi
push edi
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov dword [ebp - 0x138], eax
cmp eax, edi
ja 0x401e59
cmp eax, ebx
je 0x401d7b
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x134]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x401e59
mov dword [ebp - 4], esi
call fcn.0040187e
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 4
call fcn.00401b13
jmp 0x4015a2
lea edi, [ebp - 0x544]
lea edx, [ebp - 0x23c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4015f6
lea edi, [ebp - 0x540]
lea edx, [ebp - 0x23c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40160e
lea edx, [ebp - 0x23c]
mov edi, 0x401b10
jmp 0x401ce9
mov dword [ebp - 0x59c], 0x4019f9
jmp 0x401642
lea eax, [ebp - 0x23c]
push eax
call dword [sym.imp.MSVCRT.dll__strdup]
pop ecx
mov dword [ebp - 0x598], eax
jmp 0x401702
mov dword [ebp - 0x6a0], 1
jmp 0x40170e
add dword [ebp - 0x7c0], 4
cmp dword [ebp - 0x7c0], 0x403184
jge 0x4017c7
jmp 0x40172a
or eax, 0xffffffff
jmp 0x40186d
mov dword [ebp - 0x7ac], ebx
mov dword [ebp - 0x7b0], ebx
push ebx
push 0x80
push 4
push ebx
push ebx
push 0x80000000
push 0x401b04
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x7a8], eax
cmp eax, esi
je 0x401e49
push 1
push edi
mov esi, dword [sym.imp.MSVCRT.dll_signal]
call esi
pop ecx
pop ecx
push ebx
push ebx
push ebx
push ebx
push 4
lea eax, [ebp - 0x12c]
push eax
push 5
push dword [ebp - 0x7a8]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov dword [ebp - 0x7a4], eax
push ebx
push edi
call esi
pop ecx
pop ecx
or esi, 0xffffffff
push dword [ebp - 0x12c]
push 1
pop edi
push edi
call dword [sym.imp.KERNEL32.dll_GenerateConsoleCtrlEvent]
mov dword [ebp - 0x7b4], eax
cmp eax, ebx
je 0x401e51
push 0x4e20
push dword [ebp - 0x134]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
xor ecx, ecx
cmp eax, 0x102
setne cl
mov dword [ebp - 0x7ac], ecx
cmp dword [ebp - 0x7ac], ebx
jne 0x401e37
inc dword [ebp - 0x7b0]
cmp dword [ebp - 0x7b0], edi
jb 0x401de6
push esi
push dword [ebp - 0x134]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x40184a
mov dword [ebp - 0x7a4], ebx
jmp 0x401de6
mov dword [ebp - 0x7ac], edi
jmp 0x401e21
mov dword [ebp - 0x1c], esi
jmp 0x401862