Function at 0x404a50
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [0x4a9bf0]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
lea eax, [ebp - 0x34]
mov esi, ecx
push eax
push eax
push eax
push str..enc
push esi
xor edi, edi
push str._s_s
push edi
push eax
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], edi
call fcn.0040ddc0
push edi
push edi
push 3
push edi
push 3
push SysReAllocString
push esi
call fcn.00409250
mov esi, eax
add esp, 0x3c
cmp esi, 0xffffffff
je 0x404d8d
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
push edi
mov dword [ebp - 0x44], ebx
call fcn.0046de65
xor ecx, ecx
mov eax, ebx
add eax, 1
setb cl
neg ecx
or ecx, eax
push ecx
push dword [ebp - 0x38]
call fcn.00466ae4
add esp, 0xc
mov dword [ebp - 0x40], eax
call fcn.0046de52
cmp dword [eax], 0xc
jne 0x404b49
call fcn.0041fd60
test eax, eax
je 0x404b4f
call fcn.0041fd60
cmp dword [eax], edi
je 0x404b4f
mov eax, dword [0x4bd720]
test eax, eax
je 0x404b05
mov eax, dword [eax + 0x190]
jmp 0x404b0a
mov eax, dword [0x4bd724]
mov dword [ebp - 0x40], eax
call fcn.0041fd60
test eax, eax
je 0x404b1f
call fcn.0041fd60
mov eax, dword [eax]
jmp 0x404b21
xor eax, eax
push str.Error_allocating_memory__
push str.Error_allocating_memory__
push dword [0x4bd720]
push dword [ebp - 0x40]
push 0
push 0x20b
push str.D:MyProjectsProPilotTestEncoderMain.c
push 3
call eax
add esp, 0x20
jmp 0x404b4f
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x38], eax
push 0
lea eax, [ebp - 0x2c]
push eax
push ebx
push dword [ebp - 0x38]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404d8c
cmp ebx, dword [ebp - 0x2c]
jne 0x404d8c
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
call fcn.0040d4e0
mov edi, eax
add esp, 4
xor ebx, ebx
movzx edx, byte [edi + 0x491148]
mov cl, byte [edx + 0x491148]
lea eax, [edx + ebx]
add eax, edi
and eax, 0x800000ff
jns 0x404ba6
dec eax
or eax, 0xffffff00
inc eax
movzx esi, byte [eax + 0x491148]
movzx eax, cl
imul esi, eax
add esi, edx
and esi, 0x800000ff
jns 0x404bc5
dec esi
or esi, 0xffffff00
inc esi
mov cl, byte [esi + 0x491148]
lea eax, [ebx + 1]
add eax, esi
mov byte [ebp + ebx - 0x28], cl
add eax, edi
and eax, 0x800000ff
jns 0x404be4
dec eax
or eax, 0xffffff00
inc eax
movzx edx, byte [eax + 0x491148]
movzx eax, cl
imul edx, eax
add edx, esi
and edx, 0x800000ff
jns 0x404c03
dec edx
or edx, 0xffffff00
inc edx
mov cl, byte [edx + 0x491148]
lea eax, [ebx + 2]
add eax, edx
mov byte [ebp + ebx - 0x27], cl
add eax, edi
and eax, 0x800000ff
jns 0x404c22
dec eax
or eax, 0xffffff00
inc eax
movzx esi, byte [eax + 0x491148]
movzx eax, cl
imul esi, eax
add esi, edx
and esi, 0x800000ff
jns 0x404c41
dec esi
or esi, 0xffffff00
inc esi
mov cl, byte [esi + 0x491148]
lea eax, [ebx + 3]
add eax, esi
mov byte [ebp + ebx - 0x26], cl
add eax, edi
and eax, 0x800000ff
jns 0x404c60
dec eax
or eax, 0xffffff00
inc eax
movzx edx, byte [eax + 0x491148]
movzx eax, cl
imul edx, eax
add edx, esi
and edx, 0x800000ff
jns 0x404c7f
dec edx
or edx, 0xffffff00
inc edx
mov cl, byte [edx + 0x491148]
mov byte [ebp + ebx - 0x25], cl
add ebx, 4
cmp ebx, 0x20
jl 0x404b93
push 0x10
lea eax, [ebp - 0x28]
mov byte [ebp - 8], 0
push eax
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 0x44]
push dword [ebp - 0x38]
call fcn.0040a610
mov ebx, eax
add esp, 0x14
mov edi, 0
test ebx, ebx
je 0x404d8c
push edi
push edi
push 2
push edi
push 1
push 0x40000000
push dword [ebp - 0x34]
call fcn.00409250
mov esi, eax
add esp, 0x1c
cmp esi, 0xffffffff
jne 0x404d65
call fcn.0041fd60
test eax, eax
je 0x404d8c
call fcn.0041fd60
cmp dword [eax], edi
je 0x404d8c
mov eax, dword [0x4bd720]
test eax, eax
je 0x404d0d
mov esi, dword [eax + 0x190]
jmp 0x404d13
mov esi, dword [0x4bd724]
call fcn.0041fd60
test eax, eax
je 0x404d25
call fcn.0041fd60
mov ebx, dword [eax]
jmp 0x404d27
xor ebx, ebx
push str.Error_creating_file__s:__s
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040b160
add esp, 8
push eax
push dword [ebp - 0x34]
push str.Error_creating_file__s:__s
push dword [0x4bd720]
push esi
push 0
push 0x21c
push str.D:MyProjectsProPilotTestEncoderMain.c
push 0x103
call ebx
add esp, 0x28
jmp 0x404d8c
push 0
lea eax, [ebp - 0x30]
push eax
push ebx
push dword [ebp - 0x3c]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404d85
cmp ebx, dword [ebp - 0x30]
mov eax, 1
cmove edi, eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebx
cmp dword [ebp - 0x38], 0
je 0x404dae
lea eax, [ebp - 0x38]
push eax
call fcn.00409d90
push dword [ebp - 0x38]
call fcn.00468056
add esp, 8
mov dword [ebp - 0x38], 0
cmp dword [ebp - 0x3c], 0
je 0x404dcf
lea eax, [ebp - 0x3c]
push eax
call fcn.00409d90
push dword [ebp - 0x3c]
call fcn.00468056
add esp, 8
mov dword [ebp - 0x3c], 0
cmp dword [ebp - 0x34], 0
je 0x404de9
lea eax, [ebp - 0x34]
push eax
call fcn.00409d90
push dword [ebp - 0x34]
call fcn.00468056
add esp, 8
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
xor ecx, ebp
pop esi
call fcn.0046300c
mov esp, ebp
pop ebp
ret