Function at 0x402840
Capabilities:
Get file size
Read file on windows

Disassembly:
mov eax, 0x19e8
call fcn.00404400
mov ecx, dword [esp + 0x19ec]
push ebx
push ebp
push edi
lea eax, [esp + 0x4f0]
push 0x104
push eax
push 0x3e8
push ecx
call dword [sym.imp.USER32.dll_GetDlgItemTextA]
push 0
push 0x80
push 3
push 0
push 1
lea edx, [esp + 0x504]
push 0x80000000
push edx
mov byte [0x40a154], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x3c], ebx
jne 0x4028b8
push str.Could_not_open_demo_file
call fcn.00401090
add esp, 4
xor eax, eax
pop edi
pop ebp
pop ebx
add esp, 0x19e8
ret
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x403076
test ebp, ebp
je 0x403076
push ebp
call fcn.00403f65
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 4
lea ecx, [esp + 0x14]
mov dword [esp + 0x18], eax
push 0
push ecx
push ebp
push eax
push ebx
call edi
cmp dword [esp + 0x14], ebp
je 0x402912
push str.Could_not_read_file_to_memory
call fcn.00401090
add esp, 4
xor eax, eax
pop edi
pop ebp
pop ebx
add esp, 0x19e8
ret
push esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push 0
push ebx
call esi
lea edx, [esp + 0x18]
push 0
push edx
lea eax, [esp + 0x64]
push 8
push eax
push ebx
call edi
push 0
push 0
push 8
push ebx
call esi
lea ecx, [esp + 0x18]
push 0
push ecx
lea edx, [esp + 0x1f]
push 1
push edx
push ebx
call edi
push 0
push 0
push 0xc
push ebx
call esi
lea eax, [esp + 0x18]
push 0
push eax
lea ecx, [esp + 0x1e]
push 1
push ecx
push ebx
call edi
push 0
push 0
push 0x10
push ebx
call esi
lea edx, [esp + 0x18]
push 0
push edx
lea eax, [esp + 0x1f4]
push 0x104
push eax
push ebx
call edi
push 0
push 0
push 0x114
push ebx
call esi
lea ecx, [esp + 0x18]
push 0
push ecx
lea edx, [esp + 0xec]
push 0x108
push edx
push ebx
call edi
push 0
push 0
push 0
push ebx
call esi
add ebp, 0xfffffffa
test ebp, ebp
mov dword [esp + 0x28], ebp
jbe 0x402a1d
mov edx, dword [esp + 0x1c]
mov bl, byte [0x40a154]
mov ecx, 1
mov esi, 0xfffffffd
sub ecx, edx
lea eax, [edx + 3]
sub esi, edx
mov dl, 0x56
test bl, bl
jne 0x402a1d
cmp byte [eax - 3], bl
jne 0x402a08
cmp byte [eax - 2], 8
jne 0x402a08
cmp byte [eax - 1], 0x48
jne 0x402a08
cmp byte [eax], 0x4c
jne 0x402a08
cmp byte [eax + 1], 0x54
jne 0x402a08
mov ebp, dword [esp + 0x1c]
lea edi, [ecx + eax]
cmp byte [edi + ebp + 1], dl
je 0x402a16
mov ebp, dword [esp + 0x28]
inc eax
lea edi, [esi + eax]
cmp edi, ebp
jb 0x4029db
jmp 0x402a1d
mov byte [0x40a154], 1
mov eax, dword [esp + 0x19fc]
push 0
push 0
push 0x184
push 0x40d
push eax
call dword [sym.imp.USER32.dll_SendDlgItemMessageA]
mov eax, dword [esp + 0x28]
test eax, eax
jbe 0x402c87
mov eax, dword [esp + 0x1c]
mov edi, 0xfffffffb
sub edi, eax
mov bl, 0x44
lea esi, [eax + 5]
mov al, byte [0x40a154]
test al, al
jne 0x402aad
cmp byte [esi - 5], 0x42
jne 0x402aa1
cmp byte [esi - 4], 0x55
jne 0x402aa1
cmp byte [esi - 3], 0x49
jne 0x402aa1
cmp byte [esi - 2], 0x4c
jne 0x402aa1
cmp byte [esi - 1], bl
jne 0x402aa1
cmp byte [esi], 0x20
jne 0x402aa1
mov ecx, esi
mov edx, dword [ecx]
mov dword [esp + 0x30], edx
mov al, byte [ecx + 4]
lea ecx, [esp + 0x30]
push ecx
mov byte [esp + 0x38], al
call fcn.004043e7
add esp, 4
mov dword [0x40a47c], eax
mov eax, dword [esp + 0x28]
inc esi
lea edx, [esi + edi]
cmp edx, eax
jb 0x402a55
mov eax, dword [esp + 0x28]
test eax, eax
jbe 0x402c87
mov ecx, dword [esp + 0x1c]
mov eax, 1
sub eax, ecx
mov dword [esp + 0x38], eax
mov eax, 0xfffffffd
sub eax, ecx
lea ebx, [ecx + 3]
mov dword [esp + 0x3c], eax
mov al, byte [0x40a154]
test al, al
jne 0x402c87
mov al, byte [ebx - 3]
lea esi, [ebx - 3]
cmp al, 9
jne 0x402c74
cmp byte [ebx - 2], 0x66
jne 0x402c74
cmp byte [ebx - 1], 0x75
jne 0x402c74
cmp byte [ebx], 0x6c
jne 0x402c74
cmp byte [ebx + 1], 0x6c
jne 0x402c74
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x1c]
add eax, ebx
cmp byte [eax + ecx + 1], 0x73
jne 0x402c74
mov ecx, 0x400
lea edi, [esp + 0x9f8]
rep movsd dword es:[edi], dword [esi]
xor eax, eax
mov cl, byte [esp + eax + 0x9f8]
test cl, cl
jne 0x402b50
mov byte [esp + eax + 0x9f8], 0xa
inc eax
cmp eax, 0x1000
jb 0x402b3d
mov edx, dword [0x409894]
lea eax, [esp + 0x2c]
lea ecx, [esp + 0x9f8]
push eax
push ecx
mov dword [esp + 0x34], edx
call fcn.004042c0
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x402c74
mov byte [esp + 0x64], 0
mov esi, str.name
mov eax, ebp
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x402bb1
test cl, cl
je 0x402bad
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x402bb1
add eax, 2
add esi, 2
test cl, cl
jne 0x402b8d
xor eax, eax
jmp 0x402bb6
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402bf0
lea eax, [esp + 0x2c]
push eax
push 0
call fcn.004042c0
add esp, 8
test eax, eax
je 0x402bf0
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x64]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x2c]
push ecx
push 0
call fcn.004042c0
mov ebp, eax
lea edi, [esp + 0x6c]
or ecx, 0xffffffff
xor eax, eax
add esp, 8
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x402c6c
lea edx, [esp + 0x64]
lea eax, [esp + 0x2f0]
push edx
push 0x409888
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov edi, dword [esp + 0x1a08]
mov esi, dword [sym.imp.USER32.dll_SendDlgItemMessageA]
add esp, 0xc
lea ecx, [esp + 0x2f0]
push ecx
push 0
push 0x1a2
push 0x40d
push edi
call esi
cmp eax, 0xffffffff
jne 0x402c6c
lea edx, [esp + 0x2f0]
push edx
push 0
push 0x180
push 0x40d
push edi
call esi
test ebp, ebp
jne 0x402b81
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x28]
inc ebx
add eax, ebx
cmp eax, ecx
jb 0x402ad6
movsx ecx, byte [esp + 0x17]
mov ebp, dword [sym.imp.USER32.dll_wsprintfA]
push ecx
lea edx, [esp + 0x48]
push 0x409884
push edx
call ebp
movsx eax, byte [esp + 0x22]
push eax
lea ecx, [esp + 0x20]
push 0x409884
push ecx
call ebp
lea edi, [esp + 0x28]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x18
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, dword [0x40a47c]
mov edx, ecx
mov esi, edi
mov edi, 0x40a374
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
cmp eax, 0x808
rep movsb byte es:[edi], byte [esi]
jne 0x402cf2
lea edx, [esp + 0x20]
mov edi, str.1.1.1.0
jmp 0x402f44
cmp eax, 0x7d6
jne 0x402d07
lea edx, [esp + 0x20]
mov edi, str.1.1.0.9
jmp 0x402f44
mov esi, 0x409870
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x402d38
test cl, cl
je 0x402d34
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x402d38
add eax, 2
add esi, 2
test cl, cl
jne 0x402d10
xor eax, eax
jmp 0x402d3d
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402d4f
lea edx, [esp + 0x20]
mov edi, str.1.1.0.8
jmp 0x402f44
mov esi, 0x409864
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x402d80
test cl, cl
je 0x402d7c
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x402d80
add eax, 2
add esi, 2
test cl, cl
jne 0x402d58
xor eax, eax
jmp 0x402d85
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402d97
lea edx, [esp + 0x20]
mov edi, str.1.1.0.4
jmp 0x402f44
mov esi, 0x409858
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x402dc8
test cl, cl
je 0x402dc4
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x402dc8
add eax, 2
add esi, 2
test cl, cl
jne 0x402da0
xor eax, eax
jmp 0x402dcd
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402ddf
lea edx, [esp + 0x20]
mov edi, str.1.1.0.1
jmp 0x402f44
mov esi, 0x40984c
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x402e10
test cl, cl
je 0x402e0c
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x402e10
add eax, 2
add esi, 2
test cl, cl
jne 0x402de8
xor eax, eax
jmp 0x402e15
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402e27
lea edx, [esp + 0x20]
mov edi, str.1.1.0.0
jmp 0x402f44
mov esi, 0x409840
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x402e58
test cl, cl
je 0x402e54
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x402e58
add eax, 2
add esi, 2
test cl, cl
jne 0x402e30
xor eax, eax
jmp 0x402e5d
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402e6f
lea edx, [esp + 0x20]
mov edi, str.1.0.1.6
jmp 0x402f44
mov esi, 0x409834
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x402ea0
test cl, cl
je 0x402e9c
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x402ea0
add eax, 2
add esi, 2
test cl, cl
jne 0x402e78
xor eax, eax
jmp 0x402ea5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402eb7
lea edx, [esp + 0x20]
mov edi, str.1.0.1.3
jmp 0x402f44
mov esi, 0x409828
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x402ee8
test cl, cl
je 0x402ee4
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x402ee8
add eax, 2
add esi, 2
test cl, cl
jne 0x402ec0
xor eax, eax
jmp 0x402eed
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402efc
lea edx, [esp + 0x20]
mov edi, str.1.0.0.9
jmp 0x402f44
mov esi, 0x40981c
lea eax, [esp + 0x10]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x402f2d
test cl, cl
je 0x402f29
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x402f2d
add eax, 2
add esi, 2
test cl, cl
jne 0x402f05
xor eax, eax
jmp 0x402f32
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
lea edx, [esp + 0x20]
mov edi, str.1.0.0.8
je 0x402f44
mov edi, 0x409810
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x48]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov al, byte [0x40a154]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
test al, al
mov edi, 0x40980c
jne 0x402f78
mov edi, 0x409808
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0xe4]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [esp + 0x1ec]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x48]
push ecx
push edx
lea ecx, [esp + 0x18]
push eax
lea edx, [esp + 0x50]
push ecx
lea eax, [esp + 0x30]
push edx
push eax
lea ecx, [esp + 0x610]
push str.Half_Life_Version:__s_nDemo_Version:__s_nNetwork_Version:__s_nMap:__s_nMod:__s_nHLTV:__s
push ecx
call ebp
mov esi, dword [esp + 0x1a1c]
add esp, 0x20
lea edx, [esp + 0x5f8]
push edx
push 0
push 0xc
push 0x3ef
push esi
call dword [sym.imp.USER32.dll_SendDlgItemMessageA]
lea edi, [esp + 0xe4]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0xe4]
push ecx
push eax
push 0x40a378
call fcn.00404070
lea ecx, [esp + 0x1f8]
lea edx, [esp + 0x3fc]
push ecx
push 0x40a378
push 0x40a15c
push str._s_smaps_s.bmp
push edx
call ebp
lea eax, [esp + 0x410]
push eax
call fcn.004024e0
add esp, 0x24
mov dword [0x40a480], eax
push 5
push 0
push 0
push esi
call dword [sym.imp.USER32.dll_RedrawWindow]
mov ecx, dword [esp + 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x1c]
push edx
call fcn.00403f36
add esp, 4
xor eax, eax
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x19e8
ret
push str.Could_not_open_demofile__reason_2_
call fcn.00401090
add esp, 4
xor eax, eax
pop edi
pop ebp
pop ebx
add esp, 0x19e8
ret