Function at 0x4e7370
Capabilities:
Check if file exists
Delete file
Write file on windows

Disassembly:
sub esp, 0x3c
push ebx
push ebp
mov ebp, dword [esp + 0x48]
push esi
push edi
call fcn.004e3630
mov ecx, eax
mov eax, 0x38e38e39
mul ecx
shr edx, 1
lea eax, [edx + edx*8]
mov dword [esp + 0x18], ecx
xor ebx, ebx
sub ecx, eax
mov dword [esp + 0x14], ecx
je 0x4e7438
mov eax, ebp
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4e73a5
mov cl, bl
sub eax, edx
add cl, 0x30
push 0x56ea90
push ebp
mov byte [eax + ebp - 1], cl
call fcn.005047a9
mov esi, eax
add esp, 8
test esi, esi
je 0x4e741f
push esi
push ebp
call fcn.00506255
add esp, 8
mov dword [esp + 0x50], 0xb
lea ecx, [ecx]
mov edi, 9
push esi
push 0x56ea9c
call fcn.00506255
add esp, 8
sub edi, 1
jne 0x4e73e5
push esi
push 0x56eaa8
call fcn.00506255
add esp, 8
sub dword [esp + 0x50], 1
jne 0x4e73e0
push esi
call fcn.00497adb
inc ebx
add esp, 4
cmp ebx, dword [esp + 0x14]
jb 0x4e73a0
jmp 0x4e7438
call fcn.00499e50
mov edx, dword [eax]
mov edi, dword [esp + 0x5c]
push edx
push str.W_d
call fcn.004ddcb0
add esp, 8
mov eax, ebp
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4e7440
sub eax, edx
push ebp
mov byte [eax + ebp - 1], 0x64
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x4e7477
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x4e7477
mov edi, dword [esp + 0x5c]
push ebp
push eax
push str.X_d__s
call fcn.004ddcb0
add esp, 0xc
push ebp
call fcn.004ddfd0
mov esi, eax
add esp, 4
cmp esi, 0xffffffff
jne 0x4e74a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [esp + 0x5c]
push ebp
push eax
push str.Y_d__s
call fcn.004ddcb0
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov eax, ebp
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4e74b0
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [esp + 0x14]
push ecx
sub eax, edx
push eax
push ebp
push esi
call ebx
test eax, eax
jne 0x4e74e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [esp + 0x5c]
push eax
push str.Z_d
call fcn.004ddcb0
add esp, 8
mov dword [esp + 0x50], 0
nop
xor edi, edi
push 0
lea edx, [esp + 0x14]
push edx
push 0xb
push 0x56ead0
push esi
call ebx
test eax, eax
je 0x4e750f
inc edi
cmp edi, 9
jl 0x4e74f2
jmp 0x4e7527
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [esp + 0x5c]
push eax
push str.a_d
call fcn.004ddcb0
add esp, 8
push 0
lea eax, [esp + 0x14]
push eax
push 0xc
push 0x56eae4
push esi
call ebx
test eax, eax
je 0x4e7550
mov eax, dword [esp + 0x50]
inc eax
cmp eax, 0xb
mov dword [esp + 0x50], eax
jl 0x4e74f0
mov edi, dword [esp + 0x5c]
jmp 0x4e7568
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [esp + 0x5c]
push eax
push str.b_d
call fcn.004ddcb0
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x54]
test eax, eax
jne 0x4e757c
lea esi, [eax + 1]
jmp 0x4e759b
cmp dword [eax + 4], 5
jb 0x4e758e
push edi
push ebp
call fcn.004e3180
add esp, 8
jmp 0x4e7599
push ebp
mov eax, edi
call fcn.004e3420
add esp, 4
mov esi, eax
lea ecx, [esp + 0x1c]
push ecx
push ebp
call fcn.00505200
add esp, 8
cmp eax, 0xffffffff
jne 0x4e75cb
call fcn.00499e50
mov edx, dword [eax]
push edx
push str.c_d
call fcn.004ddcb0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
cmp dword [esp + 0x44], 0
je 0x4e7716
push 0x56eafc
push ebp
call fcn.005047a9
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x4e7607
call fcn.00499e50
mov eax, dword [eax]
push eax
push str.d_d
call fcn.004ddcb0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov eax, dword [esp + 0x58]
test eax, eax
je 0x4e7614
cmp eax, 1
jne 0x4e761d
call fcn.004e3630
mov dword [esp + 0x58], eax
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x18]
push ecx
push edx
push eax
push esi
push str._lu__u__u__ld_n
push ebx
call fcn.00506143
add esp, 0x18
test eax, eax
jge 0x4e7650
call fcn.00499e50
mov eax, dword [eax]
push eax
push str.e_d
call fcn.004ddcb0
add esp, 8
mov dword [esp + 0x50], 0
xor esi, esi
lea ebx, [ebx]
push ebx
push 0x56eb20
call fcn.00506255
add esp, 8
test eax, eax
jl 0x4e767a
inc esi
cmp esi, 9
jl 0x4e7660
jmp 0x4e768f
call fcn.00499e50
mov ecx, dword [eax]
push ecx
push str.f_d
call fcn.004ddcb0
add esp, 8
push ebx
push str.____________n
call fcn.00506255
add esp, 8
test eax, eax
jl 0x4e76b1
mov eax, dword [esp + 0x50]
inc eax
cmp eax, 0xb
mov dword [esp + 0x50], eax
jl 0x4e7658
jmp 0x4e76c6
call fcn.00499e50
mov edx, dword [eax]
push edx
push str.g_d
call fcn.004ddcb0
add esp, 8
push ebx
call fcn.00497adb
mov esi, dword [esp + 0x18]
add esp, 4
xor ebx, ebx
test esi, esi
jbe 0x4e7703
lea esp, [esp]
mov eax, ebp
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4e76e5
mov cl, bl
sub eax, edx
add cl, 0x30
push ebp
mov byte [eax + ebp - 1], cl
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
inc ebx
cmp ebx, esi
jb 0x4e76e0
mov eax, ebp
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4e7708
sub eax, edx
mov byte [eax + ebp - 1], 0x64
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret