Function at 0x501160
Capabilities:
Check if file exists
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x50c7a6
mov eax, dword fs:[0]
push eax
sub esp, 0x300
mov eax, dword [0x531304]
xor eax, ebp
mov dword [ebp - 0x20], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x2d8], 0
mov dword [ebp - 0x18], 0
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x501791
push 0x7c
call fcn.00418aea
add esp, 4
mov dword [ebp - 0x25c], eax
mov dword [ebp - 4], 0
cmp dword [ebp - 0x25c], 0
je 0x5011f1
lea ecx, [ebp - 0x260]
push ecx
call fcn.004eee80
add esp, 4
push eax
mov ecx, dword [ebp - 0x25c]
call fcn.004ef190
mov dword [ebp - 0x2dc], eax
jmp 0x5011fb
mov dword [ebp - 0x2dc], 0
mov edx, dword [ebp - 0x2dc]
mov dword [ebp - 0x258], edx
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x258]
mov dword [ebp - 0x60], eax
push 0
lea ecx, [ebp - 0x5c]
call fcn.004ebad0
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x44]
call fcn.004e7500
mov byte [ebp - 4], 2
push 0x522aa0
mov ecx, dword [ebp + 8]
push ecx
call fcn.0041625a
add esp, 8
mov dword [ebp - 0x10], eax
push 2
push 0
mov edx, dword [ebp - 0x10]
push edx
call fcn.00416afd
add esp, 0xc
mov eax, dword [ebp - 0x10]
push eax
call fcn.004169d3
add esp, 4
mov dword [ebp - 0x14], eax
push 0
push 0
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00416afd
add esp, 0xc
mov edx, dword [ebp - 0x14]
add edx, 1
push edx
call fcn.00415d52
add esp, 4
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
push 1
mov edx, dword [ebp - 0x1c]
push edx
call fcn.0041651a
add esp, 0x10
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x14]
mov byte [eax], 0
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00416bf5
add esp, 4
cmp dword [ebp - 0x14], 0x3e8
jle 0x50132a
push 0x522aa4
mov edx, dword [ebp - 0x1c]
push edx
call fcn.00401000
add esp, 8
test eax, eax
je 0x50132a
push 0x522aa8
mov eax, dword [ebp - 0x1c]
push eax
call fcn.00401000
add esp, 8
push eax
lea ecx, [ebp - 0x280]
call fcn.00401e20
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0x2d8]
or ecx, 1
mov dword [ebp - 0x2d8], ecx
push 1
lea edx, [ebp - 0x5c]
push edx
lea eax, [ebp - 0x280]
push eax
mov ecx, dword [ebp - 0x60]
call fcn.004f3df0
movzx ecx, al
test ecx, ecx
je 0x50132a
mov dword [ebp - 0x2e0], 1
jmp 0x501334
mov dword [ebp - 0x2e0], 0
mov dl, byte [ebp - 0x2e0]
mov byte [ebp - 0x261], dl
mov dword [ebp - 4], 2
mov eax, dword [ebp - 0x2d8]
and eax, 1
je 0x501364
and dword [ebp - 0x2d8], 0xfffffffe
lea ecx, [ebp - 0x280]
call fcn.00401260
movzx ecx, byte [ebp - 0x261]
test ecx, ecx
je 0x50172d
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x284], esp
push 4
call fcn.004eac00
mov dword [ebp - 0x2e4], eax
mov edx, dword [ebp - 0x2e4]
mov dword [ebp - 0x2e8], edx
mov byte [ebp - 4], 4
push 0x522ab4
push 0x522aac
lea ecx, [ebp - 0x5c]
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov byte [ebp - 4], 2
mov ecx, eax
call fcn.004eb520
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x288], esp
mov eax, dword [0x55bc34]
push eax
call fcn.004ed9d0
mov dword [ebp - 0x2ec], eax
mov ecx, dword [ebp - 0x2ec]
mov dword [ebp - 0x2f0], ecx
mov byte [ebp - 4], 5
push 0x522ad0
push 0x522ac8
lea ecx, [ebp - 0x5c]
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov byte [ebp - 4], 2
mov ecx, eax
call fcn.004eb520
mov edx, dword [ebp + 0xc]
push edx
lea ecx, [ebp - 0x2a4]
call fcn.004edc90
mov byte [ebp - 4], 6
lea eax, [ebp - 0x2a4]
push eax
push 0x522ae8
push 0x522ae0
lea ecx, [ebp - 0x5c]
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov ecx, eax
call fcn.004ee2a0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x2a4]
call fcn.004eb3f0
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x2a8], esp
mov edx, dword [0x55bc34]
push edx
call fcn.004ed9d0
mov dword [ebp - 0x2f4], eax
mov eax, dword [ebp - 0x2f4]
mov dword [ebp - 0x2f8], eax
mov byte [ebp - 4], 7
push 0x522b00
push 0x522af8
lea ecx, [ebp - 0x5c]
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov byte [ebp - 4], 2
mov ecx, eax
call fcn.004eb520
mov ecx, dword [ebp + 0xc]
push ecx
lea ecx, [ebp - 0x2c4]
call fcn.004edc90
mov byte [ebp - 4], 8
lea edx, [ebp - 0x2c4]
push edx
push 0x522b24
push 0x522b1c
lea ecx, [ebp - 0x5c]
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov ecx, eax
call fcn.004ee2a0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x2c4]
call fcn.004eb3f0
lea eax, [ebp - 0x254]
push eax
call fcn.0050f820
add esp, 4
lea ecx, [ebp - 0x1d4]
push ecx
push 0x522b40
push 0x522b44
lea edx, [ebp - 0x254]
push edx
call fcn.0050f720
add esp, 0x10
lea eax, [ebp - 0x1d4]
push eax
push 0x522b60
call fcn.004e4170
add esp, 8
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x2c8], esp
lea edx, [ebp - 0x1d4]
push edx
call fcn.004edc90
mov dword [ebp - 0x2fc], eax
mov eax, dword [ebp - 0x2fc]
mov dword [ebp - 0x300], eax
mov byte [ebp - 4], 9
push 0x522bcc
push 0x522bc4
push 0x522bbc
push 0x522bb0
lea ecx, [ebp - 0x5c]
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov byte [ebp - 4], 2
mov ecx, eax
call fcn.004eb520
mov byte [ebp - 0x16c], 0
push 0x103
push 0
lea ecx, [ebp - 0x16b]
push ecx
call fcn.00415fc0
add esp, 0xc
push 0x522be0
lea edx, [ebp - 0x16c]
push edx
call fcn.00415eb0
add esp, 8
mov eax, dword [ebp + 0xc]
push eax
lea ecx, [ebp - 0x16c]
push ecx
call fcn.00415ec0
add esp, 8
push 0x522be4
lea edx, [ebp - 0x16c]
push edx
call fcn.00415ec0
add esp, 8
lea eax, [ebp - 0x1d4]
push eax
lea ecx, [ebp - 0x16c]
push ecx
push 0x522be8
lea edx, [ebp - 0x254]
push edx
call fcn.0050f720
add esp, 0x10
lea eax, [ebp - 0x1d4]
push eax
push 0x522c00
call fcn.004e4170
add esp, 8
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x2cc], esp
lea edx, [ebp - 0x1d4]
push edx
call fcn.004edc90
mov dword [ebp - 0x304], eax
mov eax, dword [ebp - 0x304]
mov dword [ebp - 0x308], eax
mov byte [ebp - 4], 0xa
push 0x522c64
push 0x522c5c
push 0x522c54
push 0x522c48
lea ecx, [ebp - 0x5c]
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov ecx, eax
call fcn.004ee360
mov byte [ebp - 4], 2
mov ecx, eax
call fcn.004eb520
lea ecx, [ebp - 0x5c]
push ecx
lea edx, [ebp - 0x188]
push edx
lea ecx, [ebp - 0x44]
call fcn.004ea3e0
mov byte [ebp - 4], 0xb
push 0x80
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 0x522c74
mov ecx, dword [ebp + 8]
push ecx
call fcn.0041625a
add esp, 8
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 0x10]
push edx
push 1
lea ecx, [ebp - 0x188]
call fcn.004012e0
push eax
call fcn.00415e20
add esp, 4
push eax
lea ecx, [ebp - 0x188]
call fcn.004012e0
push eax
call fcn.004167ae
add esp, 0x10
mov eax, dword [ebp - 0x10]
push eax
call fcn.00416bf5
add esp, 4
push 0x522c78
call fcn.004e4170
add esp, 4
mov dword [ebp - 0x18], 1
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x188]
call fcn.00401260
mov ecx, dword [ebp - 0x60]
mov dword [ebp - 0x2d4], ecx
mov edx, dword [ebp - 0x2d4]
mov dword [ebp - 0x2d0], edx
cmp dword [ebp - 0x2d0], 0
je 0x501760
push 1
mov ecx, dword [ebp - 0x2d0]
call fcn.00413240
mov dword [ebp - 0x30c], eax
jmp 0x50176a
mov dword [ebp - 0x30c], 0
mov eax, dword [ebp - 0x1c]
push eax
call fcn.00415c75
add esp, 4
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x44]
call fcn.00410630
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5c]
call fcn.004eb3f0
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x20]
xor ecx, ebp
call fcn.004158f4
mov esp, ebp
pop ebp
ret