Function at 0x541380
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x6512b8
mov eax, dword fs:[0]
push eax
sub esp, 0x18c
mov eax, dword [0x6af168]
xor eax, esp
mov dword [esp + 0x188], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6af168]
xor eax, esp
push eax
lea eax, [esp + 0x1a0]
mov dword fs:[0], eax
mov edi, ecx
cmp dword [edi + 0x548], 0x10
lea esi, [edi + 0x530]
mov ebx, edx
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], ebx
jb 0x5413db
mov eax, dword [esi + 4]
jmp 0x5413de
lea eax, [esi + 4]
push 0x6792dc
push eax
call fcn.006262fc
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x54143b
push esi
lea eax, [esp + 0x84]
push str.Demo_file_not_found:
push eax
call fcn.0044cec0
add esp, 0xc
push 0xffffffffffffffff
push ebp
push eax
mov ecx, ebx
mov dword [esp + 0x1b4], ebp
call fcn.00401d10
cmp dword [esp + 0x98], 0x10
jb 0x541434
mov ecx, dword [esp + 0x84]
push ecx
call fcn.0062493b
add esp, 4
xor al, al
jmp 0x54186f
mov ecx, ebp
lea eax, [esp + 0x14]
call fcn.005418a0
push ebp
push 1
lea edx, [esp + 0x44]
push 4
push edx
mov dword [esp + 0x1b8], 1
call fcn.00626e1f
add esp, 0x10
cmp dword [esp + 0x3c], 0x42beef78
je 0x54148b
push 0x12
push str.Invalid_demo_file.
mov ecx, ebx
call fcn.00402300
lea eax, [esp + 0x14]
call fcn.005418b0
xor al, al
jmp 0x54186f
push ebp
push 1
lea eax, [esp + 0x40]
push 4
push eax
call fcn.00626e1f
push ebp
push 1
lea esi, [edi + 8]
push 4
push esi
call fcn.00626e1f
mov eax, dword [esi]
call fcn.004e6030
push ebp
push 1
lea ecx, [esp + 0x44]
push 2
push ecx
mov dword [esp + 0x4c], 4
call fcn.00626e1f
mov eax, dword [esp + 0x4c]
add esp, 0x30
cmp ax, 0xff
jbe 0x5414dc
mov eax, 0xff
mov dword [esp + 0x1c], eax
movzx edx, ax
push ebp
push edx
lea eax, [esp + 0xa4]
push 1
push eax
call fcn.00626e1f
movzx ecx, word [esp + 0x2c]
lea eax, [esp + 0xac]
mov byte [esp + ecx + 0xac], 0
add esp, 0x10
lea ecx, [edi + 0x398]
lea esi, [eax + 1]
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x541510
sub eax, esi
push eax
mov eax, dword [ecx + 0x14]
lea edx, [esp + 0xa0]
push edx
push eax
push 0
call fcn.00443b30
test eax, eax
je 0x541611
lea ecx, [esp + 0x9c]
push ecx
lea ecx, [esp + 0x64]
call fcn.00402130
push eax
lea edx, [esp + 0x84]
push str.This_demo_file_appears_to_be_for_
push edx
mov byte [esp + 0x1b4], 2
call fcn.0044cec0
add esp, 0xc
push 0x67cd0c
push eax
lea eax, [esp + 0x48]
push eax
mov byte [esp + 0x1b4], 3
call fcn.0044cf70
add esp, 0xc
push 0xffffffffffffffff
push 0
push eax
mov ecx, ebx
mov byte [esp + 0x1b4], 4
call fcn.00401d10
mov edi, 0x10
cmp dword [esp + 0x58], edi
jb 0x5415ad
mov ecx, dword [esp + 0x44]
push ecx
call fcn.0062493b
add esp, 4
xor ebx, ebx
cmp dword [esp + 0x98], edi
mov esi, 0xf
mov dword [esp + 0x58], esi
mov dword [esp + 0x54], ebx
mov byte [esp + 0x44], bl
jb 0x5415d9
mov edx, dword [esp + 0x84]
push edx
call fcn.0062493b
add esp, 4
cmp dword [esp + 0x78], edi
mov dword [esp + 0x98], esi
mov dword [esp + 0x94], ebx
mov byte [esp + 0x84], bl
jb 0x541601
mov eax, dword [esp + 0x64]
push eax
call fcn.0062493b
add esp, 4
lea eax, [esp + 0x14]
call fcn.005418b0
xor al, al
jmp 0x54186f
push ebp
call fcn.00626b15
add esp, 4
push 2
push 0
push ebp
mov ebx, eax
call fcn.006268f8
add esp, 0xc
push ebp
call fcn.00626b15
add esp, 4
push 0
mov esi, eax
push ebx
push ebp
sub esi, ebx
call fcn.006268f8
add esp, 0xc
cmp dword [esp + 0x38], 2
jb 0x54180f
push ebp
push 1
lea ecx, [esp + 0x20]
push 4
push ecx
call fcn.00626e1f
sub esi, 4
add esp, 0x10
cmp dword [esp + 0x18], esi
mov dword [esp + 0x30], esi
jl 0x54168a
mov ecx, dword [esp + 0x24]
push str.Invalid_demo_file.
call fcn.004022b0
lea eax, [esp + 0x14]
call fcn.005418b0
xor al, al
jmp 0x54186f
lea eax, [esp + 0x40]
call fcn.005653c0
mov byte [esp + 0x1a8], 5
mov edx, dword [esp + 0x18]
push edx
call fcn.00613caa
add esp, 4
mov ebx, eax
mov eax, dword [esp + 0x18]
push ebp
push eax
push 1
push ebx
mov dword [esp + 0x44], ebx
call fcn.00626e1f
mov edi, dword [esp + 0x28]
add esp, 0x10
lea ecx, [esp + 0x40]
push ecx
call fcn.00565850
lea eax, [esp + 0x40]
call fcn.00565500
call fcn.00565b20
xor ebx, ebx
cmp eax, ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x20], ebx
jle 0x5417b6
jmp 0x5416f2
xor ebx, ebx
lea eax, [esp + 0x40]
call fcn.00565cf0
test al, al
jne 0x5417b6
mov dword [esp + 0x78], 0xf
mov dword [esp + 0x74], ebx
mov byte [esp + 0x64], bl
mov dword [esp + 0x7c], ebx
mov edi, dword [esp + 0x28]
add edi, 0x5a0
lea eax, [esp + 0x60]
mov ebx, edi
mov byte [esp + 0x1a8], 6
call fcn.005524f0
mov bl, 5
lea esi, [esp + 0x60]
mov byte [esp + 0x1a8], bl
call fcn.0054ea00
mov eax, dword [edi + 4]
mov esi, dword [eax + 4]
cmp esi, eax
jne 0x541755
call fcn.0062492b
cmp esi, dword [edi + 4]
jne 0x54175f
call fcn.0062492b
lea edi, [esp + 0x60]
lea ecx, [esp + 0x40]
add esi, 8
call fcn.00565b60
push 0xffffffffffffffff
push 0
push eax
mov ecx, esi
mov byte [esp + 0x1b4], 7
call fcn.00401d10
mov ecx, edi
mov byte [esp + 0x1a8], bl
call fcn.00401c70
lea eax, [esp + 0x40]
call fcn.00565b20
mov dword [esi + 0x1c], eax
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0x30]
add eax, 1
cmp eax, dword [esp + 0x2c]
mov dword [esp + 0x20], eax
jl 0x5416f0
mov edx, dword [esp + 0x2c]
cmp dword [esp + 0x20], edx
je 0x5417e9
mov ecx, dword [esp + 0x24]
push 0x12
push str.Invalid_demo_file.
call fcn.00402300
lea ecx, [esp + 0x40]
call fcn.005653e0
lea eax, [esp + 0x14]
call fcn.005418b0
xor al, al
jmp 0x54186f
mov eax, dword [esp + 0x34]
sub esi, dword [esp + 0x18]
push eax
call fcn.0062506e
add esp, 4
lea ecx, [esp + 0x40]
mov byte [esp + 0x1a8], 1
call fcn.005653e0
mov edi, dword [esp + 0x28]
push ebp
push 1
lea ecx, [edi + 0x56c]
push 4
push ecx
call fcn.00626e1f
sub esi, 4
add esp, 0x10
test esi, esi
jle 0x54166c
push esi
call fcn.00613caa
add esp, 4
push ebp
push esi
mov ebx, eax
push 1
push ebx
call fcn.00626e1f
add esp, 0x10
lea ebp, [edi + 0x54c]
push ebp
mov edi, esi
call fcn.00565850
mov eax, ebp
call fcn.00565500
push ebx
call fcn.0062506e
add esp, 4
lea eax, [esp + 0x14]
call fcn.005418b0
mov al, 1
mov ecx, dword [esp + 0x1a0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x188]
xor ecx, esp
call fcn.00624940
add esp, 0x198
ret