Function at 0x403c30
Capabilities:
Query environment variable
Write file on windows

Disassembly:
push ebp
push edi
mov ebp, eax
push esi
push ebx
sub esp, 0x9c
mov dword [esp], str.TMPDIR
mov dword [esp + 0x28], edx
call sub.cygwin1.dll_getenv
test eax, eax
mov ebx, eax
je 0x403f0c
mov dword [esp], 0x1001
call sub.cygwin1.dll_malloc
test eax, eax
mov esi, eax
je 0x403f29
mov dword [esp], ebx
call sub.cygwin1.dll_strlen
mov dword [esp + 4], ebx
mov edi, eax
mov dword [esp + 8], eax
mov dword [esp], esi
mov ebx, 1
call sub.cygwin1.dll_memcpy
lea eax, [esi + edi + 1]
mov byte [esi + edi], 0x2f
mov dword [esp + 0x24], eax
mov esi, esi
lea edi, [edi]
call sub.cygwin1.dll_getpid
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x10], ebx
mov dword [esp + 8], ebp
mov dword [esp + 4], str._s._lu._d
mov dword [esp], eax
call sub.cygwin1.dll_sprintf
mov dword [esp + 8], 0x1c0
mov dword [esp + 4], 0xa01
mov dword [esp], esi
call sub.cygwin1.dll__open64
cmp eax, 0xffffffff
mov edi, eax
je 0x403e33
lea eax, [esp + 0x30]
mov dword [esp], esi
mov dword [esp + 4], eax
call sub.cygwin1.dll__lstat64
test eax, eax
jne 0x403dc0
mov eax, dword [esp + 0x40]
and eax, 0xf000
cmp eax, 0xa000
je 0x403eb4
mov ebx, dword [esp + 0x28]
mov dword [esp], ebx
call sub.cygwin1.dll_strlen
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov dword [esp], edi
mov dword [esp + 0x28], ebx
call sub.cygwin1.dll_write
mov ebx, eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.cygwin1.dll_strlen
cmp ebx, eax
je 0x403ed5
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov ebx, eax
call sub.cygwin1.dll___getreent
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], esi
mov dword [esp + 8], ebp
mov dword [esp + 4], str.send_pseudo__s:_cannot_write_to_tmpfile__s:__s
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp], 0x40def0
mov dword [esp + 0xc], eax
call sub.cygwin1.dll_fwrite
mov dword [esp], esi
call sub.cygwin1.dll_free
mov eax, 1
add esp, 0x9c
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov dword [esp + 0x2c], eax
call sub.cygwin1.dll___getreent
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0xc], esi
mov dword [esp + 8], ebp
mov dword [esp + 4], str.send_pseudo__s:_cannot_lstat_tmpfile__s:__s
mov dword [esp + 0x10], ecx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp], 0x40def0
mov dword [esp + 0xc], eax
call sub.cygwin1.dll_fwrite
mov dword [esp], esi
call sub.cygwin1.dll_unlink
mov dword [esp], edi
call sub.cygwin1.dll_close
add ebx, 1
cmp ebx, 0xb
jne 0x403ca0
mov dword [esp], esi
call sub.cygwin1.dll_free
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov ebx, eax
call sub.cygwin1.dll___getreent
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], esi
mov dword [esp + 8], ebp
mov dword [esp + 4], str.send_pseudo__s:_cannot_open_tmpfile__s:__s
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp], 0x40def0
mov dword [esp + 0xc], eax
call sub.cygwin1.dll_fwrite
add esp, 0x9c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.cygwin1.dll___getreent
mov dword [esp + 8], ebp
mov dword [esp + 4], str.send_pseudo__s:_avoiding_symlink_trap
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
jmp 0x403dfb
mov dword [esp], edi
call sub.cygwin1.dll_close
test eax, eax
jne 0x403d4a
mov edx, ebp
mov eax, esi
xor ebx, ebx
call fcn.004034a0
add eax, 1
je 0x403f4a
mov dword [esp], esi
call sub.cygwin1.dll_unlink
mov dword [esp], esi
call sub.cygwin1.dll_free
mov eax, ebx
jmp 0x403db4
mov dword [esp], 0x40e346
call sub.cygwin1.dll_getenv
mov ebx, eax
test eax, eax
mov eax, str._tmp
cmove ebx, eax
jmp 0x403c56
mov dword [esp + 8], 0x40e2a0
mov dword [esp + 4], 0
mov dword [esp], 1
call fcn.00409570
jmp 0x403c6c
cmp dword [0x412064], 0
jne 0x403f8c
sub dword [0x412044], 1
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 2
mov ebx, 1
mov dword [esp + 4], 1
mov dword [esp], 0x40def0
mov dword [esp + 0xc], eax
call sub.cygwin1.dll_fwrite
jmp 0x403ef5
call sub.cygwin1.dll___getreent
mov dword [esp + 8], ebp
mov dword [esp + 4], str.send_pseudo__s:_failed
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
jmp 0x403f5a