Function at 0x10050d10
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x620
mov eax, dword [0x1015bdd0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x620], eax
test esi, esi
je 0x100510f3
test eax, eax
je 0x100510f3
cmp dword [ebp + 0x10], 0
je 0x100510f3
push edi
movzx edi, word [esi]
test di, di
jne 0x10050d65
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1007ceab
mov esp, ebp
pop ebp
ret
mov eax, esi
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10050d70
sub eax, edx
sar eax, 1
push ebx
cmp eax, 3
jbe 0x10050f6d
mov ebx, 0x5c
cmp di, bx
jne 0x10050e5d
cmp word [esi + 2], bx
jne 0x10050e5d
movzx ecx, word [esi + 4]
lea eax, [esi + 4]
cmp cx, 0x2e
jne 0x10050db4
cmp word [esi + 6], bx
je 0x10050dc0
cmp cx, 0x3f
jne 0x10050ded
cmp word [esi + 6], bx
jne 0x10050ded
add esi, 8
cmp word [esi], 0
je 0x10050dda
cmp word [esi + 2], 0x3a
jne 0x10050dda
cmp word [esi + 4], bx
je 0x10050e5d
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1007ceab
mov esp, ebp
pop ebp
ret
push ebx
push eax
call fcn.1007dd63
add esp, 8
test eax, eax
je 0x10050dda
push 6
push str.pipe_
push eax
call fcn.1007fbc9
add esp, 0xc
test eax, eax
je 0x10050dda
mov edi, dword [ebp + 0x10]
lea eax, [edi - 1]
push eax
push esi
mov esi, dword [ebp - 0x620]
push esi
call fcn.1007ce61
add esp, 0xc
xor ecx, ecx
mov eax, esi
mov word [esi + edi*2 - 2], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10050e32
sub eax, edx
sar eax, 1
mov edx, 3
cmp edx, eax
pop ebx
sbb eax, eax
pop edi
neg eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1007ceab
mov esp, ebp
pop ebp
ret
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x20a]
push ecx
mov word [ebp - 0x20c], ax
call fcn.1007d080
movzx eax, word [esi + 2]
add esp, 0xc
cmp ax, 0x3a
je 0x10051058
cmp ax, 0x7c
jne 0x10050e99
cmp word [esi + 6], ax
je 0x10051058
lea edx, [ebp - 0x20c]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x10050dda
cmp eax, 0x104
jae 0x10050dda
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10050ec7
sub eax, edx
sar eax, 1
cmp word [esi], 0x2e
mov edx, eax
jne 0x10050efb
movzx eax, word [esi + 2]
cmp ax, bx
jne 0x10050eec
add esi, 4
jmp 0x10050efb
cmp ax, 0x2e
jne 0x10050efb
cmp word [esi + 4], bx
jne 0x10050efb
add esi, 6
mov eax, esi
lea edi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10050f00
sub eax, edi
sar eax, 1
lea eax, [eax + edx + 1]
cmp eax, 0x104
jae 0x10050dda
mov eax, esi
mov word [ebp + edx*2 - 0x20c], bx
mov edx, eax
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10050f30
lea edi, [ebp - 0x20c]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x10050f46
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea esi, [ebp - 0x20c]
jmp 0x10051058
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x412]
push edx
mov word [ebp - 0x414], cx
call fcn.1007d080
add esp, 0xc
cmp word [esi + 2], 0x3a
je 0x10051058
lea eax, [ebp - 0x414]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x10050dda
cmp eax, 0x104
jae 0x10050dda
lea eax, [ebp - 0x414]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10050fc4
sub eax, edx
sar eax, 1
cmp word [esi], 0x2e
mov edx, eax
mov ebx, 0x5c
jne 0x10050fe9
cmp word [esi + 2], bx
jne 0x10050fe9
add esi, 4
mov eax, esi
lea edi, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10050ff0
sub eax, edi
sar eax, 1
lea ecx, [eax + edx + 1]
cmp ecx, 0x104
jae 0x10050dda
mov eax, esi
mov word [ebp + edx*2 - 0x414], bx
mov edx, eax
jmp 0x10051020
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10051020
lea edi, [ebp - 0x414]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x10051036
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea esi, [ebp - 0x414]
xor edx, edx
push 0x206
push edx
lea eax, [ebp - 0x61a]
push eax
mov word [ebp - 0x61c], dx
call fcn.1007d080
push 0x7e
push esi
call fcn.1007dd63
add esp, 0x14
test eax, eax
je 0x100510bf
push 0x104
lea ecx, [ebp - 0x61c]
push ecx
push esi
call fcn.100575d0
add esp, 0xc
test eax, eax
jne 0x100510b9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x100510bf
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1007ceab
mov esp, ebp
pop ebp
ret
lea esi, [ebp - 0x61c]
mov edi, dword [ebp + 0x10]
lea edx, [edi - 1]
push edx
push esi
mov esi, dword [ebp - 0x620]
push esi
call fcn.1007ce61
add esp, 0xc
xor eax, eax
mov word [esi + edi*2 - 2], ax
pop ebx
pop edi
mov eax, 1
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1007ceab
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor ecx, ebp
xor eax, eax
pop esi
call fcn.1007ceab
mov esp, ebp
pop ebp
ret