Function at 0x401000
Capabilities:
Query environment variable
Terminate process

Disassembly:
sub esp, 0x10
push ebx
mov ebx, dword [esp + 0x1c]
push esi
mov esi, dword [esp + 0x28]
test esi, esi
je 0x401014
mov byte [ebx], 0
lea eax, [esp + 0x10]
push eax
call sub.nutlibc4.dll_pipe
add esp, 4
test eax, eax
jge 0x401038
push 0xb
call fcn.004021e0
add esp, 4
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
push edi
call sub.nutlibc4.dll_fork
mov edi, eax
test edi, edi
jge 0x401058
push 9
call fcn.004021e0
add esp, 4
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
test edi, edi
push ebp
jne 0x401235
mov ecx, dword [esp + 0x18]
push ecx
call sub.nutlibc4.dll_close
mov eax, dword [esp + 0x20]
add esp, 4
test esi, esi
je 0x401092
cmp eax, 2
je 0x4010cd
push 2
push eax
call sub.nutlibc4.dll_dup2
mov edx, dword [esp + 0x24]
push edx
call sub.nutlibc4.dll_close
add esp, 0xc
jmp 0x4010cd
cmp eax, 1
je 0x4010a6
push 1
push eax
call sub.nutlibc4.dll_dup2
mov eax, dword [esp + 0x24]
add esp, 8
cmp eax, 2
je 0x4010ba
push 2
push eax
call sub.nutlibc4.dll_dup2
mov eax, dword [esp + 0x24]
add esp, 8
cmp eax, 1
je 0x4010cd
cmp eax, 2
je 0x4010cd
push eax
call sub.nutlibc4.dll_close
add esp, 4
push 0
call sub.nutlibc4.dll_close
push 1
push str._dev_null
call sub.nutlibc4.dll_open
add esp, 0xc
test eax, eax
je 0x4010f8
push 0x18
call fcn.004021e0
add esp, 4
push 0xffffffffffffffff
call sub.nutlibc4.dll_exit
test esi, esi
je 0x4011b6
push 1
call sub.nutlibc4.dll_close
push 1
push str._dev_null
call sub.nutlibc4.dll_open
add esp, 0xc
cmp eax, 1
je 0x40112c
push 0x18
call fcn.004021e0
add esp, 4
push 0xffffffffffffffff
call sub.nutlibc4.dll_exit
push str.PATH
call sub.nutlibc4.dll_getenv
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x4011b6
push str.AFREMOTE_HOME
call sub.nutlibc4.dll_getenv
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4011b6
mov eax, ebp
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x401157
sub eax, edx
mov edx, eax
mov eax, ebx
lea esi, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x401170
sub eax, esi
lea edi, [eax + edx + 0xa]
push edi
call sub.nutlibc4.dll_malloc
mov esi, eax
add esp, 4
test esi, esi
jne 0x40119f
push 0x16
call fcn.004021e0
add esp, 4
push 0xffffffffffffffff
call sub.nutlibc4.dll_exit
push ebp
push ebx
push str.PATH_s:_s
push edi
push esi
call sub.nutlibc4.dll_snprintf
push esi
call sub.nutlibc4.dll_putenv
add esp, 0x18
mov eax, dword [0x408a78]
push 0
push eax
push 3
call fcn.00404150
call sub.nutlibc4.dll_getpid
mov ecx, dword [0x408a78]
push eax
push str._d:
push ecx
call sub.nutlibc4.dll_fprintf
mov esi, dword [esp + 0x3c]
mov edx, dword [esi + 8]
mov eax, dword [0x408a78]
push edx
push str.Executed:__s
push eax
call sub.nutlibc4.dll_fprintf
mov ecx, dword [0x408a78]
push ecx
call sub.nutlibc4.dll_fflush
mov edx, dword [esi]
push esi
push edx
call sub.nutlibc4.dll_execv
add esp, 0x30
test eax, eax
jge 0x4012ff
mov eax, dword [0x408a78]
push 0x405314
push eax
call sub.nutlibc4.dll_fprintf
push 8
call fcn.004021e0
add esp, 0xc
push 0x37
call sub.nutlibc4.dll_exit
mov ecx, dword [esp + 0x1c]
push ecx
call sub.nutlibc4.dll_close
mov edx, dword [esp + 0x1c]
push 1
push edx
call fcn.00402a70
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x401269
push 0xc
call fcn.004021e0
add esp, 4
pop ebp
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
mov eax, dword [esp + 0x18]
push eax
call sub.nutlibc4.dll_close
push 0
lea ecx, [esp + 0x18]
push ecx
push edi
call sub.nutlibc4.dll_waitpid
add esp, 0x10
test eax, eax
jge 0x4012a2
push 0x1a
call fcn.004021e0
push esi
call sub.nutlibc4.dll_free
add esp, 8
pop ebp
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x14]
push edx
push str.Slave_afcom
push eax
call fcn.004028e0
add esp, 0xc
cmp dword [esp + 0x14], 0
mov ebp, eax
je 0x4014de
cmp ebp, 0x37
je 0x4012ec
mov ecx, dword [0x408a78]
push ebp
push str._return_code:__d__n
push ecx
call sub.nutlibc4.dll_fprintf
mov edx, dword [0x408a78]
push edx
call sub.nutlibc4.dll_fflush
add esp, 0x10
test ebp, ebp
jne 0x401309
cmp dword [esp + 0x30], ebp
je 0x401321
push esi
call sub.nutlibc4.dll_free
add esp, 4
pop ebp
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret
cmp dword [esp + 0x30], 0
je 0x401321
push 0x3e8
push esi
push ebx
call sub.nutlibc4.dll_strncat
add esp, 0xc
jmp 0x401362
mov eax, dword [0x408a78]
push str.__________________________________________________________________n
push eax
call sub.nutlibc4.dll_fprintf
mov ecx, dword [0x408a78]
push esi
push 0x4052ac
push ecx
call sub.nutlibc4.dll_fprintf
mov edx, dword [0x408a78]
push str.__________________________________________________________________n
push edx
call sub.nutlibc4.dll_fprintf
mov eax, dword [0x408a78]
push eax
call sub.nutlibc4.dll_fflush
add esp, 0x20
push esi
call sub.nutlibc4.dll_free
add esp, 4
cmp dword [esp + 0x30], 0
je 0x4012ff
mov edi, 0x4052a9
mov esi, ebx
mov ecx, 1
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x4013bb
call sub.nutlibc4.dll_getpid
push eax
mov eax, dword [0x408a78]
push str._d:
push eax
call sub.nutlibc4.dll_fprintf
mov ecx, dword [0x408a78]
push ebx
push str.___s
push ecx
call sub.nutlibc4.dll_fprintf
mov edx, dword [0x408a78]
push edx
call sub.nutlibc4.dll_fflush
add esp, 0x1c
cmp ebp, 1
je 0x4013c9
cmp ebp, 0x7f
jne 0x4014b6
mov edi, ebx
add edi, 0xffffffff
mov edi, edi
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x4013d0
mov ecx, 0xf
mov esi, str._nThe_command_for_the_slave_afcom_is_not_found_on_the_remote_n
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov edi, ebx
add edi, 0xffffffff
lea esp, [esp]
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x4013f0
mov ecx, 0x10
mov esi, str.host._Please_check_the_PATH_variable_in_the_shell_initialization_n
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edi, ebx
add edi, 0xffffffff
lea ecx, [ecx]
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x401410
mov ecx, 0xf
mov esi, str.script_on_the_remote_host._The_current_environment_is_logged_n
rep movsd dword es:[edi], dword [esi]
mov eax, ebx
movsw word es:[edi], word [esi]
add eax, 0xffffffff
lea ecx, [ecx]
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x401430
mov ecx, dword [str.in_the_file]
mov dword [eax], ecx
mov edx, dword [0x4051d4]
mov dword [eax + 4], edx
mov ecx, dword [0x4051d8]
mov dword [eax + 8], ecx
mov dl, byte [0x4051dc]
mov byte [eax + 0xc], dl
mov eax, dword [esp + 0x2c]
push 0x12c
push eax
push ebx
call sub.nutlibc4.dll_strncat
mov eax, ebx
add esp, 0xc
add eax, 0xffffffff
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x401475
mov ecx, dword [str._on_the_remote_host._n]
mov dword [eax], ecx
mov edx, dword [0x4051bc]
mov dword [eax + 4], edx
mov ecx, dword [0x4051c0]
mov dword [eax + 8], ecx
mov edx, dword [0x4051c4]
mov dword [eax + 0xc], edx
mov ecx, dword [0x4051c8]
mov dword [eax + 0x10], ecx
mov dx, word [0x4051cc]
mov word [eax + 0x14], dx
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x24]
push eax
mov dword [ecx + 8], eax
mov eax, dword [esp + 0x30]
push 0
push eax
push ebx
push ecx
call section..text
add esp, 0x14
pop ebp
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
push esi
call sub.nutlibc4.dll_free
add esp, 4
pop ebp
pop edi
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret