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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x422686
mov eax, dword fs:[0]
push eax
sub esp, 0x1b0
mov eax, dword [0x56c050]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
call fcn.00402390
test al, al
je 0x4029a6
push 7
mov dword [ebp - 0x15c], 0
lea ecx, [ebp - 0x15c]
push str.ComSpec
mov dword [ebp - 0x14c], 0
mov dword [ebp - 0x148], 0xf
mov byte [ebp - 0x15c], 0
call fcn.00404880
push 0x104
lea eax, [ebp - 0x114]
mov dword [ebp - 4], 0
push 0
push eax
call fcn.00407a60
add esp, 0xc
lea ecx, [ebp - 0x114]
cmp dword [ebp - 0x148], 0x10
lea eax, [ebp - 0x15c]
cmovae eax, dword [ebp - 0x15c]
push 0x104
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x402644
cmp eax, 0x104
jae 0x402644
lea ecx, [ebp - 0x114]
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x134], 0
lea edx, [ecx + 1]
mov dword [ebp - 0x130], 0xf
mov byte [ebp - 0x144], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402631
sub ecx, edx
lea eax, [ebp - 0x114]
push ecx
push eax
jmp 0x402670
push 0
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x134], 0
mov dword [ebp - 0x130], 0xf
mov byte [ebp - 0x144], 0
push 0x5685e7
lea ecx, [ebp - 0x144]
call fcn.00404880
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x148]
cmp edx, 0x10
jb 0x4026b9
mov ecx, dword [ebp - 0x15c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4026af
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4029c2
push edx
push ecx
call fcn.0040609a
add esp, 8
lea ecx, [ebp - 0x144]
mov dword [ebp - 0x14c], 0
mov dword [ebp - 0x148], 0xf
mov byte [ebp - 0x15c], 0
call fcn.00402390
test al, al
jne 0x4026ea
xor bl, bl
jmp 0x40296e
mov ecx, dword [ebp - 0x134]
mov eax, 0x7fffffff
sub eax, ecx
mov dword [ebp - 0x160], ecx
cmp eax, 0xa
jb 0x4029c7
cmp dword [ebp - 0x130], 0x10
lea eax, [ebp - 0x144]
lea edx, [ecx + 0xa]
mov dword [ebp - 0x12c], 0
cmovae eax, dword [ebp - 0x144]
lea edi, [ebp - 0x12c]
mov esi, 0xf
mov dword [ebp - 0x164], eax
mov dword [ebp - 0x11c], 0
mov dword [ebp - 0x118], 0
mov dword [ebp - 0x168], edx
cmp edx, esi
jbe 0x4027e5
mov esi, edx
or esi, 0xf
cmp esi, 0x7fffffff
jbe 0x402799
mov esi, 0x7fffffff
mov ecx, 0x80000023
push ecx
call fcn.0040606a
add esp, 4
test eax, eax
je 0x4029d1
mov ecx, dword [ebp - 0x160]
lea edi, [eax + 0x23]
mov edx, dword [ebp - 0x168]
and edi, 0xffffffe0
mov dword [edi - 4], eax
jmp 0x4027d9
mov eax, 0x16
cmp esi, eax
cmovb esi, eax
lea eax, [esi + 1]
cmp eax, 0x1000
jb 0x4027ba
lea ecx, [eax + 0x23]
cmp ecx, eax
jbe 0x4029cc
jmp 0x402771
test eax, eax
je 0x4027d7
push eax
call fcn.0040606a
mov ecx, dword [ebp - 0x160]
add esp, 4
mov edx, dword [ebp - 0x168]
mov edi, eax
jmp 0x4027d9
xor edi, edi
mov eax, dword [ebp - 0x164]
mov dword [ebp - 0x12c], edi
push ecx
push eax
push edi
mov dword [ebp - 0x11c], edx
mov dword [ebp - 0x118], esi
call fcn.004074e0
mov ecx, dword [ebp - 0x160]
add esp, 0xc
movq xmm0, qword [str.__c_start]
movq qword [edi + ecx], xmm0
mov ax, word [0x568724]
mov word [edi + ecx + 8], ax
mov byte [edi + ecx + 0xa], 0
mov byte [ebp - 4], 3
cmp dword [ebx + 0x14], 0x10
jb 0x40282b
mov ebx, dword [ebx]
mov edi, ebx
lea ecx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x402830
mov edx, dword [ebp - 0x118]
sub edi, ecx
mov ecx, dword [ebp - 0x11c]
mov eax, edx
sub eax, ecx
push edi
push ebx
cmp edi, eax
ja 0x402879
cmp edx, 0x10
lea esi, [ebp - 0x12c]
lea eax, [ecx + edi]
cmovae esi, dword [ebp - 0x12c]
add esi, ecx
mov dword [ebp - 0x11c], eax
push esi
call fcn.004074e0
add esp, 0xc
mov byte [edi + esi], 0
jmp 0x402892
mov byte [ebp - 0x164], 0
lea ecx, [ebp - 0x12c]
push dword [ebp - 0x164]
push edi
call fcn.00405170
push 0x40
lea eax, [ebp - 0x1b8]
mov dword [ebp - 0x1bc], 0x44
push 0
push eax
call fcn.00407a60
add esp, 0xc
mov dword [ebp - 0x190], 1
lea ecx, [ebp - 0x178]
xor eax, eax
cmp dword [ebp - 0x118], 0x10
mov word [ebp - 0x18c], ax
lea eax, [ebp - 0x12c]
cmovae eax, dword [ebp - 0x12c]
push ecx
lea ecx, [ebp - 0x1bc]
push ecx
push 0
push 0
push 0x10
push 0
push 0
push 0
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x402917
push dword [ebp - 0x174]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0x178]
call esi
mov bl, 1
jmp 0x402919
xor bl, bl
mov edx, dword [ebp - 0x118]
cmp edx, 0x10
jb 0x402953
mov ecx, dword [ebp - 0x12c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x402949
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4029d1
push edx
push ecx
call fcn.0040609a
add esp, 8
mov dword [ebp - 0x11c], 0
mov dword [ebp - 0x118], 0xf
mov byte [ebp - 0x12c], 0
mov edx, dword [ebp - 0x130]
cmp edx, 0x10
jb 0x4029a4
mov ecx, dword [ebp - 0x144]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40299a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4029d1
push edx
push ecx
call fcn.0040609a
add esp, 8
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040605c
mov esp, ebp
pop ebp
ret
call fcn.0040a252
call fcn.004012c0
call fcn.00401190
call fcn.0040a252
int3