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

Disassembly:
sub esp, 0x17c
mov ecx, dword [esp + 0x180]
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x88]
push 0x104
push eax
xor esi, esi
push 0x3e8
push ecx
mov dword [esp + 0x20], esi
call dword [sym.imp.USER32.dll_GetDlgItemTextA]
push 0x21
push str.SKPlayer
push str.Strip_teamsays_
push esi
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 2
je 0x401b85
push esi
push 0x80
push 3
push esi
push 1
lea edx, [esp + 0x9c]
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x20], ebp
jne 0x4019bf
push str.Could_not_open_demo_file
jmp 0x401b7d
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x18], edi
je 0x401b78
cmp edi, esi
je 0x401b78
push edi
call fcn.00403f65
add esp, 4
mov ebx, eax
lea eax, [esp + 0x14]
push esi
push eax
push edi
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x14], edi
je 0x401a08
push str.Could_not_read_file_to_memory
jmp 0x401b7d
test edi, edi
jbe 0x401b06
cmp byte [esi + ebx], 0x4b
jne 0x401af9
xor ecx, ecx
mov cl, byte [esi + ebx + 1]
mov ebp, ecx
lea edx, [esi + ebp]
cmp edx, edi
jae 0x401af9
cmp ebp, 2
jbe 0x401af9
mov al, byte [esi + ebx + 4]
add esi, 4
sub ebp, 2
cmp al, 0x2a
je 0x401a4c
cmp al, 0x28
jne 0x401af9
push ebp
call fcn.00403f65
mov edi, eax
lea eax, [esi + ebx]
push ebp
push eax
push edi
mov dword [esp + 0x2c], edi
call fcn.00404070
push 4
push edi
push str._Terrorist_
call fcn.00404030
add esp, 0x1c
test eax, eax
je 0x401ab3
push 4
push edi
push str._Counter_Terrorist_
call fcn.00404030
add esp, 0xc
test eax, eax
je 0x401ab3
push 4
push edi
push str.DEAD_Terrorist_
call fcn.00404030
add esp, 0xc
test eax, eax
je 0x401ab3
push 4
push edi
push str.DEAD_CT_
call fcn.00404030
add esp, 0xc
test eax, eax
jne 0x401aec
mov ecx, dword [esp + 0x10]
mov byte [esi + ebx - 4], 0x4a
inc ecx
mov byte [esi + ebx - 2], 2
test ebp, ebp
mov dword [esp + 0x10], ecx
mov byte [esi + ebx - 1], 0
jbe 0x401ae8
mov ecx, ebp
xor eax, eax
mov edx, ecx
lea edi, [esi + ebx]
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x1c]
lea esi, [esi + ebp - 1]
push edi
call fcn.00403f36
mov edi, dword [esp + 0x1c]
add esp, 4
inc esi
cmp esi, edi
jb 0x401a10
mov ebp, dword [esp + 0x20]
push 0
push 0
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x14]
push 0
push eax
push edi
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x14], edi
je 0x401b30
push str.Could_not_write_content_to_file
jmp 0x401b7d
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x24]
push ecx
push str._d_messages_stripped.
push edx
call fcn.00403fd9
add esp, 0xc
lea eax, [esp + 0x24]
push 0x40
push str.SKPlayer
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call fcn.00403f36
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x17c
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, 0x17c
ret