Function at 0x40a290
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x438
mov eax, dword [0x4210a8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x438], 0
mov eax, dword [esi + 0x70]
test eax, eax
je 0x40a2c4
push eax
call dword [sym.imp.MSVCR120.dll_free]
add esp, 4
push 0x200
mov dword [esi + 0x74], 0x200
call fcn.004121b0
mov ebx, dword [sym.imp.MSVCR120.dll_strerror]
add esp, 4
mov dword [esi + 0x70], eax
mov eax, dword [esi + 0x120]
mov dword [esi + 0x78], 0
mov dword [esi + 0x80], 0
mov dword [esi + 0x84], 0
test eax, eax
je 0x40a497
lea ecx, [ebp - 0x430]
mov dword [ebp - 0x438], 1
push ecx
push eax
call fcn.00415180
add esp, 8
test eax, eax
jne 0x40a456
mov eax, dword [ebp - 0x42a]
and eax, 0xf000
cmp eax, 0x4000
jne 0x40a456
push dword [esi + 0x120]
lea eax, [ebp - 0x40c]
push str._s_toc.dat
push 0x400
push eax
call fcn.00413380
add esp, 0x10
cmp eax, 0x400
jl 0x40a381
push dword [esi + 0x120]
push str.directory_name_too_long:___s__n
push dword [0x42100c]
call fcn.00410f40
add esp, 0xc
lea eax, [ebp - 0x430]
push eax
lea eax, [ebp - 0x40c]
push eax
call fcn.00415180
add esp, 8
test eax, eax
jne 0x40a3ca
mov eax, dword [ebp - 0x42a]
and eax, 0xf000
cmp eax, 0x8000
jne 0x40a3ca
pop edi
mov dword [esi + 0x58], 5
mov eax, 5
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004175a2
mov esp, ebp
pop ebp
ret
push dword [esi + 0x120]
lea eax, [ebp - 0x40c]
push str._s_toc.dat.gz
push 0x400
push eax
call fcn.00413380
add esp, 0x10
cmp eax, 0x400
jl 0x40a409
push dword [esi + 0x120]
push str.directory_name_too_long:___s__n
push dword [0x42100c]
call fcn.00410f40
add esp, 0xc
lea eax, [ebp - 0x430]
push eax
lea eax, [ebp - 0x40c]
push eax
call fcn.00415180
add esp, 8
test eax, eax
jne 0x40a439
mov eax, dword [ebp - 0x42a]
and eax, 0xf000
cmp eax, 0x8000
je 0x40a3ad
push dword [esi + 0x120]
push str.directory___s__does_not_appear_to_be_a_valid_archive___toc.dat__does_not_exist__n
push dword [0x42100c]
call fcn.00410f40
add esp, 0xc
xor edi, edi
jmp 0x40a4c2
push 0x41c2a4
push dword [esi + 0x120]
call dword [sym.imp.MSVCR120.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
jne 0x40a4c2
mov eax, dword [sym.imp.MSVCR120.dll__errno]
call eax
push dword [eax]
call ebx
push eax
push dword [esi + 0x120]
push str.could_not_open_input_file___s_:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x14
jmp 0x40a4c2
call dword [sym.imp.MSVCR120.dll___iob_func]
mov edi, eax
test edi, edi
jne 0x40a4c2
mov eax, dword [sym.imp.MSVCR120.dll__errno]
call eax
push dword [eax]
call ebx
push eax
push str.could_not_open_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
push edi
push 5
lea eax, [ebp - 0xc]
push 1
push eax
call dword [sym.imp.MSVCR120.dll_fread]
add esp, 0x10
mov dword [ebp - 0x434], eax
cmp eax, 5
je 0x40a526
push edi
call dword [sym.imp.MSVCR120.dll_ferror]
add esp, 4
test eax, eax
je 0x40a50d
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call ebx
push eax
push str.could_not_read_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
jmp 0x40a526
push dword [ebp - 0x434]
push str.input_file_is_too_short__read__lu__expected_5__n
push dword [0x42100c]
call fcn.00410f40
add esp, 0xc
mov ecx, dword [esi + 0x70]
mov eax, dword [ebp - 0xc]
mov ebx, dword [sym.imp.MSVCR120.dll_strncmp]
push 5
mov dword [ecx], eax
mov al, byte [ebp - 8]
mov byte [ecx + 4], al
lea eax, [ebp - 0xc]
push str.PGDMP
push eax
mov dword [esi + 0x78], 5
call ebx
add esp, 0xc
push edi
test eax, eax
jne 0x40a82e
call dword [sym.imp.MSVCR120.dll_fgetc]
mov ebx, dword [sym.imp.MSVCR120.dll_feof]
add esp, 4
mov dword [ebp - 0x434], eax
cmp eax, 0xffffffff
jne 0x40a5bb
push edi
call ebx
add esp, 4
test eax, eax
je 0x40a593
push str.could_not_read_from_input_file:_end_of_file_n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
jmp 0x40a5b5
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.could_not_read_from_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
mov eax, dword [ebp - 0x434]
push edi
mov byte [esi + 0x3c], al
call dword [sym.imp.MSVCR120.dll_fgetc]
add esp, 4
mov dword [ebp - 0x434], eax
cmp eax, 0xffffffff
jne 0x40a61a
push edi
call ebx
add esp, 4
test eax, eax
je 0x40a5f2
push str.could_not_read_from_input_file:_end_of_file_n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
jmp 0x40a614
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.could_not_read_from_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
mov eax, dword [ebp - 0x434]
mov edx, dword [esi + 0x78]
mov ecx, dword [esi + 0x70]
mov byte [esi + 0x3d], al
mov al, byte [esi + 0x3c]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x78]
mov ecx, dword [esi + 0x70]
inc edx
mov al, byte [esi + 0x3d]
mov dword [esi + 0x78], edx
mov byte [edx + ecx], al
mov al, byte [esi + 0x3c]
inc dword [esi + 0x78]
cmp al, 1
jg 0x40a651
jne 0x40a64b
cmp byte [esi + 0x3d], 0
jg 0x40a651
mov byte [esi + 0x3e], 0
jmp 0x40a6be
push edi
call dword [sym.imp.MSVCR120.dll_fgetc]
mov edx, eax
add esp, 4
mov dword [ebp - 0x434], edx
cmp edx, 0xffffffff
jne 0x40a6af
push edi
call ebx
add esp, 4
test eax, eax
je 0x40a687
push str.could_not_read_from_input_file:_end_of_file_n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
jmp 0x40a6a9
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.could_not_read_from_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
mov edx, dword [ebp - 0x434]
mov ecx, dword [esi + 0x78]
mov eax, dword [esi + 0x70]
mov byte [esi + 0x3e], dl
mov byte [ecx + eax], dl
inc dword [esi + 0x78]
movsx ecx, byte [esi + 0x3c]
movsx eax, byte [esi + 0x3d]
shl ecx, 8
add ecx, eax
movsx eax, byte [esi + 0x3e]
shl ecx, 8
add ecx, eax
shl ecx, 8
push edi
mov dword [esi + 0x40], ecx
call dword [sym.imp.MSVCR120.dll_fgetc]
add esp, 4
mov dword [esi + 0x50], eax
cmp eax, 0xffffffff
jne 0x40a72d
push edi
call ebx
add esp, 4
test eax, eax
je 0x40a70b
push str.could_not_read_from_input_file:_end_of_file_n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
jmp 0x40a72d
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.could_not_read_from_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
mov edx, dword [esi + 0x78]
mov ecx, dword [esi + 0x70]
mov al, byte [esi + 0x50]
mov byte [edx + ecx], al
inc dword [esi + 0x78]
cmp dword [esi + 0x40], 0x1070000
jl 0x40a7b8
push edi
call dword [sym.imp.MSVCR120.dll_fgetc]
add esp, 4
mov dword [esi + 0x54], eax
cmp eax, 0xffffffff
jne 0x40a7a7
push edi
call ebx
add esp, 4
test eax, eax
je 0x40a785
push str.could_not_read_from_input_file:_end_of_file_n
push dword [0x42100c]
call fcn.00410f40
mov edx, dword [esi + 0x78]
add esp, 8
mov ecx, dword [esi + 0x70]
mov al, byte [esi + 0x54]
mov byte [edx + ecx], al
inc dword [esi + 0x78]
jmp 0x40a7be
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.could_not_read_from_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
mov edx, dword [esi + 0x78]
mov ecx, dword [esi + 0x70]
mov al, byte [esi + 0x54]
mov byte [edx + ecx], al
inc dword [esi + 0x78]
jmp 0x40a7be
mov eax, dword [esi + 0x50]
mov dword [esi + 0x54], eax
push edi
call dword [sym.imp.MSVCR120.dll_fgetc]
add esp, 4
mov dword [ebp - 0x434], eax
cmp eax, 0xffffffff
jne 0x40a81a
push edi
call ebx
add esp, 4
test eax, eax
je 0x40a7f2
push str.could_not_read_from_input_file:_end_of_file_n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
jmp 0x40a814
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.could_not_read_from_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
mov eax, dword [ebp - 0x434]
mov edx, dword [esi + 0x78]
mov ecx, dword [esi + 0x70]
mov dword [esi + 0x58], eax
mov byte [edx + ecx], al
inc dword [esi + 0x78]
jmp 0x40a927
mov eax, 0x200
sub eax, dword [esi + 0x78]
push eax
mov eax, dword [esi + 0x70]
add eax, dword [esi + 0x78]
push 1
push eax
call dword [sym.imp.MSVCR120.dll_fread]
mov ecx, dword [esi + 0x78]
add esp, 0x10
add ecx, eax
mov dword [esi + 0x78], ecx
cmp ecx, 0x2b
jb 0x40a88f
push 0x23
push str.___n___PostgreSQL_database_dump_n___n_n
push dword [esi + 0x70]
call ebx
add esp, 0xc
test eax, eax
je 0x40a87c
push 0x2b
push str.___n___PostgreSQL_database_cluster_dump_n___n_n
push dword [esi + 0x70]
call ebx
add esp, 0xc
test eax, eax
jne 0x40a88f
push str.input_file_appears_to_be_a_text_format_dump._Please_use_psql._n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
cmp dword [esi + 0x78], 0x200
je 0x40a8fe
mov ebx, dword [sym.imp.MSVCR120.dll_feof]
push edi
call ebx
add esp, 4
test eax, eax
je 0x40a8bd
push str.input_file_does_not_appear_to_be_a_valid_archive__too_short___n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
jmp 0x40a8fe
push edi
call ebx
add esp, 4
test eax, eax
je 0x40a8dc
push str.could_not_read_from_input_file:_end_of_file_n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
jmp 0x40a8fe
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.could_not_read_from_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
push dword [esi + 0x70]
call fcn.0040f410
add esp, 4
test al, al
jne 0x40a920
push str.input_file_does_not_appear_to_be_a_valid_archive_n
push dword [0x42100c]
call fcn.00410f40
add esp, 8
mov dword [esi + 0x58], 3
push 0
push 0
push 0
push edi
call dword [sym.imp.MSVCR120.dll__fseeki64]
add esp, 0x10
test eax, eax
je 0x40a944
mov dword [esi + 0x6c], 1
jmp 0x40a94b
mov dword [esi + 0x78], 0
cmp dword [ebp - 0x438], 0
je 0x40a984
push edi
call dword [sym.imp.MSVCR120.dll_fclose]
add esp, 4
test eax, eax
je 0x40a984
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.could_not_close_input_file:__s_n
push dword [0x42100c]
call fcn.00410f40
add esp, 0x10
mov eax, dword [esi + 0x58]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004175a2
mov esp, ebp
pop ebp
ret