Function at 0x594750
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x801c
call fcn.006a8ce0
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov ebx, ecx
mov edi, edx
push 0x6bf9bc
xor esi, esi
push ebx
mov dword [ebp - 0x8014], eax
mov dword [ebp - 0x801c], edi
mov dword [ebp - 0x800c], esi
call sym.postgres.exe_AllocateFile
add esp, 8
mov dword [ebp - 0x8010], eax
test eax, eax
jne 0x5947fd
call dword [sym.imp.MSVCR100.dll__errno]
cmp dword [eax], 2
jne 0x5947c1
cmp byte [ebp + 0xc], 0
je 0x5947c1
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
push 0
push str.sendFile
push 0x3f0
push str.src_backend_replication_basebackup.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5947fd
push ebx
push str.could_not_open_file___s_:__m
call sym.postgres.exe_errmsg
add esp, 8
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [edi + 0x14]
cdq
cmp edx, 1
jl 0x594846
jg 0x59480d
cmp eax, 0xffffffff
jbe 0x594846
push 0
push str.sendFile
push 0x3fa
push str.src_backend_replication_basebackup.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x594846
mov ecx, dword [ebp - 0x8014]
push ecx
push str.archive_member___s__too_large_for_tar_format
call sym.postgres.exe_errmsg
push eax
call sym.postgres.exe_errfinish
add esp, 0xc
mov ecx, dword [ebp - 0x8014]
mov edx, edi
xor ebx, ebx
call fcn.005943d0
mov eax, dword [edi + 0x14]
cdq
sub eax, dword [ebp - 0x800c]
sbb edx, esi
js 0x59487d
jg 0x59486c
cmp eax, 0x8000
jbe 0x59487d
mov eax, 0x8000
mov dword [ebp - 0x8014], 0
jmp 0x594883
mov dword [ebp - 0x8014], edx
mov edx, dword [ebp - 0x8010]
push edx
push eax
lea eax, [ebp - 0x8004]
push 1
push eax
call dword [sym.imp.MSVCR100.dll_fread]
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x59490e
push ebx
lea ecx, [ebp - 0x8004]
push ecx
push 0x64
call sym.postgres.exe_pq_putmessage
add esp, 0xc
test eax, eax
je 0x5948eb
push 0
push str.sendFile
push 0x403
push str.src_backend_replication_basebackup.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5948eb
push str.base_backup_could_not_send_data__aborting_backup
call sym.postgres.exe_errmsg
push eax
call sym.postgres.exe_errfinish
add esp, 8
add dword [ebp - 0x800c], ebx
mov eax, dword [edi + 0x14]
cdq
adc esi, 0
cmp esi, edx
jl 0x594855
jg 0x59490e
cmp dword [ebp - 0x800c], eax
jb 0x594855
mov eax, dword [edi + 0x14]
cdq
mov edi, edx
mov ebx, eax
cmp esi, edi
jg 0x5949aa
jl 0x59492e
mov eax, dword [ebp - 0x800c]
cmp eax, ebx
jae 0x5949b0
push 0x8000
lea edx, [ebp - 0x8004]
push 0
push edx
call sub.MSVCR100.dll_memset
add esp, 0xc
jmp 0x594950
sub ebx, dword [ebp - 0x800c]
sbb edi, esi
mov dword [ebp - 0x8014], edi
js 0x594971
jg 0x59496a
cmp ebx, 0x8000
jbe 0x594971
mov edi, 0x8000
jmp 0x594973
mov edi, ebx
push edi
lea eax, [ebp - 0x8004]
push eax
push 0x64
call sym.postgres.exe_pq_putmessage
mov ecx, dword [ebp - 0x801c]
mov eax, dword [ecx + 0x14]
add esp, 0xc
add dword [ebp - 0x800c], edi
cdq
adc esi, 0
mov edi, edx
mov ebx, eax
cmp esi, edi
jl 0x594950
jg 0x5949aa
cmp dword [ebp - 0x800c], ebx
jb 0x594950
mov eax, dword [ebp - 0x800c]
lea ebx, [eax + 0x1ff]
and ebx, 0xfffffe00
sub ebx, eax
je 0x594a18
lea edx, [ebp - 0x8004]
test dl, 3
jne 0x5949f4
test bl, 3
jne 0x5949f4
cmp ebx, 0x400
ja 0x5949f4
lea ecx, [ebp + ebx - 0x8004]
mov eax, edx
cmp eax, ecx
jae 0x594a06
sub ecx, edx
dec ecx
shr ecx, 2
inc ecx
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
jmp 0x594a06
push ebx
lea eax, [ebp - 0x8004]
push 0
push eax
call sub.MSVCR100.dll_memset
add esp, 0xc
push ebx
lea ecx, [ebp - 0x8004]
push ecx
push 0x64
call sym.postgres.exe_pq_putmessage
add esp, 0xc
mov edx, dword [ebp - 0x8010]
push edx
call sym.postgres.exe_FreeFile
mov ecx, dword [ebp - 4]
add esp, 4
pop edi
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret