Function at 0x4040e0
Capabilities:
Create directory
Create process on windows
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x10784
call fcn.0040ad10
mov eax, dword [0x45d1d4]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x720]
push edi
mov edi, dword [ebp + 0xc]
push 0x104
push eax
push str.ComSpec
mov dword [ebp - 0x10730], esi
mov dword [ebp - 0x10748], edi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x40414b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 5
push 8
call fcn.00403800
add esp, 0xc
xor eax, eax
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
push 0x104
lea eax, [ebp - 0x61c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x404188
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 6
push 8
call fcn.00403800
add esp, 0xc
xor eax, eax
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
push ebx
push 0
lea eax, [ebp - 0x10724]
push eax
push 0
push 0x40
lea eax, [ebp - 0x61c]
push 0x8000
push eax
call fcn.0042c807
mov ebx, dword [ebp - 0x10724]
or ecx, 0xffffffff
add esp, 0x18
test eax, eax
cmovne ebx, ecx
cmp ebx, ecx
jne 0x4041e2
call fcn.00415d0b
push dword [eax]
push 7
push 8
call fcn.00403800
add esp, 0xc
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
push 2
push 0xffffffffffffffd8
push ebx
call fcn.0042a7f8
add esp, 0xc
cmp eax, 0xffffffff
jne 0x404202
call fcn.00415d0b
push dword [eax]
push 8
jmp 0x404914
push 4
lea eax, [ebp - 0x1072c]
push eax
push ebx
call fcn.0042adac
add esp, 0xc
cmp eax, 4
je 0x404227
call fcn.00415d0b
push dword [eax]
push 9
jmp 0x404914
push 4
lea eax, [ebp - 0x10734]
push eax
push ebx
call fcn.0042adac
add esp, 0xc
cmp eax, 4
je 0x40424c
call fcn.00415d0b
push dword [eax]
push 9
jmp 0x404914
push 0
push dword [ebp - 0x10734]
push ebx
call fcn.0042a7f8
add esp, 0xc
cmp eax, 0xffffffff
jne 0x404270
call fcn.00415d0b
push dword [eax]
push 8
jmp 0x404914
push 0x100
push 0x45ded8
push ebx
call fcn.0042adac
add esp, 0xc
cmp eax, 0x100
je 0x404298
call fcn.00415d0b
push dword [eax]
push 9
jmp 0x404914
push 0x450854
push 0x45ded8
call fcn.004175ae
add esp, 8
test eax, eax
je 0x4042f6
push 0x450854
push 0x45ded8
call fcn.0040bf00
mov esi, eax
lea eax, [ebp - 0x108]
sub esi, 0x45ded8
push esi
push 0x45ded8
push eax
call fcn.00416240
add esp, 0x14
cmp esi, 0x104
jae 0x404961
mov byte [ebp + esi - 0x108], 0
mov esi, dword [ebp - 0x10730]
jmp 0x404314
xor ecx, ecx
nop dword [eax + eax]
mov al, byte [ecx + 0x45ded8]
lea ecx, [ecx + 1]
mov byte [ebp + ecx - 0x109], al
test al, al
jne 0x404300
lea ecx, [ebp - 0x108]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404320
sub ecx, edx
push str..exe
lea eax, [ebp + ecx - 0x10c]
push eax
call fcn.00416174
add esp, 4
push eax
call fcn.00415e9c
add esp, 8
test eax, eax
je 0x4043ad
lea ecx, [ebp - 0x108]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404354
sub ecx, edx
push str..bat
lea eax, [ebp + ecx - 0x10c]
push eax
call fcn.00416174
add esp, 4
push eax
call fcn.00415e9c
add esp, 8
test eax, eax
je 0x4043ad
test ebx, ebx
je 0x40438c
push ebx
call fcn.0042a33f
add esp, 4
push 0
push 0xa
push 8
call fcn.00403800
add esp, 0xc
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x1072c], 0
mov dword [ebp - 0x10724], 0
jle 0x40493e
movsx eax, byte [edi]
push eax
call fcn.004176b4
sub eax, 0x60
push eax
call fcn.0042965c
add esp, 8
test eax, eax
jne 0x40490b
push esi
call fcn.00429e97
add esp, 4
test eax, eax
jne 0x404900
push 0x100
lea eax, [ebp - 0x418]
push eax
push ebx
call fcn.0042adac
add esp, 0xc
cmp eax, 0x100
jne 0x404219
push eax
lea eax, [ebp - 0x518]
push eax
push ebx
call fcn.0042adac
add esp, 0xc
cmp eax, 0x100
jne 0x404219
push 4
lea eax, [ebp - 0x10740]
push eax
push ebx
call fcn.0042adac
add esp, 0xc
cmp eax, 4
jne 0x404219
push eax
lea eax, [ebp - 0x10728]
push eax
push ebx
call fcn.0042adac
add esp, 0xc
cmp eax, 4
jne 0x404219
lea ecx, [ebp - 0x418]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404470
sub ecx, edx
xor edx, edx
nop dword [eax + eax]
mov al, byte [ebp + edx - 0x418]
lea edx, [edx + 1]
mov byte [ebp + edx - 0x209], al
test al, al
jne 0x404480
test ecx, ecx
je 0x4048d2
cmp ecx, 1
jle 0x4044af
cmp byte [ebp - 0x208], 0x5c
je 0x404795
cmp ecx, 2
jle 0x4044c1
cmp byte [ebp - 0x207], 0x3a
je 0x404795
cmp byte [ebp + ecx - 0x209], 0x5c
je 0x4044e5
lea edi, [ebp - 0x208]
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4044d2
mov ax, word [0x450868]
mov word [edi], ax
lea eax, [ebp - 0x208]
push 0x450868
push eax
call fcn.00416364
add esp, 8
mov esi, eax
nop dword [eax + eax]
push esi
call fcn.00429fdd
add esp, 4
test eax, eax
je 0x40451b
call fcn.00415d0b
cmp dword [eax], 0x11
jne 0x4047c3
push esi
call fcn.00429e97
add esp, 4
test eax, eax
jne 0x4048c5
push 0x450868
push eax
call fcn.00416364
mov esi, eax
add esp, 8
test esi, esi
jne 0x404500
push eax
lea eax, [ebp - 0x10738]
push eax
push 0x180
push 0x40
lea eax, [ebp - 0x518]
push 0x8101
push eax
call fcn.0042c807
mov edi, dword [ebp - 0x10738]
add esp, 0x18
test eax, eax
mov esi, 0xffffffff
cmovne edi, esi
cmp edi, esi
je 0x404892
mov eax, dword [ebp - 0x10728]
test eax, eax
jle 0x4045e6
nop word [eax + eax]
cmp eax, 0x10000
mov ecx, 0x10000
cmovg eax, ecx
mov esi, eax
lea eax, [ebp - 0x10720]
push esi
push eax
push ebx
call fcn.0042adac
add esp, 0xc
cmp eax, esi
jne 0x404817
push esi
lea eax, [ebp - 0x10720]
push eax
push edi
call fcn.0042ba49
add esp, 0xc
cmp eax, esi
jne 0x4047d3
mov eax, dword [ebp - 0x10728]
sub eax, esi
mov dword [ebp - 0x10728], eax
test eax, eax
jg 0x404590
or esi, 0xffffffff
push edi
call fcn.0042a33f
add esp, 4
test eax, eax
jne 0x404884
push eax
lea eax, [ebp - 0x1073c]
push eax
push 0x180
push 0x40
push 0x8301
push str.Null.txt
call fcn.0042c807
mov ecx, dword [ebp - 0x1073c]
add esp, 0x18
test eax, eax
cmovne ecx, esi
cmp ecx, 0xffffffff
je 0x404874
push ecx
call fcn.0042a33f
add esp, 4
test eax, eax
jne 0x404864
cmp dword [ebp - 0x10740], 1
jne 0x40476b
lea edx, [ebp - 0x518]
mov dword [ebp - 0x318], 0x20632f
mov esi, edx
nop dword [eax]
mov al, byte [edx]
inc edx
test al, al
jne 0x404660
lea edi, [ebp - 0x318]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404670
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 ecx, [ebp - 0x318]
dec ecx
nop dword [eax]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x404690
mov eax, dword [str.___Null.txt]
mov dword [ecx], eax
mov eax, dword [0x45087c]
mov dword [ecx + 4], eax
mov eax, dword [0x450880]
mov dword [ecx + 8], eax
lea eax, [ebp - 0x720]
mov dword [ebp - 0x10774], eax
lea eax, [ebp - 0x318]
mov dword [ebp - 0x10770], eax
lea eax, [ebp - 0x10784]
push eax
mov dword [ebp - 0x10784], 0x3c
mov dword [ebp - 0x10780], 0x40
mov dword [ebp - 0x1077c], 0
mov dword [ebp - 0x10778], 0
mov dword [ebp - 0x1076c], 0
mov dword [ebp - 0x10768], 0
call dword [sym.imp.SHELL32.dll_ShellExecuteExA]
test eax, eax
je 0x404854
push 0xffffffffffffffff
push dword [ebp - 0x1074c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
je 0x404844
lea eax, [ebp - 0x10744]
push eax
push dword [ebp - 0x1074c]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x404834
mov eax, dword [ebp - 0x10744]
test eax, eax
je 0x40475f
cmp eax, 1
jne 0x404824
push dword [ebp - 0x1074c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x10724]
inc esi
mov dword [ebp - 0x10724], esi
cmp esi, dword [ebp - 0x1072c]
jge 0x40493e
mov esi, dword [ebp - 0x10730]
mov edi, dword [ebp - 0x10748]
jmp 0x4043c4
test ebx, ebx
je 0x4047a2
push ebx
call fcn.0042a33f
add esp, 4
push 0
push 0xe
push 3
call fcn.00403800
add esp, 0xc
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
call fcn.00415d0b
push dword [eax]
push 0xf
push 3
jmp 0x404916
call fcn.00415d0b
push dword [eax]
push 0x11
push 5
call fcn.00403800
add esp, 0xc
test ebx, ebx
je 0x4047f3
push ebx
call fcn.0042a33f
add esp, 4
test edi, edi
je 0x40492b
push edi
call fcn.0042a33f
add esp, 4
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
call fcn.00415d0b
push dword [eax]
push 9
push 8
jmp 0x4047de
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x16
push 6
jmp 0x404916
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x15
push 6
jmp 0x404916
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x14
push 6
jmp 0x404916
call fcn.00415d0b
push dword [eax]
push 0x13
push 6
jmp 0x404916
call fcn.00415d0b
push dword [eax]
push 0x12
push 5
jmp 0x404916
call fcn.00415d0b
push dword [eax]
push 0x10
push 5
jmp 0x404916
call fcn.00415d0b
push dword [eax]
push 0x12
jmp 0x4047dc
test ebx, ebx
je 0x40489f
push ebx
call fcn.0042a33f
add esp, 4
call fcn.00415d0b
push dword [eax]
push 0x10
push 5
call fcn.00403800
add esp, 0xc
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
call fcn.00415d0b
push dword [eax]
push 0xc
push 3
jmp 0x404916
test ebx, ebx
je 0x4048df
push ebx
call fcn.0042a33f
add esp, 4
push 0
push 0xd
push 3
call fcn.00403800
add esp, 0xc
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
call fcn.00415d0b
push dword [eax]
push 0xc
jmp 0x404914
call fcn.00415d0b
push dword [eax]
push 0xb
push 8
call fcn.00403800
add esp, 0xc
test ebx, ebx
je 0x40492b
push ebx
call fcn.0042a33f
add esp, 4
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040acca
mov esp, ebp
pop ebp
ret
test ebx, ebx
je 0x40494b
push ebx
call fcn.0042a33f
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, 1
pop ebx
pop edi
xor ecx, ebp
pop esi
call fcn.0040acca
mov esp, ebp
pop ebp
ret
call fcn.0040aad3
int3