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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x30], 0
test ebx, ebx
je 0x40283c
mov eax, dword [ebx]
mov dword [ebp - 0x30], eax
test eax, eax
je 0x40283c
xor edi, edi
mov edx, edi
add edi, 1
mov esi, dword [ebx + edi*4]
lea ecx, [edi*4]
test esi, esi
jne 0x402773
lea eax, [ecx + 0x1b]
mov dword [ebp - 0x28], edx
shr eax, 4
shl eax, 4
call fcn.00405d40
sub esp, eax
lea esi, [esp + 0x37]
mov dword [esp + 8], ecx
and esi, 0xfffffff0
mov dword [esp + 4], ebx
mov dword [esp], esi
mov dword [ebp - 0x2c], esi
call sub.msvcrt.dll_memcpy
mov dword [esp + 4], edi
mov dword [esp], esi
mov esi, ebx
mov dword [esp + 0xc], 0x4026d0
mov dword [esp + 8], 4
call sub.msvcrt.dll_qsort
mov edx, dword [ebp - 0x28]
lea eax, [edx*4]
mov dword [ebp - 0x28], eax
lea edi, [eax + ebx + 4]
mov ebx, 1
lea esi, [esi]
nop
mov eax, dword [esi]
add esi, 4
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea ebx, [ebx + eax + 1]
cmp edi, esi
jne 0x4027f0
mov dword [esp], ebx
call fcn.004037e0
mov esi, dword [ebp - 0x2c]
mov edi, dword [ebp - 0x28]
mov dword [ebp - 0x30], eax
mov edx, eax
lea ebx, [edi + esi + 4]
lea esi, [esi]
mov eax, dword [esi]
mov dword [esp], edx
add esi, 4
mov dword [esp + 4], eax
call fcn.004038f0
lea edx, [eax + 1]
cmp ebx, esi
jne 0x402820
mov byte [eax + 1], 0
mov edi, dword [ebp - 0x1c]
mov dword [esp], edi
call sub.msvcrt.dll_strlen
mov dword [esp + 4], 0x2f
mov dword [esp], edi
mov ebx, eax
call sub.msvcrt.dll_strchr
test eax, eax
je 0x402cb0
mov esi, 0x40e294
xor edi, edi
lea eax, [edi + ebx + 6]
mov ebx, esi
mov dword [esp], eax
call fcn.004037e0
mov dword [ebp - 0x34], eax
mov edi, eax
movzx eax, byte [esi]
test al, al
je 0x402ca2
cmp al, 0x3b
je 0x402ca2
nop
movzx eax, byte [ebx + 1]
add ebx, 1
cmp al, 0x3b
je 0x40289f
test al, al
jne 0x402890
mov edx, ebx
mov dword [esp + 4], esi
sub edx, esi
mov dword [esp], edi
mov dword [esp + 8], edx
mov dword [ebp - 0x20], edx
call sub.msvcrt.dll_memcpy
mov edx, dword [ebp - 0x20]
add edx, edi
mov eax, edx
cmp ebx, esi
je 0x4028c7
mov byte [edx], 0x5c
add eax, 1
mov esi, dword [ebp - 0x1c]
mov dword [esp], eax
mov dword [esp + 4], esi
call sub.msvcrt.dll_strcpy
xor eax, eax
cmp byte [ebx], 0x3b
mov edx, edi
sete al
add ebx, eax
movzx eax, byte [edi]
test al, al
je 0x402902
lea esi, [esi]
cmp al, 0x2f
jne 0x4028f7
mov byte [edx], 0x5c
movzx eax, byte [edx + 1]
add edx, 1
test al, al
jne 0x4028f0
mov esi, 0x40e2d4
mov dword [ebp - 0x20], ebx
mov eax, str..com
mov ebx, esi
mov esi, edx
jmp 0x402926
mov eax, dword [ebx + 4]
add ebx, 4
test eax, eax
je 0x402c88
mov byte [esi], 0
mov dword [esp + 4], eax
mov dword [esp], edi
call sub.msvcrt.dll_strcat
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x402918
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x3c], eax
call eax
mov eax, dword [ebp - 0x24]
sub esp, 4
mov edx, dword [eax]
test edx, edx
je 0x402d50
add eax, 4
mov dword [ebp - 0x20], eax
xor eax, eax
lea esi, [esi]
nop
movzx ebx, byte [edx]
xor edi, edi
xor ecx, ecx
test bl, bl
je 0x402a61
mov dword [ebp - 0x1c], eax
jmp 0x4029c6
movzx ebx, byte [edx + ecx + 1]
lea esi, [ecx + 1]
test bl, bl
je 0x402a20
mov ecx, esi
mov esi, ebx
and esi, 0xfffffffd
mov eax, esi
cmp al, 0x20
je 0x4029d6
cmp bl, 9
jne 0x4029b8
mov edi, 1
cmp bl, 0x22
jne 0x4029b8
mov eax, dword [ebp - 0x1c]
lea ebx, [ecx - 1]
lea esi, [ecx + eax]
test ecx, ecx
jne 0x4029f8
jmp 0x402a30
sub ebx, 1
cmp ebx, 0xffffffff
je 0x402a30
mov eax, esi
sub eax, ebx
cmp byte [edx + ebx], 0x5c
je 0x4029f0
mov dword [ebp - 0x1c], eax
mov edi, 1
movzx ebx, byte [edx + ecx + 1]
lea esi, [ecx + 1]
test bl, bl
jne 0x4029c4
lea esi, [esi]
lea esi, [esi]
mov eax, dword [ebp - 0x1c]
test edi, edi
jne 0x402a40
add eax, esi
xor edx, edx
jmp 0x402a66
add eax, 1
mov edi, 1
mov dword [ebp - 0x1c], eax
jmp 0x402a0a
add edx, ecx
lea ecx, [eax + ecx + 1]
jmp 0x402a5a
add eax, 1
sub edx, 1
cmp eax, ecx
je 0x402a5f
cmp byte [edx], 0x5c
je 0x402a50
add eax, esi
mov edx, 2
add dword [ebp - 0x20], 4
mov ecx, dword [ebp - 0x20]
lea eax, [eax + edx + 1]
mov edx, dword [ecx - 4]
test edx, edx
jne 0x4029a0
mov dword [esp], eax
call fcn.004037e0
mov ebx, dword [ebp - 0x24]
mov dword [ebp - 0x38], eax
mov esi, dword [ebx]
test esi, esi
je 0x402d40
add ebx, 4
mov edi, eax
mov dword [ebp - 0x20], ebx
lea esi, [esi]
movzx ecx, byte [esi]
lea edx, [esi + 1]
mov eax, ecx
test cl, cl
jne 0x402ac2
jmp 0x402acc
cmp al, 9
je 0x402acc
movzx eax, byte [edx]
add edx, 1
test al, al
je 0x402c30
mov ebx, eax
and ebx, 0xfffffffd
cmp bl, 0x20
jne 0x402ab0
mov byte [edi], 0x22
movzx ecx, byte [esi]
lea edx, [edi + 1]
lea eax, [edi + 2]
add edi, 3
test cl, cl
je 0x402b81
mov dword [ebp - 0x28], 1
mov edi, edx
mov edx, edi
mov ebx, 0xffffffff
jmp 0x402b11
mov ecx, dword [ebp - 0x1c]
movzx ecx, byte [esi + ecx + 1]
mov byte [edx], cl
movzx ecx, byte [esi + ebx + 1]
test cl, cl
je 0x402c40
mov edx, eax
lea eax, [edx + 1]
mov dword [ebp - 0x1c], ebx
lea edi, [edx + 2]
add ebx, 1
mov dword [ebp - 0x2c], eax
cmp cl, 0x22
jne 0x402af8
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0xffffffff
jne 0x402b3c
jmp 0x402b60
sub ecx, 1
mov byte [edx - 1], 0x5c
cmp ecx, 0xffffffff
je 0x402b60
mov dword [ebp - 0x24], edx
mov edx, dword [ebp - 0x2c]
cmp byte [esi + ecx], 0x5c
lea eax, [edx + 1]
lea edi, [edx + 2]
mov dword [ebp - 0x2c], eax
je 0x402b30
mov ecx, dword [ebp - 0x24]
mov byte [ecx], 0x5c
jmp 0x402af8
lea ecx, [edx + 3]
mov dword [ebp - 0x24], edx
mov edx, eax
mov eax, edi
mov edi, ecx
mov ecx, dword [ebp - 0x24]
mov byte [ecx], 0x5c
jmp 0x402af8
lea edx, [eax + 2]
mov eax, edi
mov edi, edx
mov edx, esi
mov byte [edx], 0x22
add dword [ebp - 0x20], 4
mov byte [eax], 0x20
mov eax, dword [ebp - 0x20]
mov esi, dword [eax - 4]
test esi, esi
jne 0x402aa0
mov eax, dword [ebp + 0x14]
mov byte [edi - 1], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x10], 1
mov dword [esp + 0x20], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 0xc], 0
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], 0
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
sub esp, 0x28
test eax, eax
je 0x402d85
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 4]
mov dword [esp], eax
mov eax, dword [ebp - 0x3c]
call eax
mov eax, dword [ebp - 0x34]
sub esp, 4
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x28], 0
jmp 0x402aec
mov edx, dword [ebp - 0x28]
test edx, edx
je 0x402b84
mov edi, dword [ebp - 0x1c]
add ebx, esi
lea ecx, [eax + 1]
lea esi, [eax + edi + 2]
jmp 0x402c6f
mov byte [eax - 1], 0x5c
sub ebx, 1
cmp esi, eax
je 0x402b78
mov edx, eax
cmp byte [ebx], 0x5c
mov eax, ecx
lea ecx, [ecx + 1]
mov edi, ecx
je 0x402c60
jmp 0x402b81
mov ebx, dword [ebp - 0x20]
movzx eax, byte [ebx]
test al, al
je 0x402d60
mov esi, ebx
mov ebx, esi
test al, al
jne 0x402886
mov eax, edi
jmp 0x4028c7
mov dword [esp + 4], 0x5c
mov dword [esp], edi
call sub.msvcrt.dll_strchr
test eax, eax
jne 0x402861
test byte [ebp - 0x20], 1
je 0x402861
mov dword [esp], str.PATH
call sub.msvcrt.dll_getenv
mov esi, eax
test eax, eax
je 0x402861
movzx eax, byte [eax]
test al, al
je 0x402866
mov dword [ebp - 0x20], ebx
mov edx, esi
xor edi, edi
lea esi, [esi]
mov ebx, dword [ebp - 0x20]
mov ecx, edx
cmp al, 0x3b
je 0x402d80
lea esi, [esi]
movzx eax, byte [ecx + 1]
add ecx, 1
cmp al, 0x3b
je 0x402d1f
test al, al
jne 0x402d10
mov dword [ebp - 0x20], ebx
mov ebx, ecx
sub ebx, edx
mov edx, ecx
cmp edi, ebx
cmovb edi, ebx
cmp al, 0x3b
je 0x402d80
movzx eax, byte [edx]
test al, al
jne 0x402d00
mov ebx, dword [ebp - 0x20]
jmp 0x402868
mov edi, dword [ebp - 0x38]
jmp 0x402b99
xor eax, eax
jmp 0x402a7c
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, 0xffffffff
jmp 0x402c23
add edx, 1
jmp 0x402d31
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, 0xffffffff
jmp 0x402c23