Function at 0x4051c0
Capabilities:
Check if file exists
Create directory
Delete file
Get file attributes
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41fe1a
mov eax, dword fs:[0]
push eax
sub esp, 0x26c
mov eax, dword [0x42b014]
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 esi, ecx
mov dword [ebp - 0x264], 0
mov dword [ebp - 0x274], 0
mov dword [ebp - 0x270], 0
mov dword [ebp - 0x26c], 0
lea eax, [ebp - 0x260]
mov dword [ebp - 4], 0
push eax
call fcn.004012f0
mov byte [ebp - 4], 1
mov ecx, 1
cmp dword [eax + 0x14], 8
mov dword [ebp - 0x268], ecx
mov dword [ebp - 0x264], ecx
jb 0x405248
mov eax, dword [eax]
push 0x2001f
push eax
push 0x80000001
lea ecx, [ebp - 0x274]
call fcn.00411ef0
test eax, eax
je 0x40529a
lea eax, [ebp - 0x248]
mov ecx, esi
push eax
call fcn.004012f0
mov dword [ebp - 0x268], 3
cmp dword [eax + 0x14], 8
jb 0x405282
mov eax, dword [eax]
sub esp, 0x14
push eax
push ecx
lea ecx, [ebp - 0x274]
call fcn.00411e70
test eax, eax
je 0x40529a
mov bl, 1
jmp 0x40529c
xor bl, bl
test byte [ebp - 0x268], 2
je 0x4052da
mov eax, dword [ebp - 0x234]
cmp eax, 8
jb 0x4052bd
inc eax
push eax
push dword [ebp - 0x248]
call fcn.004078f0
xor eax, eax
mov dword [ebp - 0x234], 7
mov dword [ebp - 0x238], 0
mov word [ebp - 0x248], ax
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x24c]
cmp eax, 8
jb 0x4052f9
inc eax
push eax
push dword [ebp - 0x260]
call fcn.004078f0
test bl, bl
je 0x405311
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x405644
push eax
jmp 0x40563e
xor eax, eax
mov dword [ebp - 0x21c], 7
mov dword [ebp - 0x220], 0
mov word [ebp - 0x230], ax
push 0x208
push eax
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 2
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x264], 0x103
lea eax, [ebp - 0x264]
push eax
lea eax, [ebp - 0x218]
push eax
push ecx
lea ecx, [ebp - 0x274]
call fcn.00411d50
cmp word [ebp - 0x218], 0
jne 0x40543d
lea ecx, [ebp - 0x260]
call fcn.00412400
push str.TempTxGameDownloadMobileGamePCShared
push eax
lea eax, [ebp - 0x248]
mov byte [ebp - 4], 3
push eax
call fcn.0040a300
add esp, 0xc
mov esi, eax
lea eax, [ebp - 0x230]
cmp eax, esi
je 0x4053ea
mov eax, dword [ebp - 0x21c]
cmp eax, 8
jb 0x4053c1
inc eax
push eax
push dword [ebp - 0x230]
call fcn.004078f0
xor eax, eax
mov dword [ebp - 0x21c], 7
push esi
lea ecx, [ebp - 0x230]
mov dword [ebp - 0x220], 0
mov word [ebp - 0x230], ax
call fcn.00406740
mov eax, dword [ebp - 0x234]
cmp eax, 8
jb 0x405402
inc eax
push eax
push dword [ebp - 0x248]
call fcn.004078f0
xor eax, eax
mov byte [ebp - 4], 2
mov word [ebp - 0x248], ax
mov eax, dword [ebp - 0x24c]
mov dword [ebp - 0x234], 7
mov dword [ebp - 0x238], 0
cmp eax, 8
jb 0x405468
inc eax
push eax
push dword [ebp - 0x260]
call fcn.004078f0
jmp 0x405468
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405446
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x230]
call fcn.00406520
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
cmovae eax, dword [ebp - 0x230]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
lea eax, [ebp - 0x230]
jne 0x4054c4
cmp dword [ebp - 0x21c], 8
mov esi, dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
cmovae eax, dword [ebp - 0x230]
push 0
push eax
push 0
call esi
test eax, eax
je 0x405549
push 0x29
push 0x423a08
lea ecx, [ebp - 0x230]
call fcn.00406520
jmp 0x40552e
cmp dword [ebp - 0x21c], 8
cmovae eax, dword [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0x10
je 0x405549
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
cmovae eax, dword [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
mov esi, dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
cmovae eax, dword [ebp - 0x230]
push 0
push eax
push 0
call esi
test eax, eax
je 0x405549
push str.C:TempTxGameDownloadMobileGamePCShared
lea ecx, [ebp - 0x230]
call fcn.00405a00
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
push 0
cmovae eax, dword [ebp - 0x230]
push eax
push 0
call esi
cmp word [ebp - 0x218], 0
jne 0x405557
xor ecx, ecx
jmp 0x40556f
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405560
sub ecx, edx
sar ecx, 1
mov edi, dword [ebp - 0x21c]
lea eax, [ebp - 0x230]
mov esi, dword [ebp - 0x230]
cmp edi, 8
push ecx
lea ecx, [ebp - 0x218]
cmovae eax, esi
push ecx
push dword [ebp - 0x220]
push eax
call fcn.0040fe40
mov ebx, dword [ebp - 0x274]
add esp, 0x10
test eax, eax
je 0x4055f4
cmp edi, 8
jb 0x4055b3
test esi, esi
je 0x4055f4
jmp 0x4055b9
lea esi, [ebp - 0x230]
mov ecx, esi
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4055c0
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push esi
push 1
push 0
push 0x423acc
push ebx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, dword [ebp - 0x21c]
mov esi, dword [ebp - 0x230]
test ebx, ebx
je 0x40560d
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, dword [ebp - 0x21c]
xor ebx, ebx
mov esi, dword [ebp - 0x230]
cmp edi, 8
jb 0x40561c
lea eax, [edi + 1]
push eax
push esi
call fcn.004078f0
xor eax, eax
mov dword [ebp - 0x21c], 7
mov dword [ebp - 0x220], 0
mov word [ebp - 0x230], ax
test ebx, ebx
je 0x405644
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
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.0041e4c9
mov esp, ebp
pop ebp
ret