Function at 0x3004cf70
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x30218aa0
push 0x30160f00
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x3021be88]
xor dword [ebp - 8], eax
xor eax, ebp
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov esi, edx
mov ebx, ecx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x28], 0
pushfd
pop dword [ebp - 0x50]
mov eax, dword fs:[0x18]
test eax, eax
jne 0x3004cfcf
mov dword [ebp - 0x30], 0xffffffff
mov dword [ebp - 0x34], 0xffffffff
jmp 0x3004cfde
mov ecx, dword [eax + 0x34]
mov dword [ebp - 0x30], ecx
mov eax, dword [eax + 0xbf4]
mov dword [ebp - 0x34], eax
mov dword [ebp - 4], 0
push 4
push 0x30205c30
push esi
call fcn.3016cc7b
add esp, 0xc
test eax, eax
jne 0x3004d008
add esi, 8
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x28], 1
jmp 0x3004d02e
push 0xe
push str._globalroot
push esi
call fcn.3016b3a4
add esp, 0xc
test eax, eax
jne 0x3004d02b
add esi, 0x1c
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x28], 1
jmp 0x3004d02e
mov dword [ebp - 0x24], esi
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 0x3c], eax
mov dword [ebp - 4], 0xfffffffe
pushfd
pop dword [ebp - 0x20]
mov eax, dword fs:[0x18]
test eax, eax
jne 0x3004d059
or edi, 0xffffffff
mov dword [ebp - 0x2c], 0xffffffff
jmp 0x3004d065
mov edi, dword [eax + 0x34]
mov eax, dword [eax + 0xbf4]
mov dword [ebp - 0x2c], eax
push 0x10000
push 0
push dword [0x30272510]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
mov dword [ebp - 0x1c], esi
mov eax, dword fs:[0x18]
test eax, eax
je 0x3004d09c
mov dword [eax + 0x34], edi
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 0xbf4], ecx
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x3004d09c
push eax
popfd
pushfd
pop dword [ebp - 0x38]
mov eax, dword fs:[0x18]
test eax, eax
jne 0x3004d0b6
or edi, 0xffffffff
mov dword [ebp - 0x2c], 0xffffffff
jmp 0x3004d0c2
mov edi, dword [eax + 0x34]
mov eax, dword [eax + 0xbf4]
mov dword [ebp - 0x2c], eax
push 0x10000
push 0
push dword [0x30272510]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x20], eax
mov ecx, dword fs:[0x18]
test ecx, ecx
je 0x3004d0fb
mov dword [ecx + 0x34], edi
mov edx, dword [ebp - 0x2c]
mov dword [ecx + 0xbf4], edx
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x3004d0f8
push eax
popfd
mov eax, dword [ebp - 0x20]
test esi, esi
je 0x3004d20a
test eax, eax
je 0x3004d20a
push 8
push str.device_
mov edi, dword [ebp - 0x24]
push edi
call fcn.3016b3a4
add esp, 0xc
test eax, eax
je 0x3004d250
push 0xb
push 0x302081b0
push edi
call fcn.3016b3a4
add esp, 0xc
test eax, eax
je 0x3004d250
cmp dword [ebp - 0x3c], 1
jbe 0x3004d18c
cmp word [edi + 2], 0x3a
jne 0x3004d18c
mov ecx, 0x10000
call fcn.30001150
mov esi, eax
test esi, esi
je 0x3004d20a
mov ecx, dword [0x302081c8]
mov dword [esi], ecx
mov ecx, dword [0x302081cc]
mov dword [esi + 4], ecx
mov cx, word [0x302081d0]
mov word [esi + 8], cx
push 0x7ffc
push edi
push esi
call fcn.3016ccb5
jmp 0x3004d33d
cmp dword [ebp - 0x28], 0
je 0x3004d1f3
mov eax, dword [0x30205c30]
mov dword [ebx], eax
mov eax, dword [0x30205c34]
mov dword [ebx + 4], eax
mov ax, word [0x30205c38]
mov word [ebx + 8], ax
push 0x7ffc
push edi
push ebx
call fcn.3016ccb5
add esp, 0xc
mov edi, dword [ebp - 0x1c]
xor eax, eax
mov word [ebx + 0xfffe], ax
test edi, edi
je 0x3004d509
pushfd
pop dword [ebp - 0x48]
mov eax, dword fs:[0x18]
test eax, eax
jne 0x3004d4c5
mov dword [ebp - 0x2c], 0xffffffff
mov dword [ebp - 0x1c], 0xffffffff
jmp 0x3004d4d4
push 0
push esi
push 0x8000
push edi
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
test eax, eax
jne 0x3004d36a
mov edi, dword [ebp - 0x1c]
push 0x8000
push dword [ebp - 0x24]
push ebx
call fcn.30169d16
push 4
push 0x302081c8
push ebx
call fcn.3016cc7b
add esp, 0x18
test eax, eax
jne 0x3004d1bd
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [eax*2 - 6]
push eax
lea eax, [ebx + 8]
push eax
push ebx
call fcn.30161f30
add esp, 0xc
jmp 0x3004d1bd
xor esi, esi
cmp dword [0x3024676c], esi
jbe 0x3004d20a
lea ebx, [ebx]
mov edx, dword [esi*4 + 0x302466f8]
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x38], eax
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x3004d270
sub ecx, dword [ebp - 0x38]
sar ecx, 1
push ecx
push edx
push edi
call fcn.3016b3a4
add esp, 0xc
test eax, eax
je 0x3004d29d
inc esi
cmp esi, dword [0x3024676c]
jb 0x3004d260
jmp 0x3004d20a
push dword [esi*4 + 0x302466f8]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 0x40], eax
mov esi, dword [esi*4 + 0x30246780]
test esi, esi
je 0x3004d20a
mov ecx, 0x10000
call fcn.30001150
mov edx, eax
mov dword [ebp - 0x44], edx
test edx, edx
je 0x3004d20a
mov ecx, dword [0x302081c8]
mov dword [edx], ecx
mov ecx, dword [0x302081cc]
mov dword [edx + 4], ecx
mov cx, word [0x302081d0]
mov word [edx + 8], cx
mov ecx, esi
mov dword [ebp - 0x38], ecx
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x3004d2f4
sub esi, ecx
lea edi, [edx - 2]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x3004d304
mov ecx, esi
mov dword [ebp - 0x2c], esi
mov esi, dword [ebp - 0x38]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0x2c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x7ff9
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x40]
lea eax, [eax + ecx*2]
push eax
push edx
call fcn.3016ccb5
mov esi, dword [ebp - 0x44]
add esp, 0xc
push 0
mov edi, dword [ebp - 0x1c]
push edi
push 0x8000
push esi
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
mov ecx, esi
test eax, eax
jne 0x3004d362
call fcn.300011f0
jmp 0x3004d20d
call fcn.300011f0
mov esi, dword [ebp - 0x1c]
mov eax, 0x7fff
mov dword [ebp - 0x2c], eax
xor eax, eax
mov ecx, dword [ebp - 0x20]
mov word [ecx + 0xfffe], ax
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x8000
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
jne 0x3004d3f0
call edi
cmp eax, 2
je 0x3004d3ae
call edi
cmp eax, 3
je 0x3004d3ae
call edi
cmp eax, 0x7b
jne 0x3004d20a
push 0x5c
push esi
call fcn.301618f9
add esp, 8
mov esi, eax
test esi, esi
je 0x3004d20a
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edx, dword [ebp - 0x2c]
sub edx, eax
mov dword [ebp - 0x2c], edx
lea ecx, [eax + eax]
push ecx
push esi
mov eax, dword [ebp - 0x20]
lea eax, [eax + edx*2]
push eax
call fcn.301619b0
add esp, 0xc
xor eax, eax
mov word [esi], ax
mov esi, dword [ebp - 0x1c]
jmp 0x3004d384
push ebx
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
call edi
mov ecx, 0x8000
sub ecx, eax
push ecx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x20]
lea eax, [ecx + eax*2]
push eax
push ebx
call fcn.3016ccb5
push 4
push 0x302081c8
push ebx
call fcn.3016cc7b
add esp, 0x18
test eax, eax
jne 0x3004d43d
push ebx
call edi
lea eax, [eax*2 - 6]
push eax
lea eax, [ebx + 8]
push eax
push ebx
call fcn.30161f30
add esp, 0xc
call fcn.3004e740
test eax, eax
je 0x3004d1ba
push dword [0x302466ec]
push dword [0x30246674]
push ebx
call fcn.3016b3a4
add esp, 0xc
test eax, eax
jne 0x3004d1ba
mov eax, dword [0x302466ec]
lea esi, [ebx + eax*2]
lea eax, [ebx + eax*2]
push eax
call edi
lea eax, [eax*2 + 2]
push eax
push esi
lea eax, [esi + 2]
push eax
call fcn.30161f30
mov eax, dword [0x30246678]
add eax, eax
push eax
push dword [0x30246778]
push ebx
call fcn.301619b0
add esp, 0x18
jmp 0x3004d1ba
mov ecx, dword [eax + 0x34]
mov dword [ebp - 0x2c], ecx
mov eax, dword [eax + 0xbf4]
mov dword [ebp - 0x1c], eax
push edi
push 0
push dword [0x30272510]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
call esi
mov eax, dword fs:[0x18]
test eax, eax
je 0x3004d50f
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 0x34], ecx
mov ecx, dword [ebp - 0x1c]
mov dword [eax + 0xbf4], ecx
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x3004d50f
push eax
popfd
jmp 0x3004d50f
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov edx, dword [ebp - 0x20]
test edx, edx
je 0x3004d56b
pushfd
pop edi
mov eax, dword fs:[0x18]
test eax, eax
jne 0x3004d532
mov dword [ebp - 0x2c], 0xffffffff
mov dword [ebp - 0x20], 0xffffffff
jmp 0x3004d541
mov ecx, dword [eax + 0x34]
mov dword [ebp - 0x2c], ecx
mov eax, dword [eax + 0xbf4]
mov dword [ebp - 0x20], eax
push edx
push 0
push dword [0x30272510]
call esi
mov eax, dword fs:[0x18]
test eax, eax
je 0x3004d56b
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 0x34], ecx
mov ecx, dword [ebp - 0x20]
mov dword [eax + 0xbf4], ecx
test edi, edi
je 0x3004d56b
push edi
popfd
cmp word [ebx + 2], 0x3a
jne 0x3004d588
cmp word [ebx + 4], 0x5c
jne 0x3004d588
movzx eax, word [ebx]
push eax
call fcn.3016b23e
add esp, 4
mov word [ebx], ax
mov eax, dword fs:[0x18]
test eax, eax
je 0x3004d5aa
mov ecx, dword [ebp - 0x30]
mov dword [eax + 0x34], ecx
mov ecx, dword [ebp - 0x34]
mov dword [eax + 0xbf4], ecx
mov eax, dword [ebp - 0x50]
test eax, eax
je 0x3004d5aa
push eax
popfd
mov eax, ebx
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret