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

Disassembly:
sub esp, 0x184
mov ecx, dword [esp + 0x188]
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x90]
push 0x104
push eax
push 0x3e8
push ecx
mov dword [esp + 0x24], 0
call dword [sym.imp.USER32.dll_GetDlgItemTextA]
mov eax, dword [esp + 0x19c]
xor edx, edx
mov ecx, eax
mov dl, ah
mov eax, dword [esp + 0x1a0]
and ecx, 0xff
mov dword [esp + 0x2c], ecx
mov ecx, eax
and ecx, 0xff
mov dword [esp + 0x38], edx
mov dword [esp + 0x24], ecx
xor ecx, ecx
mov cl, ah
mov eax, dword [esp + 0x1a4]
mov dword [esp + 0x34], ecx
xor ecx, ecx
mov cl, ah
mov ebx, eax
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x1a8]
mov esi, ecx
xor edx, edx
and ebx, 0xff
and esi, 0xff
mov dl, ch
cmp eax, 0x500
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], edx
je 0x401662
cmp eax, 0x480
je 0x401662
cmp eax, 0x400
je 0x401662
cmp eax, 0x320
je 0x401662
cmp eax, 0x280
je 0x401662
cmp eax, 0x200
je 0x401662
cmp eax, 0x1e0
je 0x401662
cmp eax, 0x190
jne 0x4016a2
cmp ecx, 0x3c0
je 0x4016c3
cmp ecx, 0x360
je 0x4016c3
cmp ecx, 0x300
je 0x4016c3
cmp ecx, 0x258
je 0x4016c3
cmp ecx, 0x1e0
je 0x4016c3
cmp ecx, 0x180
je 0x4016c3
cmp ecx, 0x168
je 0x4016c3
cmp ecx, 0x12c
je 0x4016c3
push 0x40
push str.SKPlayer
push str.Wrong_resolution._Available_resolutions_are:_n1280x960_n1152x864_n1024x768_n800x600_n640x480_n512x384_n480x360_n400x300
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x184
ret
push 0x21
push str.SKPlayer
push str.Convert_resolution_in_demo_
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 2
je 0x401932
push 0
push 0x80
push 3
push 0
push 1
lea edx, [esp + 0xa4]
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x30], edi
jne 0x401715
push str.Could_not_open_demo_file
jmp 0x40192a
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x401925
test ebp, ebp
je 0x401925
push 0
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebp
call fcn.00403f65
add esp, 4
mov esi, eax
lea eax, [esp + 0x10]
push 0
push eax
push ebp
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x10], ebp
je 0x401780
push 0x40
push str.SKPlayer
push str.Could_not_read_file_to_memory
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x184
ret
lea eax, [ebp - 0xe]
test eax, eax
jbe 0x4018b2
mov edi, 1
mov eax, 0xfffffff4
sub edi, esi
sub eax, esi
lea ecx, [esi + 0xc]
mov dword [esp + 0x28], eax
mov al, byte [ecx - 0xc]
test al, al
jne 0x40189b
mov al, byte [ecx - 0xb]
test al, al
jne 0x40189b
mov al, byte [ecx - 0xa]
test al, al
jne 0x40189b
mov al, byte [ecx - 9]
test al, al
jne 0x40189b
mov al, byte [ecx - 8]
test al, al
jne 0x40189b
mov al, byte [ecx - 7]
test al, al
jne 0x40189b
mov al, byte [ecx - 6]
test al, al
jne 0x40189b
mov al, byte [ecx - 5]
test al, al
jne 0x40189b
mov eax, dword [esp + 0x2c]
xor edx, edx
mov dl, byte [ecx - 4]
cmp edx, eax
jne 0x40189b
mov edx, dword [esp + 0x38]
xor eax, eax
mov al, byte [ecx - 3]
cmp eax, edx
jne 0x40189b
mov al, byte [ecx - 2]
test al, al
jne 0x40189b
mov al, byte [ecx - 1]
test al, al
jne 0x40189b
mov eax, dword [esp + 0x24]
xor edx, edx
mov dl, byte [ecx]
cmp edx, eax
jne 0x40189b
mov edx, dword [esp + 0x34]
xor eax, eax
mov al, byte [ecx + 1]
cmp eax, edx
jne 0x40189b
lea eax, [edi + ecx - 0xd]
mov dl, byte [esp + 0x18]
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], bl
inc eax
mov byte [eax + esi], dl
inc eax
mov dl, byte [esp + 0x1c]
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], 0
inc eax
mov byte [eax + esi], dl
mov dl, byte [esp + 0x20]
mov byte [eax + esi + 1], dl
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
inc ecx
lea edx, [ecx + eax]
lea eax, [ebp - 0xe]
cmp edx, eax
jb 0x4017a0
mov edi, dword [esp + 0x30]
push 0
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x10]
push 0
push eax
push ebp
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x10], ebp
je 0x4018dc
push str.Could_not_write_content_to_file
jmp 0x40192a
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x3c]
push ecx
push str.Demo_converted.
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [esp + 0x3c]
push 0x21
push str.SKPlayer
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.00403f36
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x184
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, 0x184
ret