Function at 0x4012e0
Capabilities:
Create process on windows
Get file attributes
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5ac
mov dword [esp], str.PATH
call sub.msvcrt.dll_getenv
mov esi, eax
mov eax, str.cygwin_bin
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_strstr
test eax, eax
je 0x40142b
mov esi, 0x44
xor ebx, ebx
lea eax, [ebp - 0x578]
mov dword [esp + 8], esi
lea esi, [ebp - 0x588]
mov edi, esi
mov dword [esp + 4], ebx
lea ebx, [ebp - 0x528]
mov dword [esp], eax
call sub.msvcrt.dll_memset
lea eax, [ebp - 0x578]
mov dword [esp], eax
call sub.KERNEL32.dll_GetStartupInfoA
cld
xor eax, eax
mov ecx, 4
sub esp, 4
rep stosd dword es:[edi], eax
mov dword [esp], ebx
mov ecx, str.cygterm.exe
mov dword [esp + 4], ecx
call sub.msvcrt.dll_strcpy
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
mov edx, 0x20
mov ecx, ebx
mov word [ebp + eax - 0x528], dx
jmp 0x401390
mov eax, dword [ecx]
add ecx, 4
lea edx, [eax - 0x1010101]
not eax
and edx, eax
and edx, 0x80808080
je 0x401390
test edx, 0x8080
jne 0x4013b5
shr edx, 0x10
add ecx, 2
add dl, dl
mov eax, 0x3ff
sbb ecx, 3
sub ecx, ebx
xor edi, edi
sub eax, ecx
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sub.msvcrt.dll_strncat
mov dword [esp + 0x24], esi
lea eax, [ebp - 0x578]
xor esi, esi
mov dword [esp + 0x20], eax
xor eax, eax
mov dword [esp + 0x1c], eax
xor eax, eax
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], edi
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], 0
call sub.KERNEL32.dll_CreateProcessA
sub esp, 0x28
test eax, eax
je 0x401510
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp + 8]
mov edi, str._s_bin
mov ebx, 0x104
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x128]
mov dword [esp], eax
call sub.msvcrt.dll__snprintf
lea eax, [ebp - 0x128]
mov dword [esp], eax
call sub.KERNEL32.dll_GetFileAttributesA
sub esp, 4
inc eax
je 0x401542
test esi, esi
je 0x40158e
lea edi, [ebp - 0x128]
nop
lea esi, [esi]
mov eax, dword [edi]
add edi, 4
lea edx, [eax - 0x1010101]
not eax
and edx, eax
and edx, 0x80808080
je 0x401480
test edx, 0x8080
jne 0x4014a5
shr edx, 0x10
add edi, 2
mov dword [esp], esi
add dl, dl
lea eax, [ebp - 0x128]
sbb edi, 3
sub edi, eax
call sub.msvcrt.dll_strlen
lea edi, [edi + eax + 7]
mov dword [esp], edi
call sub.msvcrt.dll_malloc
test eax, eax
mov ebx, eax
je 0x40160a
mov dword [esp + 0x10], esi
lea eax, [ebp - 0x128]
mov dword [esp + 0xc], eax
mov eax, str.PATH_s__s
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], ebx
call sub.msvcrt.dll__snprintf
mov dword [esp], ebx
call sub.msvcrt.dll__putenv
test ebx, ebx
je 0x401313
mov dword [esp], ebx
call sub.msvcrt.dll_free
jmp 0x401313
mov ecx, 0x30
mov edx, str.ERROR
mov eax, str.Cant_execute_Cygterm.
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], 0
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov bl, 0x43
lea esi, [esi]
lea edi, [edi]
mov byte [ebp - 0x128], bl
lea eax, [ebp - 0x128]
mov dword [esp], eax
call sub.KERNEL32.dll_GetFileAttributesA
sub esp, 4
inc eax
jne 0x40146a
inc bl
cmp bl, 0x5a
jle 0x401550
mov ecx, 0x30
mov edx, str.ERROR
mov eax, str.Cant_find_Cygwin_directory.
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
jmp 0x401527
lea ebx, [ebp - 0x128]
mov eax, dword [ebx]
add ebx, 4
lea edx, [eax - 0x1010101]
not eax
and edx, eax
and edx, 0x80808080
je 0x401594
test edx, 0x8080
je 0x401602
mov dword [esp], 0
add dl, dl
lea eax, [ebp - 0x128]
sbb ebx, 3
sub ebx, eax
call sub.msvcrt.dll_strlen
lea edi, [ebx + eax + 6]
mov dword [esp], edi
call sub.msvcrt.dll_malloc
test eax, eax
mov ebx, eax
je 0x40160a
mov dword [esp + 4], edi
lea eax, [ebp - 0x128]
mov dword [esp + 0xc], eax
mov eax, str.PATH_s
mov dword [esp + 8], eax
mov dword [esp], ebx
call sub.msvcrt.dll__snprintf
jmp 0x4014f3
shr edx, 0x10
add ebx, 2
jmp 0x4015b3
mov eax, 0x30
mov dword [esp + 0xc], eax
mov eax, str.ERROR
mov dword [esp + 8], eax
mov eax, str.Cant_allocate_memory.
jmp 0x401527