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

Disassembly:
sub esp, 0x178
mov ecx, dword [esp + 0x17c]
lea eax, [esp + 0x74]
push ebx
push ebp
push esi
push edi
push 0x104
push eax
push 0x3e8
push ecx
call dword [sym.imp.USER32.dll_GetDlgItemTextA]
push 0x21
push str.SKPlayer
push str.Fix_demo_
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 2
je 0x40157e
push 0
push 0x80
push 3
push 0
push 1
lea edx, [esp + 0x98]
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x10], esi
jne 0x4013a9
push str.Could_not_open_demo_file
jmp 0x401576
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x401571
test ebx, ebx
je 0x401571
push ebx
call fcn.00403f65
add esp, 4
mov ebp, eax
lea eax, [esp + 0x18]
push 0
push eax
push ebx
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x18], ebx
je 0x4013f0
push str.Could_not_read_file_to_memory
jmp 0x401576
test ebx, ebx
jbe 0x401445
mov esi, dword [esp + 0x10]
mov ecx, 1
mov edi, 0xfffffffa
sub ecx, ebp
lea eax, [ebp + 6]
sub edi, ebp
cmp byte [eax - 6], 8
jne 0x40143b
cmp byte [eax - 5], 2
jne 0x40143b
cmp byte [eax - 4], 0xa
jne 0x40143b
cmp byte [eax - 3], 0x42
jne 0x40143b
cmp byte [eax - 2], 0x55
jne 0x40143b
cmp byte [eax - 1], 0x49
jne 0x40143b
cmp byte [eax], 0x4c
jne 0x40143b
cmp byte [eax + 1], 0x44
jne 0x40143b
lea esi, [ecx + eax]
inc eax
lea edx, [edi + eax]
cmp edx, ebx
jb 0x401409
jmp 0x401449
mov esi, dword [esp + 0x10]
add esi, 0xfffffbfc
test ebx, ebx
mov dword [esp + 0x1c], esi
jbe 0x4014b7
mov ecx, 1
mov edx, 0xfffffff9
sub ecx, ebp
sub edx, ebp
mov dword [esp + 0x14], edx
lea eax, [ebp + 7]
mov edi, dword [esp + 0x14]
jmp 0x401476
mov edx, dword [esp + 0x14]
cmp byte [eax - 7], 0
jne 0x4014ae
cmp byte [eax - 6], 0
jne 0x4014ae
cmp byte [eax - 5], 0x4c
jne 0x4014ae
cmp byte [eax - 4], 0x4f
jne 0x4014ae
cmp byte [eax - 3], 0x41
jne 0x4014ae
cmp byte [eax - 2], 0x44
jne 0x4014ae
cmp byte [eax - 1], 0x49
jne 0x4014ae
cmp byte [eax], 0x4e
jne 0x4014ae
cmp byte [eax + 1], 0x47
jne 0x4014ae
lea edi, [eax + ecx]
inc eax
add edx, eax
cmp edx, ebx
jb 0x401472
jmp 0x4014bb
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp + 0x21c]
mov edx, dword [esp + 0x1c]
sub ecx, esi
push 0
mov dword [ebp + 0x21c], ecx
mov eax, dword [edi + ebp + 0x4e]
sub eax, esi
mov ecx, 0x88
mov dword [edi + ebp + 0x4e], eax
mov edi, dword [ebx + ebp - 8]
sub edi, esi
lea eax, [esi + ebp]
mov dword [ebx + ebp - 8], edi
mov esi, ebp
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x14]
mov esi, ebx
lea ecx, [esp + 0x1c]
sub esi, edx
push ecx
push esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x18], esi
je 0x401525
push str.Could_not_write_content_to_file
jmp 0x401576
push 0
lea edx, [esp + 0x24]
push str.Demo_fixed_
push edx
call fcn.00403fd9
add esp, 0xc
lea eax, [esp + 0x20]
push 0x40
push str.SKPlayer
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call fcn.00403f36
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x178
ret
push str.Could_not_open_demo_file__reason_2_
call fcn.00401090
add esp, 4
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x178
ret