Function at 0x4079fe
Capabilities:
Create pipe
Read file on windows
Read pipe
Terminate process
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
lea edi, [ebp - 0x144]
mov ebx, ecx
sub esp, 0x1e8
mov dword [ebp - 0x1c4], 0
push edi
call fcn.0042937c
mov eax, dword [ebp - 0x144]
mov byte [ebp - 0x144], 0
mov dword [ebp - 0x1e8], eax
mov eax, dword [0x42a48c]
mov dword [ebp - 0x1e4], eax
pop eax
pop edx
push 0x439d19
push dword [ebx + 4]
call fcn.004034d9
add esp, 0x10
test eax, eax
je 0x407a62
or dword [ebx + 0xc], 0x40
mov esi, dword [0x4657bc]
jmp 0x407a6e
test byte [ebx + 0xc], 4
je 0x407a78
mov esi, dword [0x4657b0]
test esi, esi
jne 0x407b07
jmp 0x407ae4
push eax
push eax
push str..EXE
push dword [ebx + 4]
call fcn.004034d9
add esp, 0x10
test eax, eax
je 0x407a9a
or dword [ebx + 0xc], 0x20
mov esi, dword [ebx + 4]
jmp 0x407b2e
push esi
push esi
mov esi, 0x465700
push str..DLL
push dword [ebx + 4]
call fcn.004034d9
add esp, 0x10
test eax, eax
je 0x407ac5
sub esp, 0xc
push dword [ebx + 4]
jmp 0x407b1f
cmp byte [eax], 0x2e
je 0x407acd
add esi, 8
mov eax, dword [esi]
test eax, eax
jne 0x407abd
jmp 0x407ae4
push ecx
push ecx
push eax
push dword [ebx + 4]
call fcn.004034d9
add esp, 0x10
test eax, eax
je 0x407ac2
mov esi, dword [esi + 4]
jmp 0x407b07
test byte [0x465798], 2
mov esi, edi
jne 0x407b2e
push edi
push esi
push dword [ebx + 0x28]
push dword [ebx + 4]
call dword [sym.imp.SHELL32.dll_FindExecutableA]
cmp eax, 0x20
pop edx
jle 0x407d29
push ecx
push ecx
push str..DLL
push esi
call fcn.004034d9
add esp, 0x10
test eax, eax
je 0x407b2e
sub esp, 0xc
push esi
mov ecx, ebx
call fcn.00428b66
add esp, 0xc
jmp 0x408635
mov eax, dword [ebx + 0x18]
test eax, eax
je 0x407b3e
mov edx, dword [ebx + 4]
sub eax, edx
test edx, edx
jne 0x407b41
mov eax, dword [ebx + 0x40]
mov dword [ebp - 0x1a4], eax
cmp dword [ebp - 0x1a4], 0x2000
jbe 0x407b5d
mov dword [ebp - 0x1a4], 0x2000
mov eax, dword [ebp - 0x1a4]
mov edx, dword [0x46578c]
push ecx
add edx, eax
lea eax, [edx + eax + 0x14900]
push eax
push 8
push dword [section..bss]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x1d4], eax
add eax, 0x10800
mov edx, dword [0x46578c]
mov dword [ebp - 0x1e0], eax
mov eax, dword [ebp - 0x1a4]
mov ecx, ebx
push edi
lea edi, [ebp - 0x188]
add edx, eax
lea eax, [edx + eax + 0x4000]
add eax, dword [ebp - 0x1e0]
push eax
push dword [ebp - 0x1e0]
call fcn.0040785e
mov ecx, 0x44
mov dword [ebp - 0x1d8], eax
xor eax, eax
test edi, edi
je 0x407bd9
jecxz 0x407bd9
cld
rep stosb byte es:[edi], al
test byte [ebx + 0xc], 1
mov dword [ebp - 0x188], 0x44
pop eax
mov dword [ebp - 0x15c], 0x181
mov word [ebp - 0x158], 0
pop edx
je 0x407cbe
cmp dword [ebx + 0x18], 0
je 0x407cbe
cmp dword [ebp - 0x1d8], 0
je 0x407cbe
mov eax, dword [0x42a6a8]
cmp dword [ebp - 0x1d8], eax
jle 0x407c4d
push eax
push dword [ebp - 0x1d8]
push 0x439d27
push 0x45c2c0
call fcn.0040418c
pop eax
pop edx
push 0x190
push 0x439d51
jmp 0x407fa4
mov eax, dword [ebp - 0x1d8]
add eax, 0x100
push eax
lea eax, [ebp - 0x1c0]
push 0x42a458
push eax
lea eax, [ebp - 0x1c4]
push eax
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x407c87
push edi
push edi
push 0x190
push str.Error._Cant_run_script
jmp 0x407ffd
mov eax, dword [ebx + 0x34]
sub esp, 0xc
mov dword [ebp - 0x1d0], eax
mov eax, dword [ebx + 0x18]
push dword [ebp - 0x1c0]
mov dword [ebp - 0x1dc], eax
mov eax, dword [ebp - 0x1c4]
mov dword [ebp - 0x150], eax
call fcn.004079be
add esp, 0x10
mov dword [ebp - 0x1c0], eax
jmp 0x407cc8
mov dword [ebp - 0x1d0], 0
lea eax, [ebp - 0x1b4]
push 0x10000
push 0x42a458
mov edi, dword [sym.imp.KERNEL32.dll_CreatePipe]
push eax
lea eax, [ebp - 0x1b8]
push eax
call edi
test eax, eax
je 0x407d0a
lea eax, [ebp - 0x1b0]
push 0x400
push 0x42a458
push eax
lea eax, [ebp - 0x1bc]
push eax
call edi
test eax, eax
jne 0x407d43
cmp dword [ebp - 0x1d4], 0
je 0x407d29
push ecx
push dword [ebp - 0x1d4]
push 0
push dword [section..bss]
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop esi
push esi
push esi
mov ecx, ebx
push 0x190
push str.Error._Cant_run_script
call fcn.0040a69c
pop edi
pop edx
jmp 0x408635
mov eax, dword [ebp - 0x1b4]
sub esp, 0xc
push dword [ebp - 0x1b8]
mov dword [ebp - 0x14c], eax
mov eax, dword [ebp - 0x1b0]
mov dword [ebp - 0x148], eax
call fcn.004079be
pop edi
push dword [ebp - 0x1bc]
mov dword [ebp - 0x1b8], eax
call fcn.004079be
mov dword [ebp - 0x1bc], eax
pop eax
pop edx
push 0x5c
push dword [ebx + 4]
call fcn.00403472
mov edi, eax
mov eax, dword [ebx + 4]
add esp, 0x10
cmp byte [eax + 1], 0x3a
jne 0x40858e
push ecx
push ecx
push 0x20
push eax
call fcn.004033da
add esp, 0x10
test eax, eax
je 0x40858e
mov dword [ebp - 0x1cc], 0x439cdd
mov eax, dword [ebx + 0xc]
test al, 0x20
jne 0x40809b
test al, 4
lea edx, [edi + 1]
mov eax, dword [ebx + 4]
je 0x408078
cmp byte [eax + 1], 0x3a
cmovne eax, edx
push edx
push edx
push dword [ebp - 0x1cc]
push eax
push dword [ebp - 0x1cc]
push esi
push str._s__s_s_s
push dword [ebp - 0x1d4]
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x20
movsx eax, byte [edi + 1]
mov dword [ebp - 0x1ac], eax
mov byte [edi + 1], 0
mov eax, dword [0x4657b4]
test eax, eax
jne 0x407e1c
mov eax, dword [ebx + 4]
lea edx, [ebp - 0x198]
sub esp, 0xc
push edx
lea edx, [ebp - 0x188]
push edx
push eax
push dword [ebp - 0x1e0]
push dword [ebp - 0x1d4]
call fcn.004077d6
mov edx, dword [ebp - 0x1ac]
add esp, 0x20
test eax, eax
mov byte [edi + 1], dl
je 0x407fcb
mov eax, dword [ebp - 0x1e8]
add eax, dword [ebp - 0x1e4]
xor edi, edi
mov esi, dword [ebp - 0x1d4]
mov dword [ebp - 0x1ac], 0x103
mov dword [ebp - 0x1e4], eax
cmp dword [ebp - 0x1d8], 0
jle 0x40841e
mov eax, dword [ebp - 0x1d8]
mov dword [ebp - 0x1a8], 0
add eax, 2
cmp dword [ebp - 0x1d0], eax
cmovle eax, dword [ebp - 0x1d0]
test eax, eax
mov dword [ebp - 0x1d0], eax
jle 0x4080c7
lea eax, [ebp - 0x1a8]
sub esp, 0xc
push 0
push eax
push dword [ebp - 0x1d0]
push dword [ebp - 0x1dc]
push dword [ebp - 0x1c0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x1a8]
sub dword [ebp - 0x1d8], eax
add esp, 0xc
sub dword [ebp - 0x1d0], eax
add dword [ebp - 0x1dc], eax
cmp dword [ebp - 0x1d8], 0
jg 0x4080ba
sub esp, 0xc
push dword [ebp - 0x1c0]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x1c0], 0
add esp, 0xc
push eax
push dword [ebx]
push 0x2800
push 0
call fcn.0040a5c0
add esp, 0x10
test eax, eax
jne 0x40842d
lea eax, [ebp - 0x1a0]
sub esp, 0xc
push eax
call fcn.0042937c
add esp, 0x10
mov eax, dword [ebp - 0x1e4]
cmp eax, dword [ebp - 0x1a0]
jb 0x4083e2
push eax
push eax
lea eax, [ebp - 0x1a8]
push 0
push eax
push 0
push 0
push 0
push dword [ebp - 0x1b8]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
cmp dword [ebp - 0x1ac], 0x103
pop eax
pop edx
je 0x408448
cmp dword [ebp - 0x1a8], 0
jne 0x408448
test edi, edi
jne 0x407fad
push ecx
push ecx
push 0x190
push str.Error._Script_return_nothing
mov ecx, ebx
call fcn.0040a69c
pop eax
pop edx
sub esp, 0xc
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x194]
call ebx
push dword [ebp - 0x198]
call ebx
add esp, 0xc
jmp 0x408006
mov eax, dword [ebp - 0x1d4]
sub esp, 0xc
mov byte [edi], 0x5c
lea esi, [eax + 0x400]
push eax
mov eax, dword [ebx + 0x2c]
push dword [ebx + 0x14]
add eax, dword [ebx + 4]
push eax
push str.Error_run__s_with__s___s_
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x18
push 0x190
push esi
mov ecx, ebx
call fcn.0040a69c
pop esi
pop edi
push ecx
push dword [ebp - 0x1d4]
push 0
push dword [section..bss]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [ebp - 0x1c4]
pop ebx
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x408048
sub esp, 0xc
push eax
call ebx
mov eax, dword [ebp - 0x1c0]
add esp, 0xc
test eax, eax
je 0x408048
sub esp, 0xc
push eax
call ebx
add esp, 0xc
sub esp, 0xc
push dword [ebp - 0x1b4]
call ebx
push dword [ebp - 0x1b8]
call ebx
push dword [ebp - 0x1b0]
call ebx
push dword [ebp - 0x1bc]
call ebx
mov eax, 1
add esp, 0xc
jmp 0x408635
cmp byte [eax + 1], 0x3a
push ecx
push dword [ebx + 0x14]
push dword [ebp - 0x1cc]
cmovne eax, edx
push eax
push dword [ebp - 0x1cc]
push esi
push str._s__s_s_s__s
jmp 0x407df3
push dword [ebx + 0x14]
push dword [ebx + 4]
push 0x439da4
push dword [ebp - 0x1d4]
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
jmp 0x407e02
cmp dword [ebp - 0x1d0], 0
jg 0x407f1a
mov eax, dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
mov dword [ebp - 0x1dc], eax
push eax
push eax
lea eax, [ebp - 0x1a8]
push 0
mov dword [ebp - 0x1a8], 0
push eax
push 0
push 0
push 0
push dword [ebp - 0x1b8]
call dword [ebp - 0x1dc]
test eax, eax
pop edx
pop ecx
je 0x408482
cmp dword [ebp - 0x1a8], 0
je 0x408482
mov dword [ebp - 0x1dc], esi
cmp dword [ebp - 0x1a8], 0x8000
jle 0x40812c
mov dword [ebp - 0x1a8], 0x8000
lea eax, [ebp - 0x1a8]
sub esp, 0xc
push 0
push eax
push dword [ebp - 0x1a8]
push esi
push dword [ebp - 0x1b8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 0xc
test edi, edi
jne 0x408322
push eax
push eax
push str.Status:
push esi
call fcn.00403490
add esp, 0x10
test eax, eax
je 0x408188
add esi, 8
sub dword [ebp - 0x1a8], 8
mov edi, 9
mov dword [ebp - 0x1e0], 0x439cff
jmp 0x40825a
push eax
push eax
push str.Location
push esi
call fcn.0040e91a
add esp, 0x10
test eax, eax
jne 0x40824b
mov eax, dword [0x4657c0]
cmp dword [ebx + 4], eax
mov edi, str.HTTP_1.0_200__r_n
mov eax, str.HTTP_1.0_404__r_n
cmovne eax, edi
mov dword [ebp - 0x1e0], eax
mov eax, dword [ebx + 0xc]
and eax, 0x18
cmp eax, 8
jne 0x40859d
push eax
push eax
push 0x439dd8
push esi
call fcn.004034b5
add esp, 0x10
test eax, eax
mov dword [ebp - 0x1cc], eax
jne 0x408202
push eax
push eax
push 0x439b6d
push esi
call fcn.004034b5
add esp, 0x10
test eax, eax
mov dword [ebp - 0x1cc], eax
je 0x40859d
cmp dword [ebx + 0x48], 0x422d59
je 0x40859d
push eax
push eax
push 0x439ddd
push esi
call fcn.004034d9
add esp, 0x10
test eax, eax
jne 0x40859d
push edi
push edi
push str.Content_type:_text
push esi
call fcn.004034d9
add esp, 0x10
test eax, eax
je 0x40859d
mov ecx, ebx
call fcn.004231b4
jmp 0x40859d
mov edi, 0xf
mov dword [ebp - 0x1e0], str.HTTP_1.0_301__r_n
push eax
push eax
mov ecx, ebx
push edi
push dword [ebp - 0x1e0]
call fcn.004074fc
test eax, eax
pop edx
pop ecx
js 0x40834e
cmp dword [ebx + 0x78], 0
je 0x408322
cmp dword [ebp - 0x1cc], 0
je 0x408322
test byte [ebx + 0xc], 0x10
jne 0x408322
mov eax, dword [ebp - 0x1cc]
mov edx, dword [ebp - 0x1cc]
mov ecx, ebx
sub edx, esi
cmp byte [eax], 0xd
sete al
movzx eax, al
lea eax, [edx + eax + 1]
push edx
push edx
push eax
push esi
mov dword [ebp - 0x1a4], eax
call fcn.004074fc
push 0x24
push str.Content_Encoding:_gzip_r_n_r_n
mov ecx, ebx
call fcn.004074fc
pop ecx
pop eax
mov eax, dword [ebp - 0x1cc]
xor edx, edx
cmp byte [eax], 0xd
mov eax, dword [ebp - 0x1a4]
sete dl
lea eax, [edx + eax + 1]
mov edx, dword [ebp - 0x1a8]
mov dword [ebp - 0x1a4], eax
cmp eax, edx
jge 0x408311
sub edx, eax
add eax, esi
push ecx
push edx
push eax
push esi
mov dword [ebp - 0x1a8], edx
call fcn.00428f18
add esp, 0x10
jmp 0x40831b
mov dword [ebp - 0x1a8], 0
mov dword [ebx + 0x48], 0x422d59
mov eax, dword [ebp - 0x1a8]
test eax, eax
je 0x407e77
mov byte [esi + eax], 0
push eax
mov ecx, ebx
push eax
push dword [ebp - 0x1a8]
push esi
call fcn.004074fc
test eax, eax
pop edx
pop ecx
jns 0x408413
test byte [0x46579e], 0x40
je 0x4083e2
mov edi, dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
lea ebx, [ebp - 0x1a8]
push eax
push eax
push 0
push ebx
push 0
push 0
push 0
push dword [ebp - 0x1b8]
call edi
test eax, eax
pop edx
pop ecx
je 0x40838d
cmp dword [ebp - 0x1a8], 0
jne 0x4085a7
lea eax, [ebp - 0x1a0]
sub esp, 0xc
push eax
call fcn.0042937c
add esp, 0x10
mov eax, dword [ebp - 0x1e4]
cmp eax, dword [ebp - 0x1a0]
jb 0x4083e2
sub esp, 0xc
push 0x2710
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x1ac]
sub esp, 0xc
push eax
push dword [ebp - 0x198]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
add esp, 0x18
cmp dword [ebp - 0x1ac], 0x103
je 0x408367
jmp 0x4083f4
push esi
push esi
push 0
push dword [ebp - 0x198]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
pop edi
pop eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
push eax
push str.Connection_aborted__d..
push 0x45c2c0
call fcn.0040418c
add esp, 0x10
jmp 0x407fad
add edi, dword [ebp - 0x1a8]
jmp 0x407e77
mov dword [ebp - 0x1d0], 0
jmp 0x407f1a
push ecx
push 0x8000
push esi
push ebx
call dword [ebx + 0x4c]
add esp, 0x10
test eax, eax
jg 0x407f34
jmp 0x40834e
cmp dword [ebp - 0x1a8], 0
jne 0x408116
lea eax, [ebp - 0x1a8]
push ecx
push ecx
push 0
push eax
push 0
push 0
push 0
push dword [ebp - 0x1bc]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
cmp dword [ebp - 0x1a8], 0
pop eax
pop edx
jne 0x4084bc
jmp 0x408572
push eax
push eax
lea eax, [ebp - 0x1a8]
push 0
push eax
push 0
push 0
push 0
push dword [ebp - 0x1bc]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
pop edx
pop ecx
je 0x4085c7
cmp dword [ebp - 0x1a8], 0
je 0x4085c7
mov dword [ebp - 0x1dc], esi
test edi, edi
jne 0x408501
sub esp, 0xc
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x1a4]
sub esp, 0xc
push 0
push eax
push 0
push 0
push 0
push dword [ebp - 0x1b8]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
mov eax, dword [ebp - 0x1a4]
add esp, 0x18
test eax, eax
je 0x408501
mov dword [ebp - 0x1a8], eax
jmp 0x408116
test byte [0x4657a3], 8
jne 0x408544
test edi, edi
jne 0x40852a
push edi
push edi
mov ecx, ebx
push 0x190
push str.Error_in_script:_r_n
mov edi, 1
call fcn.0040a69c
pop eax
pop edx
jmp 0x408544
push eax
push eax
mov ecx, ebx
push 8
push str._r_n_r_n_hr_
call fcn.004074fc
test eax, eax
pop edx
pop ecx
jle 0x40834e
lea eax, [ebp - 0x1bc]
lea edx, [ebp - 0x1b8]
mov ecx, dword [eax]
xchg dword [edx], ecx
mov dword [eax], ecx
test dword [0x4657a0], 0x28000000
je 0x408116
xor dword [ebx + 0xc], 0x1000
jmp 0x408116
push eax
push eax
lea eax, [ebp - 0x1ac]
push eax
push dword [ebp - 0x198]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
pop edx
pop ecx
jmp 0x407e77
mov dword [ebp - 0x1cc], 0x439b64
jmp 0x407dbe
mov edi, 0xf
jmp 0x40825a
sub esp, 0xc
push 0
push ebx
push 0x4000
push esi
push dword [ebp - 0x1b8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 0xc
jmp 0x40838d
push eax
push eax
lea eax, [ebp - 0x1ac]
push eax
push dword [ebp - 0x198]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
cmp dword [ebp - 0x1ac], 0x103
pop edx
pop ecx
jne 0x407f94
push eax
push dword [ebx]
push 0x7530
push 0
call fcn.0040a5c0
add esp, 0x10
test eax, eax
je 0x4080d2
push eax
push 0x8000
push esi
push ebx
call dword [ebx + 0x4c]
add esp, 0x10
test eax, eax
mov dword [ebp - 0x1d0], eax
js 0x40834e
mov dword [ebp - 0x1dc], esi
jne 0x407e84
jmp 0x407f1a
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret