Function at 0x1003779a
Capabilities:
Check if file exists
Check os version
Get common file path
Get file attributes

Disassembly:
sub esp, 0x830
push ebx
call fcn.10037f01
mov ebx, eax
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x100377c2
push 0x65b
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x10037c8e
call fcn.10037e6b
test eax, eax
je 0x100377e7
push dword [esp + 0x840]
push dword [esp + 0x840]
push dword [esp + 0x840]
call ebx
jmp 0x10037c8e
mov ebx, dword [esp + 0x840]
test bl, 0x60
je 0x1003780b
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
cmp dword [eax + 0xa4], 6
jae 0x1003780b
and ebx, 0xffffff9f
or ebx, 2
push ebp
push esi
push edi
mov esi, ebx
and esi, 0xffffff00
push 0
mov dword [esp + 0x1c], esi
pop ebp
je 0x10037c36
test ebx, 0xffffe00c
jne 0x10037c2a
mov edi, dword [esp + 0x844]
test edi, edi
je 0x10037c2a
cmp dword [esp + 0x848], ebp
jne 0x10037c2a
movzx ebx, bl
mov eax, 0xe00
test esi, 0x1000
je 0x10037867
and esi, 0xffffefff
or esi, eax
mov dword [esp + 0x18], esi
cmp esi, eax
je 0x10037c3d
call fcn.10037f1f
test eax, eax
je 0x1003787d
push edi
call eax
jmp 0x1003787f
mov eax, ebp
mov ecx, esi
and ecx, 0x100
mov dword [esp + 0x14], ecx
je 0x100378b7
test eax, eax
je 0x10037c2a
cmp eax, 3
je 0x10037c2a
cmp eax, 5
je 0x10037c2a
cmp esi, 0xf00
jne 0x100378b7
or ebx, 8
jmp 0x10037c3d
mov ecx, 0x400
test ecx, esi
jne 0x10037c2a
test bl, 0x62
je 0x10037a16
test eax, eax
je 0x100378df
cmp eax, 3
je 0x100378df
cmp eax, 5
jne 0x10037c3d
test esi, 0x200
je 0x1003799f
push ecx
lea eax, [esp + 0x44]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov edx, eax
test edx, edx
je 0x10037c23
cmp edx, 0x400
jae 0x10037c23
movzx ecx, word [esp + edx*2 + 0x40]
mov eax, ecx
push 0x5c
mov dword [esp + 0x18], eax
pop eax
cmp cx, ax
je 0x10037955
mov eax, ecx
mov dword [esp + 0x20], 0x2f
push 0x5c
movzx eax, ax
pop ecx
cmp ax, word [esp + 0x20]
je 0x10037955
test edx, edx
je 0x10037c23
movzx eax, word [esp + edx*2 + 0x3e]
dec edx
mov esi, eax
mov dword [esp + 0x14], esi
mov esi, dword [esp + 0x18]
cmp ax, cx
jne 0x10037931
inc edx
mov ecx, edi
cmp word [edi], bp
je 0x1003797a
cmp edx, 0x400
jae 0x10037c23
mov ax, word [ecx]
add ecx, 2
mov word [esp + edx*2 + 0x40], ax
inc edx
cmp word [ecx], bp
jne 0x1003795d
xor eax, eax
mov word [esp + edx*2 + 0x40], ax
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x1003799a
lea edi, [esp + 0x40]
jmp 0x10037c3d
mov ecx, 0x400
test esi, 0x800
je 0x10037a0f
push ecx
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ecx, eax
test ecx, ecx
je 0x10037c23
cmp ecx, 0x400
jae 0x10037c23
push 0x5c
pop eax
cmp word [esp + ecx*2 + 0x40], ax
je 0x100379f3
inc ecx
mov word [esp + ecx*2 + 0x40], ax
jmp 0x100379f3
cmp ecx, 0x400
jae 0x10037c23
mov ax, word [edi]
add edi, 2
mov word [esp + ecx*2 + 0x40], ax
inc ecx
cmp word [edi], bp
jne 0x100379db
xor eax, eax
mov word [esp + ecx*2 + 0x40], ax
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x10037991
push 0x7e
jmp 0x10037c2c
call fcn.10037ec5
mov dword [esp + 0x24], eax
test eax, eax
je 0x10037c23
cmp dword [esp + 0x14], 0
mov esi, ebp
push 0x5c
pop edx
mov dword [esp + 0x20], 0x2f
je 0x10037ad1
mov eax, edi
mov dword [esp + 0x14], eax
cmp word [edi], bp
je 0x10037c23
mov ecx, 0x400
mov dword [esp + 0x34], esi
cmp esi, ecx
jae 0x10037c23
movzx eax, word [eax]
mov edi, eax
mov word [esp + esi*2 + 0x40], ax
mov eax, dword [esp + 0x14]
add eax, 2
mov dword [esp + 0x10], edi
mov edi, dword [esp + 0x844]
inc esi
mov dword [esp + 0x14], eax
cmp word [eax], bp
jne 0x10037a53
test esi, esi
je 0x10037c23
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x34]
cmp ax, dx
je 0x10037ac4
movzx eax, ax
cmp ax, word [esp + 0x20]
je 0x10037ac4
test esi, esi
je 0x10037c23
movzx eax, word [esp + esi*2 + 0x3e]
dec esi
mov edi, eax
mov dword [esp + 0x10], edi
mov edi, dword [esp + 0x844]
cmp ax, dx
jne 0x10037a9d
push 0x3b
pop eax
mov word [esp + esi*2 + 0x42], ax
add esi, 2
jmp 0x10037ad6
mov ecx, 0x400
mov eax, dword [esp + 0x18]
test eax, 0x200
je 0x10037b3d
sub ecx, esi
lea eax, [esp + 0x40]
push ecx
lea eax, [eax + esi*2]
mov dword [esp + 0x14], ecx
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x10037c23
cmp eax, dword [esp + 0x10]
jae 0x10037c23
dec eax
push 0x5c
add esi, eax
pop ecx
jmp 0x10037b22
push 0x2f
pop eax
cmp dx, ax
je 0x10037b2e
test esi, esi
je 0x10037c23
dec esi
movzx eax, word [esp + esi*2 + 0x40]
mov edx, eax
cmp ax, cx
jne 0x10037b11
push 0x3b
pop eax
mov word [esp + esi*2 + 0x42], ax
add esi, 2
mov eax, dword [esp + 0x18]
test eax, 0x800
je 0x10037b72
mov eax, 0x400
sub eax, esi
push eax
mov dword [esp + 0x14], eax
lea eax, [esp + 0x44]
lea eax, [eax + esi*2]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x10037c23
cmp eax, dword [esp + 0x10]
jae 0x10037c23
add esi, eax
xor eax, eax
mov word [esp + esi*2 + 0x40], ax
mov eax, edi
mov dword [esp + 0x3c], eax
jmp 0x10037b84
add edi, 2
cmp word [edi], bp
jne 0x10037b81
sub edi, eax
mov dword [esp + 0x2c], ebp
and edi, 0xfffffffe
mov dword [esp + 0x1c], ebp
mov word [esp + 0x38], di
lea eax, [edi + 2]
mov word [esp + 0x3a], ax
mov eax, ebp
test bl, 1
je 0x10037bb5
push 2
mov dword [esp + 0x20], 2
pop eax
test bl, 0x10
je 0x10037bc3
or eax, 0x1000
mov dword [esp + 0x1c], eax
test bl, bl
jns 0x10037bd0
or eax, 0x800000
mov dword [esp + 0x1c], eax
call fcn.10037f5b
mov esi, eax
test esi, esi
je 0x10037be5
lea eax, [esp + 0x28]
push eax
push ebp
call esi
mov ebp, eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x3c]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x4c]
push eax
call dword [esp + 0x34]
mov edi, eax
test ebp, ebp
js 0x10037c12
test esi, esi
je 0x10037c12
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x2c]
call esi
test edi, edi
jns 0x10037c1d
mov ecx, edi
call fcn.10037dbd
mov eax, dword [esp + 0x2c]
jmp 0x10037c8b
push 0x65b
jmp 0x10037c2c
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x10037c8b
mov edi, dword [esp + 0x844]
call fcn.10037f5b
mov esi, eax
mov dword [esp + 0x10], esi
test esi, esi
je 0x10037c56
lea eax, [esp + 0x30]
push eax
push ebp
call esi
mov ebp, eax
push ebx
push dword [esp + 0x84c]
push edi
call dword [esp + 0x30]
mov edi, eax
test ebp, ebp
js 0x10037c89
test esi, esi
je 0x10037c89
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
lea eax, [esp + 0x30]
push eax
push dword [esp + 0x34]
call dword [esp + 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x830
ret 0xc