Function at 0x486ed0
Capabilities:
Check if file exists
Get file attributes
Query environment variable

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x14
mov dword [esp + 8], ecx
push edx
call sub.api_ms_win_crt_environment_l1_1_0.dll_getenv
add esp, 4
test eax, eax
je 0x4872a7
mov ebp, eax
mov esi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isspace]
mov edi, eax
nop word cs:[eax + eax]
movsx ebx, byte [edi]
push ebx
call esi
add esp, 4
inc edi
test eax, eax
jne 0x486f00
test bl, bl
je 0x4872a7
push 0x40
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
add esp, 4
mov ebx, eax
mov byte [eax], 0
push ebp
call sub.api_ms_win_crt_string_l1_1_0.dll_strlen
add esp, 4
mov esi, eax
test eax, eax
sete al
mov dword [esp], eax
je 0x486fb4
cmp esi, 0x3f
jbe 0x486fbd
mov dword [esp + 4], esi
inc esi
mov eax, 0x40
nop dword [eax]
mov edi, eax
add eax, eax
cmp esi, edi
ja 0x486f50
push edi
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_realloc
add esp, 8
mov ebx, dword [esp + 4]
push ebx
push ebp
mov ebp, eax
push eax
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov byte [ebp + ebx], 0
test edi, edi
jne 0x486fae
mov ebx, ebp
mov eax, 0x20
nop word cs:[eax + eax]
mov edi, eax
add eax, eax
cmp esi, edi
ja 0x486f90
push edi
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
add esp, 4
mov ebp, eax
push esi
push ebx
push eax
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov esi, dword [esp + 4]
jmp 0x486fd3
mov edi, 0x40
mov ebp, ebx
jmp 0x487004
push esi
push ebp
mov ebp, ebx
push ebx
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov byte [ebx + esi], 0
mov edi, 0x40
push 0x5c
push ebp
nop word cs:[eax + eax]
call sub.api_ms_win_crt_private_l1_1_0.dll_strchr
add esp, 8
test eax, eax
je 0x486ff5
mov byte [eax], 0x2f
inc eax
push 0x5c
push eax
jmp 0x486fe0
cmp byte [esi + ebp - 1], 0x2f
je 0x487086
test edi, edi
je 0x487014
lea eax, [esi + 1]
cmp edi, eax
jne 0x48707a
xor eax, eax
cmp edi, 1
jbe 0x48701d
jmp 0x487022
mov al, 1
mov dword [esp], 0
mov edi, 0x20
lea ecx, [esi + 2]
mov edx, edi
nop word [eax + eax]
mov edi, edx
add edx, edx
cmp ecx, edi
ja 0x487030
test al, al
je 0x487059
mov ebx, esi
mov esi, ebp
push edi
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
add esp, 4
mov ebp, eax
cmp byte [esp], 0
je 0x487067
mov byte [ebp], 0
mov esi, ebx
jmp 0x487077
push edi
push ebp
call sub.api_ms_win_crt_heap_l1_1_0.dll_realloc
add esp, 8
mov ebp, eax
jmp 0x487077
lea eax, [ebx + 1]
push eax
push esi
mov esi, ebx
push ebp
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov eax, esi
inc eax
mov byte [ebp + esi], 0x2f
mov byte [ebp + eax], 0
mov esi, eax
mov eax, dword [esp + 0x28]
test eax, eax
je 0x48713b
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_strlen
add esp, 4
test eax, eax
je 0x487130
test edi, edi
mov dword [esp], eax
je 0x4870b4
mov ecx, esi
not ecx
add ecx, edi
cmp ecx, eax
jae 0x4870ea
cmp edi, 2
mov edx, 0x20
cmovae edx, edi
mov ecx, esi
inc esi
mov dword [esp + 4], esi
mov esi, ecx
add ecx, eax
inc ecx
nop dword [eax + eax]
mov ebx, edx
add edx, edx
cmp ecx, ebx
ja 0x4870d0
test edi, edi
je 0x4870ee
push ebx
push ebp
call sub.api_ms_win_crt_heap_l1_1_0.dll_realloc
add esp, 8
mov ebp, eax
jmp 0x487113
mov ebx, edi
jmp 0x487113
mov edi, ebp
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
add esp, 4
mov ebp, eax
test esi, esi
je 0x48710f
push dword [esp + 4]
push edi
push ebp
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
jmp 0x487113
mov byte [ebp], 0
lea eax, [esi + ebp]
mov edi, dword [esp]
push edi
push dword [esp + 0x2c]
push eax
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
add esi, edi
mov byte [ebp + esi], 0
mov edi, ebx
test esi, esi
je 0x487140
cmp byte [esi + ebp - 1], 0x2f
jne 0x487140
mov dword [esp], esi
jmp 0x4871b7
lea eax, [esi + 1]
test edi, edi
mov dword [esp], eax
je 0x487154
cmp edi, eax
je 0x487154
mov ebx, esi
mov esi, edi
jmp 0x4871ae
cmp edi, 2
mov eax, 0x20
cmovae eax, edi
mov ebx, esi
lea ecx, [esi + 2]
nop word cs:[eax + eax]
mov esi, eax
add eax, eax
cmp ecx, esi
ja 0x487170
test edi, edi
je 0x48718a
push esi
push ebp
call sub.api_ms_win_crt_heap_l1_1_0.dll_realloc
add esp, 8
mov ebp, eax
jmp 0x4871ae
mov edi, ebp
push esi
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
add esp, 4
mov ebp, eax
test ebx, ebx
je 0x4871aa
push dword [esp]
push edi
push ebp
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
jmp 0x4871ae
mov byte [ebp], 0
mov word [ebp + ebx], 0x2f
mov edi, esi
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
mov edx, dword [esp + 8]
je 0x487298
and eax, 0x10
je 0x487298
mov ebx, dword [edx + 8]
test ebx, ebx
je 0x48723c
mov dword [esp + 4], ebp
mov eax, dword [edx]
mov edx, dword [edx + 4]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
lea ebp, [eax + 8]
xor esi, esi
nop word cs:[eax + eax]
mov eax, dword [ebp - 4]
mov ecx, dword [esp]
cmp eax, ecx
cmovae eax, ecx
inc eax
push eax
push dword [esp + 8]
push dword [ebp]
call sub.api_ms_win_crt_private_l1_1_0.dll_memcmp
add esp, 0xc
test eax, eax
je 0x48728c
inc esi
add ebp, dword [esp + 0x10]
cmp ebx, esi
jne 0x487200
mov edx, dword [esp + 8]
mov ebp, dword [esp + 4]
mov esi, dword [esp + 0xc]
cmp ebx, dword [edx + 0xc]
je 0x487249
jmp 0x487272
xor esi, esi
cmp esi, ebx
jne 0x487298
mov esi, dword [edx]
cmp ebx, dword [edx + 0xc]
jne 0x487272
lea eax, [ebx + ebx]
test ebx, ebx
mov ecx, 0x10
cmovne ecx, eax
mov dword [edx + 0xc], ecx
imul ecx, dword [edx + 4]
push ecx
push esi
call sub.api_ms_win_crt_heap_l1_1_0.dll_realloc
mov edx, dword [esp + 0x10]
add esp, 8
mov esi, eax
mov dword [edx], eax
mov ebx, dword [edx + 8]
lea eax, [ebx + 1]
mov dword [edx + 8], eax
imul ebx, dword [edx + 4]
mov dword [esi + ebx], edi
mov dword [esi + ebx + 8], ebp
mov eax, dword [esp]
mov dword [esi + ebx + 4], eax
jmp 0x4872a7
mov edx, dword [esp + 8]
mov ebp, dword [esp + 4]
cmp esi, ebx
je 0x487242
test edi, edi
je 0x4872a7
push ebp
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 0x18
jmp 0x4872aa
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret