Function at 0x422220
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x445a10
mov eax, dword fs:[0]
push eax
sub esp, 0x2ac
mov eax, dword [0x454100]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov ebx, dword [ebp + 8]
push ebx
call fcn.004201b0
mov esi, eax
add esp, 4
test esi, esi
js 0x42251a
cmp word [ebx + esi*2 + 2], 0
lea eax, [ebx + esi*2]
je 0x42251a
xor ecx, ecx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x20], ecx
lea ecx, [ebp - 0x28]
push eax
call fcn.0041f0d0
xor eax, eax
mov dword [ebp - 4], 0
push ebx
lea ecx, [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
call fcn.0041f0d0
mov byte [ebp - 4], 1
cmp esi, dword [ebp - 0x18]
jae 0x4222b9
mov eax, dword [ebp - 0x1c]
xor ecx, ecx
mov dword [ebp - 0x18], esi
mov word [eax + esi*2], cx
mov ecx, dword [ebp - 0x24]
cmp ecx, 6
jbe 0x4222dc
mov eax, dword [ebp - 0x28]
push str.:_DATA
lea eax, [eax + ecx*2]
add eax, 0xfffffff4
push eax
call fcn.00420070
add esp, 8
test al, al
jne 0x4222e9
push str.:_DATA
lea ecx, [ebp - 0x28]
call fcn.0041f3a0
push dword [ebp - 0x1c]
call fcn.00420890
add esp, 4
test al, al
mov eax, dword [ebp - 0x1c]
je 0x422335
cmp esi, 2
je 0x42230c
cmp esi, 3
jne 0x422335
cmp word [eax + 4], 0x5c
jne 0x422335
mov ecx, edi
call fcn.00421df0
mov eax, dword [edi + 0x28]
lea ecx, [edi + 0x28]
xor edx, edx
mov dword [ecx + 4], 0
mov word [eax], dx
cmp esi, 2
jne 0x422348
lea eax, [ebp - 0x1c]
push eax
call fcn.0041f160
jmp 0x422348
push dword [ebp + 0xc]
mov ecx, edi
push eax
call fcn.00422220
test al, al
je 0x422507
and dword [edi + 0x20], 0xfffffbef
xor eax, eax
mov dword [edi], 0
mov dword [edi + 4], 0
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x38], 0xffffffff
lea eax, [ebp - 0x1c]
mov byte [ebp - 4], 2
push eax
lea ecx, [ebp - 0x34]
call fcn.0041efc0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x50]
call fcn.0041f130
mov eax, dword [ebp - 0x38]
mov byte [ebp - 4], 4
cmp eax, 0xffffffff
je 0x4223c5
mov esi, dword [0x4551ec]
test esi, esi
jne 0x4223af
push 0x78
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor al, al
jmp 0x422447
lea ecx, [ebp - 0x2a8]
push ecx
push eax
mov ecx, esi
call dword [0x447370]
call esi
test eax, eax
jmp 0x42241e
cmp dword [0x4551e8], 0
mov esi, dword [ebp - 0x34]
jne 0x4223dd
push 0x78
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor al, al
jmp 0x422447
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0
lea eax, [ebp - 0x2a8]
push eax
push 0
push esi
mov esi, dword [0x4551e8]
mov ecx, esi
call dword [0x447370]
call esi
mov dword [ebp - 0x38], eax
cmp eax, 0xffffffff
jne 0x422424
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
jne 0x422418
xor al, al
jmp 0x422447
mov eax, dword [ebp - 0x38]
cmp eax, 0xffffffff
jne 0x422424
xor al, al
jmp 0x422447
mov eax, dword [ebp - 0x2a8]
mov ecx, dword [ebp - 0x2a4]
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x2a0]
mov dword [ebp - 0x3c], ecx
lea ecx, [ebp - 0x50]
push eax
call fcn.0041f260
mov al, 1
test al, al
je 0x4224ab
push dword [ebp - 0x28]
push dword [ebp - 0x50]
call fcn.0041ffe0
add esp, 8
test al, al
jne 0x422471
push dword [ebp - 0x50]
mov byte [ebp - 4], 3
call fcn.0044037e
add esp, 4
jmp 0x422382
mov eax, dword [ebp - 0x4c]
cmp eax, 7
jbe 0x42248c
lea ecx, [eax - 6]
cmp ecx, eax
jae 0x42248c
mov eax, dword [ebp - 0x50]
xor edx, edx
mov dword [ebp - 0x4c], ecx
mov word [eax + ecx*2], dx
lea eax, [ebp - 0x50]
lea ecx, [edi + 0x28]
push eax
call fcn.0041f360
mov eax, dword [ebp - 0x40]
mov bl, 1
mov ecx, dword [ebp - 0x3c]
mov dword [edi], eax
mov dword [edi + 4], ecx
mov byte [edi + 0x24], 1
jmp 0x4224c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
jne 0x4224be
push 2
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor bl, bl
push dword [ebp - 0x50]
call fcn.0044037e
push dword [ebp - 0x34]
call fcn.0044037e
mov eax, dword [ebp - 0x38]
add esp, 8
cmp eax, 0xffffffff
je 0x4224ed
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
test eax, eax
je 0x4224ed
mov dword [ebp - 0x38], 0xffffffff
push dword [ebp - 0x1c]
call fcn.0044037e
push dword [ebp - 0x28]
call fcn.0044037e
add esp, 8
mov al, bl
jmp 0x42280c
push dword [ebp - 0x1c]
call fcn.0044037e
push dword [ebp - 0x28]
call fcn.0044037e
add esp, 8
mov dword [ebp - 0x2b4], 0xffffffff
push ebx
mov dword [ebp - 4], 5
call fcn.004209d0
movzx esi, al
shl esi, 2
lea eax, [ebx + esi*2]
push eax
mov dword [ebp - 0x2b0], eax
call fcn.004208c0
add esp, 8
test al, al
je 0x4225b6
cmp word [ebx + esi*2 + 6], 0
jne 0x4225b6
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x2b8], eax
cmp eax, 0xffffffff
je 0x42279d
test al, 0x10
je 0x42279d
mov ecx, edi
call fcn.00421df0
mov eax, dword [ebp - 0x2b8]
lea ecx, [edi + 0x28]
push dword [ebp - 0x2b0]
mov dword [edi + 0x20], eax
call fcn.0041f260
cmp dword [edi + 0x2c], 2
jbe 0x4225a7
mov eax, dword [edi + 0x28]
xor ecx, ecx
mov dword [edi + 0x2c], 2
mov word [eax + 4], cx
push ebx
mov ecx, edi
call fcn.00422130
mov cl, 1
jmp 0x42280a
movzx eax, word [ebx]
cmp eax, 0x5c
je 0x4225c7
cmp eax, 0x2f
jne 0x42279d
cmp word [ebx + 2], 0
push ebx
jne 0x422612
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x2b0], eax
cmp eax, 0xffffffff
je 0x42279d
test al, 0x10
je 0x42279d
mov ecx, edi
call fcn.00421df0
mov eax, dword [edi + 0x28]
xor ecx, ecx
mov dword [edi + 0x2c], 0
mov word [eax], cx
mov cl, 1
mov eax, dword [ebp - 0x2b0]
mov dword [edi + 0x20], eax
jmp 0x42280a
call fcn.00420510
add esp, 4
test eax, eax
je 0x42279d
cmp word [ebx + eax*2], 0
lea esi, [ebx + eax*2]
je 0x42279d
push esi
call fcn.00420210
add esp, 4
test eax, eax
jns 0x42279d
push ebx
mov ecx, edi
call fcn.00422130
test al, al
je 0x42265d
lea ecx, [edi + 0x28]
push esi
call fcn.0041f260
mov cl, 1
jmp 0x42280a
xor eax, eax
lea ecx, [ebp - 0x1c]
push ebx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
call fcn.0041f0d0
mov ecx, dword [ebp - 0x18]
mov byte [ebp - 4], 6
cmp dword [ebp - 0x14], ecx
jne 0x422688
lea ecx, [ebp - 0x1c]
call fcn.0041f6e0
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov edx, 0x5c
push 0x2a
mov word [eax + ecx*2], dx
inc ecx
xor edx, edx
mov word [eax + ecx*2], dx
mov dword [ebp - 0x18], ecx
lea ecx, [ebp - 0x1c]
call fcn.0041f440
push edi
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x2b4]
mov byte [ebp - 0x2a9], 0
call fcn.00422830
test al, al
je 0x422710
lea eax, [edi + 0x28]
mov ecx, 0x44a504
mov dword [ebp - 0x2b0], eax
mov eax, dword [eax]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4226f8
test dx, dx
je 0x4226f4
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4226f8
add eax, 4
add ecx, 4
test dx, dx
jne 0x4226d2
xor eax, eax
jmp 0x4226fd
sbb eax, eax
or eax, 1
test eax, eax
jne 0x422709
mov ecx, dword [ebp - 0x2b0]
jmp 0x422782
mov byte [ebp - 0x2a9], 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x2b8], eax
cmp eax, 0xffffffff
jne 0x42272a
or eax, eax
mov dword [ebp - 0x2b8], eax
cmp byte [ebp - 0x2a9], 0
jne 0x422765
cmp eax, 0xffffffff
je 0x42273c
test al, 0x10
jne 0x422765
push dword [ebp - 0x1c]
mov byte [ebp - 4], 5
call fcn.0044037e
mov esi, dword [ebp - 0x2b4]
add esp, 4
cmp esi, 0xffffffff
je 0x42279d
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
test eax, eax
jne 0x42279d
xor cl, cl
jmp 0x4227ce
mov ecx, edi
call fcn.00421df0
mov eax, dword [ebp - 0x2b8]
cmp eax, 0xffffffff
jne 0x42277c
mov eax, 0x10
mov dword [edi + 0x20], eax
lea ecx, [edi + 0x28]
push esi
call fcn.0041f260
push dword [ebp - 0x1c]
call fcn.0044037e
mov esi, dword [ebp - 0x2b4]
add esp, 4
mov cl, 1
jmp 0x4227f2
lea eax, [ebp - 0x2a0]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov esi, eax
mov dword [ebp - 0x2b4], esi
cmp esi, 0xffffffff
jne 0x4227bc
xor cl, cl
jmp 0x4227ce
lea eax, [ebp - 0x2a0]
push edi
push eax
call fcn.00421e70
add esp, 8
mov cl, 1
cmp byte [ebp + 0xc], 0
mov byte [ebp - 0x2a9], cl
je 0x4227f8
test cl, cl
je 0x4227f8
mov eax, dword [edi + 0x20]
shr eax, 0xa
test al, 1
je 0x4227f8
push ebx
mov ecx, edi
call fcn.00422130
mov cl, al
mov byte [ebp - 0x2a9], cl
cmp esi, 0xffffffff
je 0x42280a
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov cl, byte [ebp - 0x2a9]
mov al, cl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00440370
mov esp, ebp
pop ebp
ret 8