Function at 0x4bf140
Capabilities:
Check if file exists
Delete file
Move file
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51d8f8
mov eax, dword fs:[0]
push eax
sub esp, 0x84
mov eax, dword [0x565300]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov dword [ebp - 0x8c], edi
mov dword [ebp - 0x78], eax
call fcn.00404590
mov ecx, eax
test ecx, ecx
je 0x4bf4d0
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x7c], eax
push edi
lea ecx, [ebp - 0x7c]
mov dword [ebp - 4], 0
call fcn.004037a0
test al, al
jne 0x4bf1d9
test edi, edi
jne 0x4bf1b4
xor ecx, ecx
jmp 0x4bf1cf
mov ecx, edi
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4bf1c0
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x7c]
call fcn.00403c10
mov dword [ebp - 4], 1
mov ecx, 1
mov esi, dword [ebp - 0x7c]
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x4bf207
push 0x104
lea ecx, [ebp - 0x7c]
call fcn.004039e0
mov esi, dword [ebp - 0x7c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
push dword [esi - 8]
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsnlen]
add esp, 8
test eax, eax
js 0x4bf4c6
cmp eax, dword [esi - 8]
jg 0x4bf4c6
xor ecx, ecx
mov dword [esi - 0xc], eax
push esi
mov word [esi + eax*2], cx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4bf248
push esi
push eax
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
call fcn.00404590
mov ecx, eax
test ecx, ecx
je 0x4bf4da
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x88], eax
xorps xmm0, xmm0
mov dword [ebp - 0x74], vtable.Json::StyledWriter.0
movups xmmword [ebp - 0x64], xmm0
mov dword [ebp - 0x70], 0
movups xmmword [ebp - 0x4c], xmm0
mov dword [ebp - 0x6c], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x50], 0xf
mov byte [ebp - 0x64], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0xf
mov byte [ebp - 0x4c], 0
mov dword [ebp - 0x34], 0x4a
mov dword [ebp - 0x30], 3
push dword [ebp - 0x78]
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 3
push eax
lea ecx, [ebp - 0x74]
call fcn.004cc6d0
mov byte [ebp - 4], 4
lea edx, [ebp - 0x28]
cmp dword [ebp - 0x14], 0xf
jbe 0x4bf2eb
mov edx, dword [ebp - 0x28]
test edx, edx
jne 0x4bf2eb
xor ecx, ecx
jmp 0x4bf2fd
mov ecx, edx
lea eax, [ecx + 1]
mov dword [ebp - 0x78], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4bf2f3
sub ecx, dword [ebp - 0x78]
push ecx
push edx
lea ecx, [ebp - 0x88]
call fcn.00407de0
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0x14]
cmp ecx, 0xf
jbe 0x4bf344
mov edx, dword [ebp - 0x28]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4bf33a
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4bf33a
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0050e5c2
add esp, 8
lea ecx, [ebp - 0x74]
mov byte [ebp - 4], 2
call fcn.004a4f70
mov eax, dword [ebp - 0x88]
mov eax, dword [eax - 0xc]
mov dword [ebp - 0x78], eax
test edi, edi
je 0x4bf466
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x4bf466
call fcn.00404590
mov ecx, eax
test ecx, ecx
je 0x4bf4e4
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x80], eax
push edi
lea eax, [ebp - 0x80]
mov byte [ebp - 4], 5
push str._s.write_cache
push eax
call fcn.00439f60
mov edi, dword [ebp - 0x80]
add esp, 0xc
xor eax, eax
mov dword [ebp - 0x84], eax
push eax
push 0x80
push 2
push eax
push 1
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x90], eax
cmp eax, 0xffffffff
je 0x4bf442
push 0
lea ecx, [ebp - 0x80]
mov dword [ebp - 0x80], 0
push ecx
push dword [ebp - 0x78]
push dword [ebp - 0x88]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x78]
xor eax, eax
cmp dword [ebp - 0x80], ecx
push dword [ebp - 0x90]
sete al
mov dword [ebp - 0x84], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x84], 0
je 0x4bf442
push 0x80
push dword [ebp - 0x8c]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push 1
push dword [ebp - 0x8c]
push edi
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
push edi
mov dword [ebp - 0x84], eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov byte [ebp - 4], 2
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x4bf45e
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x84]
jmp 0x4bf468
xor edi, edi
mov byte [ebp - 4], 1
or eax, 0xffffffff
mov edx, dword [ebp - 0x88]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4bf48a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4bf4a9
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0050ea5d
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.00404110
push 0x80004005
call fcn.00404110
push 0x80004005
call fcn.00404110
push 0x80004005
call fcn.00404110
int3