Function at 0x491970
Capabilities:
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
mov eax, dword [0x550144]
xor eax, esp
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0x14]
push edi
sub esp, 0xc
mov edi, ecx
push esi
push dword [ebp + 0x10]
push 0xc0000000
push eax
call fcn.004715f0
test eax, eax
js 0x491ba0
mov eax, dword [ebp + 0xc]
mov ebx, dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
jne 0x491b26
cmp esi, 4
jne 0x491bc4
lea eax, [esp + 0x14]
mov dword [ebp + 0xc], 0
push eax
push dword [edi]
call ebx
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
jne 0x4919ee
call fcn.004715d0
test eax, eax
js 0x491b23
mov eax, dword [esp + 0x10]
cmp dword [esp + 0x14], 0
ja 0x4919fe
cmp eax, 2
jb 0x491b23
mov esi, dword [edi]
lea eax, [esp + 0x24]
push eax
push esi
call ebx
push 0
push eax
push dword [esp + 0x2c]
mov dword [esp + 0x2c], eax
push 2
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esp + 0x18], eax
test eax, eax
jne 0x491a37
call fcn.004715d0
mov dword [edi + 8], 0
jmp 0x491b7a
mov esi, dword [esp + 0x20]
push 0
push esi
push 0
push 0
push 4
push eax
mov dword [esp + 0x34], esi
call dword [sym.imp.KERNEL32.dll_MapViewOfFileEx]
mov ebx, eax
mov dword [esp + 0x10], ebx
test ebx, ebx
jne 0x491a71
call fcn.004715d0
mov esi, dword [esp + 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 8], ebx
jmp 0x491b7a
movzx eax, word [ebx]
mov ecx, 0xfeff
cmp ax, cx
je 0x491ae7
mov ecx, 0xfffe
cmp ax, cx
je 0x491ae7
lea eax, [esp + 0x20]
mov dword [esp + 0x20], 0xffffffff
push eax
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_IsTextUnicode]
test eax, eax
je 0x491bb4
cmp dword [esp + 0x20], 2
jne 0x491ae7
lea eax, [esp + 0x28]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetCPInfo]
cmp dword [esp + 0x28], 1
jbe 0x491ae7
xor esi, esi
cmp dword [esp + 0x1c], esi
jle 0x491ae7
nop dword [eax + eax]
mov al, byte [ebx]
push eax
call dword [sym.imp.KERNEL32.dll_IsDBCSLeadByte]
lea ebx, [ebx + 1]
test eax, eax
jne 0x491aee
inc esi
cmp esi, dword [esp + 0x1c]
jl 0x491ad0
mov dword [ebp + 0xc], 1
push dword [esp + 0x10]
mov esi, dword [esp + 0x1c]
xor ebx, ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
test eax, eax
jne 0x491b09
call fcn.004715d0
mov ebx, eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x491b1d
test ebx, ebx
js 0x491b1d
call fcn.004715d0
mov ebx, dword [sym.imp.KERNEL32.dll_GetFileSize]
mov eax, dword [ebp + 0xc]
mov dword [edi + 8], eax
cmp eax, 1
jne 0x491b7a
lea eax, [esp + 0x14]
push eax
push dword [edi]
call ebx
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
jne 0x491b4d
call fcn.004715d0
test eax, eax
js 0x491b53
mov eax, dword [esp + 0x10]
or eax, dword [esp + 0x14]
jne 0x491b7a
push 0
lea eax, [esp + 0x20]
mov dword [esp + 0x14], 0xfeff
push eax
push 2
lea eax, [esp + 0x1c]
push eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x491b7a
call fcn.004715d0
push 2
lea eax, [esp + 0x18]
xorps xmm0, xmm0
push eax
push 0
push dword [edi]
movlpd qword [esp + 0x20], xmm0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x491b9e
call fcn.004715d0
xor eax, eax
mov ecx, dword [esp + 0x3c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004de51d
mov esp, ebp
pop ebp
ret 0x14
mov dword [ebp + 0xc], 0
mov dword [esp + 0x10], ebx
jmp 0x491aee
mov dword [edi + 8], 1
jmp 0x491b2e