Function at 0x401b1c
Capabilities:
Check if file exists
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0x28
mov eax, 0x41304a
call fcn.004040e1
xor ebx, ebx
push 0x41908c
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x34], ebx
call fcn.00401328
mov esi, 0x104
push esi
lea ecx, [ebp - 0x20]
mov dword [ebp - 4], ebx
call fcn.00401459
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x20]
mov edi, eax
call fcn.004012da
cmp edi, ebx
jbe 0x401d6b
push ebx
push 0x80
push 3
push ebx
push 3
push 0x81
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
je 0x401d6b
push 0xc
pop edi
push ebx
push eax
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, edi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x30], eax
jbe 0x401c07
mov dword [ebp - 0x24], 0xfffffff4
push 2
push ebx
push dword [ebp - 0x24]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ebx
call edi
push ebx
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x10]
call edi
cmp dword [ebp - 0x2c], 0x4f4a4f4d
jne 0x401bf9
cmp dword [ebp - 0x28], 0x4f4a4f4a
je 0x401c07
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
dec dword [ebp - 0x24]
cmp eax, dword [ebp - 0x30]
jb 0x401bb2
push ebx
lea eax, [ebp - 0x1c]
push eax
push 4
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0x14], ebx
call edi
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
add ecx, eax
cmp ecx, dword [ebp - 0x30]
ja 0x401d62
push eax
call fcn.004037a0
pop ecx
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x401d62
mov eax, dword [ebp - 0x14]
add eax, dword [ebp - 0x18]
push 2
push ebx
neg eax
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x14]
push dword [ebp - 0x28]
push dword [ebp - 0x10]
call edi
mov edi, 0x41908c
push edi
lea ecx, [ebp - 0x18]
call fcn.00401328
push esi
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00401459
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x18]
call fcn.004012da
push dword [ebp - 0x18]
lea ecx, [ebp - 0x2c]
call fcn.00401807
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 2
call fcn.00401492
push edi
lea ecx, [ebp - 0x24]
xor esi, esi
call fcn.00401328
mov byte [ebp - 4], 3
push esi
push dword [ebp - 0x2c]
lea eax, [ebp - 0x24]
push str._srnsetup_d.exe
push eax
call fcn.004017d4
mov edi, dword [ebp - 0x24]
add esp, 0x10
push edi
inc esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x401ce3
cmp esi, 0xc8
jl 0x401cb5
jmp 0x401d38
push ebx
push 0x80
push 1
push ebx
push 3
push 0x1f01ff
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x401d38
push ebx
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0x14]
mov dword [ebp - 0x30], ebx
push dword [ebp - 0x28]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x14]
jne 0x401d38
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x24]
push eax
mov dword [ebp - 0x34], 1
call fcn.00401763
push dword [ebp - 0x28]
call fcn.004041eb
pop ecx
lea ecx, [edi - 0x10]
call fcn.0040116b
mov ecx, dword [ebp - 0x2c]
add ecx, 0xfffffff0
call fcn.0040116b
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
mov byte [ebp - 4], bl
call fcn.0040116b
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x20]
add ecx, 0xfffffff0
call fcn.0040116b
mov eax, dword [ebp - 0x34]
call fcn.0040414a
ret