Function at 0x487100
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 sym._getenv
add esp, 4
test eax, eax
je 0x4874d7
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 0x487130
test bl, bl
je 0x4874d7
push 0x40
call sym._malloc
add esp, 4
mov ebx, eax
mov byte [eax], 0
push ebp
call sym._strlen
add esp, 4
mov esi, eax
test eax, eax
sete al
mov dword [esp], eax
je 0x4871e4
cmp esi, 0x3f
jbe 0x4871ed
mov dword [esp + 4], esi
inc esi
mov eax, 0x40
nop dword [eax]
mov edi, eax
add eax, eax
cmp esi, edi
ja 0x487180
push edi
push ebx
call sym._realloc
add esp, 8
mov ebx, dword [esp + 4]
push ebx
push ebp
mov ebp, eax
push eax
call sym._memcpy
add esp, 0xc
mov byte [ebp + ebx], 0
test edi, edi
jne 0x4871de
mov ebx, ebp
mov eax, 0x20
nop word cs:[eax + eax]
mov edi, eax
add eax, eax
cmp esi, edi
ja 0x4871c0
push edi
call sym._malloc
add esp, 4
mov ebp, eax
push esi
push ebx
push eax
call sym._memcpy
add esp, 0xc
mov esi, dword [esp + 4]
jmp 0x487203
mov edi, 0x40
mov ebp, ebx
jmp 0x487234
push esi
push ebp
mov ebp, ebx
push ebx
call sym._memcpy
add esp, 0xc
mov byte [ebx + esi], 0
mov edi, 0x40
push 0x5c
push ebp
nop word cs:[eax + eax]
call sym._strchr
add esp, 8
test eax, eax
je 0x487225
mov byte [eax], 0x2f
inc eax
push 0x5c
push eax
jmp 0x487210
cmp byte [esi + ebp - 1], 0x2f
je 0x4872b6
test edi, edi
je 0x487244
lea eax, [esi + 1]
cmp edi, eax
jne 0x4872aa
xor eax, eax
cmp edi, 1
jbe 0x48724d
jmp 0x487252
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 0x487260
test al, al
je 0x487289
mov ebx, esi
mov esi, ebp
push edi
call sym._malloc
add esp, 4
mov ebp, eax
cmp byte [esp], 0
je 0x487297
mov byte [ebp], 0
mov esi, ebx
jmp 0x4872a7
push edi
push ebp
call sym._realloc
add esp, 8
mov ebp, eax
jmp 0x4872a7
lea eax, [ebx + 1]
push eax
push esi
mov esi, ebx
push ebp
call sym._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 0x48736b
push eax
call sym._strlen
add esp, 4
test eax, eax
je 0x487360
test edi, edi
mov dword [esp], eax
je 0x4872e4
mov ecx, esi
not ecx
add ecx, edi
cmp ecx, eax
jae 0x48731a
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 0x487300
test edi, edi
je 0x48731e
push ebx
push ebp
call sym._realloc
add esp, 8
mov ebp, eax
jmp 0x487343
mov ebx, edi
jmp 0x487343
mov edi, ebp
push ebx
call sym._malloc
add esp, 4
mov ebp, eax
test esi, esi
je 0x48733f
push dword [esp + 4]
push edi
push ebp
call sym._memcpy
add esp, 0xc
jmp 0x487343
mov byte [ebp], 0
lea eax, [esi + ebp]
mov edi, dword [esp]
push edi
push dword [esp + 0x2c]
push eax
call sym._memcpy
add esp, 0xc
add esi, edi
mov byte [ebp + esi], 0
mov edi, ebx
test esi, esi
je 0x487370
cmp byte [esi + ebp - 1], 0x2f
jne 0x487370
mov dword [esp], esi
jmp 0x4873e7
lea eax, [esi + 1]
test edi, edi
mov dword [esp], eax
je 0x487384
cmp edi, eax
je 0x487384
mov ebx, esi
mov esi, edi
jmp 0x4873de
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 0x4873a0
test edi, edi
je 0x4873ba
push esi
push ebp
call sym._realloc
add esp, 8
mov ebp, eax
jmp 0x4873de
mov edi, ebp
push esi
call sym._malloc
add esp, 4
mov ebp, eax
test ebx, ebx
je 0x4873da
push dword [esp]
push edi
push ebp
call sym._memcpy
add esp, 0xc
jmp 0x4873de
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 0x4874c8
and eax, 0x10
je 0x4874c8
mov ebx, dword [edx + 8]
test ebx, ebx
je 0x48746c
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 sym._memcmp
add esp, 0xc
test eax, eax
je 0x4874bc
inc esi
add ebp, dword [esp + 0x10]
cmp ebx, esi
jne 0x487430
mov edx, dword [esp + 8]
mov ebp, dword [esp + 4]
mov esi, dword [esp + 0xc]
cmp ebx, dword [edx + 0xc]
je 0x487479
jmp 0x4874a2
xor esi, esi
cmp esi, ebx
jne 0x4874c8
mov esi, dword [edx]
cmp ebx, dword [edx + 0xc]
jne 0x4874a2
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 sym._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 0x4874d7
mov edx, dword [esp + 8]
mov ebp, dword [esp + 4]
cmp esi, ebx
je 0x487472
test edi, edi
je 0x4874d7
push ebp
call sym._free
add esp, 0x18
jmp 0x4874da
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret