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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov esi, ecx
xor edi, edi
push edi
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
test esi, esi
je 0x10043051
mov ecx, esi
xor edx, edx
lea ebx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10042966
sub ecx, ebx
sar ecx, 1
je 0x100429b3
nop word [eax + eax]
movzx eax, word [esi + edx*2]
cmp eax, 0x5c
je 0x10043051
cmp eax, 0x2f
je 0x10043051
mov ecx, esi
inc edx
lea ebx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100429a0
sub ecx, ebx
sar ecx, 1
cmp edx, ecx
jb 0x10042980
mov ecx, esi
call fcn.10041d60
mov ebx, eax
mov dword [ebp - 8], ebx
test ebx, ebx
je 0x10042d1b
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
push 0
call eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov esi, eax
lea eax, [esi + esi]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, eax
mov dword [ebp - 4], ecx
test ecx, ecx
je 0x10042d0d
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x10042a05
cmp esi, eax
jae 0x10042a18
push dword [ebp - 4]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
call esi
push ebx
call esi
jmp 0x10043038
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x10042d0d
mov ecx, ebx
call fcn.1003ff80
test eax, eax
je 0x10042c05
mov dword [ebp - 0x14], 0x1046aae0
lea ebx, [ebp - 0x14]
mov dword [ebp - 0x10], 0x1046aab0
mov ecx, dword [ebx]
mov esi, ecx
lea edx, [esi + 2]
nop word [eax + eax]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x10042a50
sub esi, edx
sar esi, 1
push esi
push ecx
push dword [ebp - 8]
call fcn.10433fe8
add esp, 0xc
test eax, eax
je 0x10042ada
add ebx, 4
lea eax, [ebp - 0xc]
cmp ebx, eax
jb 0x10042a43
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
lea eax, [ebp - 0xc]
cmp ebx, eax
mov ebx, dword [ebp - 8]
jne 0x10042d00
movzx eax, word [ebx]
cmp eax, 0x5c
je 0x10042ac9
cmp eax, 0x2f
je 0x10042ac9
push eax
call fcn.1043a2f0
add esp, 4
test eax, eax
je 0x10042d00
cmp word [ebx + 2], 0x3a
jne 0x10042d00
movzx eax, word [ebx + 4]
cmp eax, 0x5c
je 0x10042ac9
cmp eax, 0x2f
jne 0x10042d00
push dword [ebp - 4]
mov edi, ebx
xor ebx, ebx
call esi
push ebx
call esi
jmp 0x10043038
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
lea esi, [eax + esi*2]
mov dword [ebp - 0x10], esi
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10042af0
sub ecx, edx
sar ecx, 1
test esi, esi
jne 0x10042b41
lea esi, [ecx + 1]
lea eax, [esi + esi]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x40
call eax
mov edi, eax
test edi, edi
je 0x10042a7a
push dword [ebp - 4]
mov edx, esi
mov ecx, edi
call fcn.1003f430
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
jns 0x10042a80
push edi
call esi
xor edi, edi
jmp 0x10042a80
mov edx, esi
lea edi, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10042b46
sub edx, edi
sar edx, 1
test ecx, ecx
je 0x10042b75
mov eax, dword [ebp - 4]
cmp word [eax + ecx*2 - 2], 0x5c
je 0x10042b75
test edx, edx
je 0x10042b75
cmp word [esi], 0x5c
je 0x10042b75
mov eax, 1
jmp 0x10042b77
xor eax, eax
mov dword [ebp - 0xc], eax
add eax, ecx
add eax, edx
lea esi, [eax*2 + 2]
mov eax, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push esi
push 0x40
call eax
mov edi, eax
test edi, edi
je 0x10042a7a
push dword [ebp - 4]
mov edx, esi
mov ecx, edi
call fcn.1003f4a0
test eax, eax
jns 0x10042bb9
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call esi
xor edi, edi
jmp 0x10042a80
cmp dword [ebp - 0xc], 0
je 0x10042be1
push 0x1046a5c0
mov edx, esi
mov ecx, edi
call fcn.1003f5b0
test eax, eax
jns 0x10042be1
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call esi
xor edi, edi
jmp 0x10042a80
push dword [ebp - 0x10]
mov edx, esi
mov ecx, edi
call fcn.1003f5b0
test eax, eax
jns 0x10042a7a
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call esi
xor edi, edi
jmp 0x10042a80
mov edi, dword [ebp - 4]
mov ecx, edi
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10042c10
sub ecx, edx
mov edx, ebx
sar ecx, 1
lea esi, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10042c24
sub edx, esi
sar edx, 1
test ecx, ecx
je 0x10042c50
cmp word [edi + ecx*2 - 2], 0x5c
je 0x10042c50
test edx, edx
je 0x10042c50
cmp word [ebx], 0x5c
je 0x10042c50
mov ebx, 1
jmp 0x10042c52
xor ebx, ebx
lea eax, [ebx + edx]
add eax, ecx
lea esi, [eax*2 + 2]
mov eax, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push esi
push 0x40
call eax
mov edi, eax
test edi, edi
je 0x10042cf7
push dword [ebp - 4]
mov edx, esi
mov ecx, edi
call fcn.1003f4a0
test eax, eax
jns 0x10042c9d
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call esi
push dword [ebp - 4]
mov ebx, dword [ebp - 8]
xor edi, edi
call esi
push ebx
call esi
jmp 0x10043038
test ebx, ebx
je 0x10042cce
push 0x1046a5c0
mov edx, esi
mov ecx, edi
call fcn.1003f5b0
test eax, eax
jns 0x10042cce
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call esi
push dword [ebp - 4]
mov ebx, dword [ebp - 8]
xor edi, edi
call esi
push ebx
call esi
jmp 0x10043038
mov ebx, dword [ebp - 8]
mov edx, esi
push ebx
mov ecx, edi
call fcn.1003f5b0
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
jns 0x10042d00
push edi
call esi
push dword [ebp - 4]
xor edi, edi
call esi
push ebx
call esi
jmp 0x10043038
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
mov ebx, dword [ebp - 8]
push dword [ebp - 4]
call esi
push ebx
call esi
jmp 0x10043038
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push ebx
call esi
jmp 0x10043038
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7e
jne 0x10042f07
mov edx, 0x1046a840
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10042d32
sub edx, ecx
mov ebx, esi
sar edx, 1
mov dword [ebp - 0xc], edx
lea ecx, [ebx + 2]
nop dword [eax]
mov ax, word [ebx]
add ebx, 2
test ax, ax
jne 0x10042d50
sub ebx, ecx
mov ecx, esi
sar ebx, 1
lea eax, [ecx + 2]
mov dword [ebp - 0x10], eax
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10042d67
sub ecx, dword [ebp - 0x10]
sar ecx, 1
lea ecx, [esi + ecx*2]
mov eax, ecx
cmp esi, ecx
jae 0x10042daa
mov dword [ebp - 0x10], 0x5c
mov edx, 0x2e
nop dword [eax]
movzx edi, word [eax]
cmp word [ebp - 0x10], di
je 0x10042da5
cmp dx, di
je 0x10042da5
sub eax, 2
cmp esi, eax
jb 0x10042d90
mov edx, dword [ebp - 0xc]
xor edi, edi
mov esi, 0x2e
cmp si, word [eax]
mov esi, dword [ebp - 4]
cmove ecx, eax
lea eax, [ecx + 2]
mov dword [ebp - 0x10], eax
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10042dc0
sub ecx, dword [ebp - 0x10]
sar ecx, 1
sub ecx, 0
je 0x10042ec0
sub ecx, 1
je 0x10042e26
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10042de3
sub ecx, edx
sar ecx, 1
lea eax, [ecx + 1]
mov dword [ebp - 0x10], eax
add eax, eax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x40
call eax
mov ebx, eax
test ebx, ebx
je 0x10042f07
mov edx, dword [ebp - 0x10]
mov ecx, ebx
push esi
call fcn.1003f430
test eax, eax
jns 0x10042f31
jmp 0x10042f27
lea ecx, [ebx - 1]
mov dword [ebp - 0xc], ecx
test ecx, ecx
js 0x10042f2f
lea edx, [esi + 2]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x10042e37
sub esi, edx
sar esi, 1
cmp ecx, esi
cmovb esi, ecx
inc esi
lea eax, [esi + esi]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x40
call eax
mov ebx, eax
test ebx, ebx
je 0x10042f07
test esi, esi
je 0x10042f27
cmp esi, 0x7fffffff
ja 0x10042f22
cmp dword [ebp - 0xc], 0x7ffffffe
ja 0x10042f22
mov edi, dword [ebp - 0xc]
mov edx, ebx
mov ecx, dword [ebp - 4]
sub edi, esi
sub ecx, ebx
lea eax, [edi + esi]
test eax, eax
je 0x10042eab
movzx eax, word [ecx + edx]
test ax, ax
je 0x10042eab
mov word [edx], ax
add edx, 2
sub esi, 1
jne 0x10042e90
test esi, esi
lea eax, [edx - 2]
cmovne eax, edx
xor ecx, ecx
mov edi, ecx
mov word [eax], cx
test esi, esi
jne 0x10042f31
jmp 0x10042f27
lea eax, [ebx + edx]
lea eax, [eax*2 + 2]
push eax
mov dword [ebp - 0x10], eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x40
call eax
mov ebx, eax
test ebx, ebx
je 0x10042f07
push esi
mov esi, dword [ebp - 0x10]
mov ecx, ebx
mov edx, esi
call fcn.1003f4a0
test eax, eax
js 0x10042f00
push 0x1046a840
mov edx, esi
mov ecx, ebx
call fcn.1003f5b0
test eax, eax
jns 0x10042f35
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x10042f19
push 0x7e
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov word [ebx], ax
mov eax, dword [sym.imp.KERNEL32.dll_LocalFree]
push ebx
call eax
xor ebx, ebx
test ebx, ebx
je 0x10042f07
mov ecx, 0x37e4
call fcn.10043950
test eax, eax
je 0x10042f4a
call fcn.100432a0
jmp 0x10042f4f
call fcn.10043670
mov esi, eax
test esi, esi
je 0x10043031
mov ecx, esi
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10042f60
sub ecx, edx
mov edx, ebx
sar ecx, 1
lea edi, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10042f74
sub edx, edi
sar edx, 1
test ecx, ecx
je 0x10042fa0
cmp word [esi + ecx*2 - 2], 0x5c
je 0x10042fa0
test edx, edx
je 0x10042fa0
cmp word [ebx], 0x5c
je 0x10042fa0
mov eax, 1
jmp 0x10042fa2
xor eax, eax
mov dword [ebp - 0xc], eax
add eax, edx
add eax, ecx
lea eax, [eax*2 + 2]
push eax
push 0x40
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
test edi, edi
je 0x1004302a
mov edx, dword [ebp - 8]
mov ecx, edi
push esi
call fcn.1003f4a0
test eax, eax
js 0x10043021
cmp dword [ebp - 0xc], 0
je 0x10042fea
mov edx, dword [ebp - 8]
mov ecx, edi
push 0x1046a5c0
call fcn.1003f5b0
test eax, eax
js 0x10043021
mov edx, dword [ebp - 8]
mov ecx, edi
push ebx
call fcn.1003f5b0
test eax, eax
js 0x10043021
test edi, edi
je 0x1004302a
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x1004300d
test al, 0x50
je 0x1004302a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x10043021
mov eax, dword [sym.imp.KERNEL32.dll_SetLastError]
push 0
call eax
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor edi, edi
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
test edi, edi
je 0x10042f07
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0xa0
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret