Function at 0x599990
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x458
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov dword [ebp - 0x450], eax
mov eax, dword [0x823684]
push edi
mov ecx, dword [ebp - 0x450]
mov edx, dword [ebp + 0x14]
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x448], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x458], edi
mov ebx, ecx
mov dword [ebp - 0x44c], edx
test edx, edx
je 0x599c5b
jmp 0x5999ec
mov eax, dword [0x823684]
mov edi, dword [ebp - 0x458]
mov esi, ebx
and esi, 0xffffff
test eax, eax
js 0x599a1f
cmp edi, dword [0x836ec8]
jne 0x599a11
mov edx, ebx
shr edx, 0x18
cmp edx, dword [0x836ecc]
je 0x599b2f
test eax, eax
js 0x599a1f
push eax
call dword [sym.imp.MSVCR100.dll__close]
add esp, 4
mov eax, ebx
shr eax, 0x18
push eax
push edi
mov dword [0x836ecc], eax
mov eax, dword [sym.postgres.exe_ThisTimeLineID]
push eax
push str.pg_xlog__08X_08X_08X
lea ecx, [ebp - 0x444]
push 0x400
push ecx
mov dword [0x836ec8], edi
call sym.postgres.exe_pg_snprintf
push 0
lea edx, [ebp - 0x444]
push 0x8000
push edx
call sym.postgres.exe_BasicOpenFile
add esp, 0x24
mov dword [0x823684], eax
test eax, eax
jns 0x599b25
call dword [sym.imp.MSVCR100.dll__errno]
cmp dword [eax], 2
jne 0x599ad1
mov eax, dword [0x836ecc]
mov ecx, dword [0x836ec8]
mov edx, dword [sym.postgres.exe_ThisTimeLineID]
push eax
push ecx
push edx
push str._08X_08X_08X
lea eax, [ebp - 0x44]
push 0x40
push eax
call sym.postgres.exe_pg_snprintf
push 0
push 0x737f48
push 0x3ff
push str.src_backend_replicationwalsender.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x2c
test al, al
je 0x599b20
lea ecx, [ebp - 0x44]
push ecx
push str.requested_WAL_segment__s_has_already_been_removed
call sym.postgres.exe_errmsg
add esp, 8
jmp 0x599b11
push 0
push 0x737f48
push 0x405
push str.src_backend_replicationwalsender.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x599b20
mov edx, dword [0x836ecc]
mov eax, dword [0x836ec8]
push edx
push eax
lea ecx, [ebp - 0x444]
push ecx
push str.could_not_open_file___s___log_file__u__segment__u_:__m
call sym.postgres.exe_errmsg
add esp, 0x10
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [0x823684]
mov dword [0x836ed0], 0
cmp dword [0x836ed0], esi
je 0x599b9c
push 0
push esi
push eax
call dword [sym.imp.MSVCR100.dll__lseek]
add esp, 0xc
test eax, eax
jns 0x599b91
push 0
push 0x737f48
push 0x411
push str.src_backend_replicationwalsender.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x599b91
mov edx, dword [0x836ecc]
mov eax, dword [0x836ec8]
push esi
push edx
push eax
push str.could_not_seek_in_log_file__u__segment__u_to_offset__u:__m
call sym.postgres.exe_errmsg
add esp, 0x10
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [0x823684]
mov dword [0x836ed0], esi
mov edi, dword [ebp - 0x44c]
mov ecx, 0x1000000
sub ecx, esi
cmp edi, ecx
jbe 0x599bb4
mov edi, 0x1000000
sub edi, esi
mov edx, dword [ebp - 0x448]
push edi
push edx
push eax
call dword [sym.imp.MSVCR100.dll__read]
mov esi, eax
add esp, 0xc
test esi, esi
jg 0x599c1c
push 0
push 0x737f48
push 0x421
push str.src_backend_replicationwalsender.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x599c1c
mov eax, dword [0x836ed0]
mov ecx, dword [0x836ecc]
mov edx, dword [0x836ec8]
push edi
push eax
push ecx
push edx
push str.could_not_read_from_log_file__u__segment__u__offset__u__length__lu:__m
call sym.postgres.exe_errmsg
add esp, 0x14
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
lea eax, [esi + ebx]
cmp eax, 0xff000000
jb 0x599c34
inc dword [ebp - 0x458]
lea ebx, [eax + 0x1000000]
jmp 0x599c36
mov ebx, eax
mov eax, dword [ebp - 0x44c]
add dword [0x836ed0], esi
add dword [ebp - 0x448], esi
sub eax, esi
mov dword [ebp - 0x44c], eax
test eax, eax
jne 0x5999e1
mov ecx, dword [ebp + 0x10]
mov eax, dword [sym.postgres.exe_ThisTimeLineID]
push eax
shr ecx, 0x18
push ecx
mov ecx, dword [ebp + 0xc]
push ecx
call sym.postgres.exe_CheckXLogRemoved
add esp, 0xc
cmp byte [sym.postgres.exe_am_cascading_walsender], 0
je 0x599cd6
mov edi, dword [sym.postgres.exe_MyWalSnd]
push 0
push 1
lea esi, [edi + 0x2c]
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
test eax, eax
je 0x599ca5
push 0x441
push str.src_backend_replicationwalsender.c
push esi
call sym.postgres.exe_s_lock
add esp, 0xc
mov al, byte [edi + 0x10]
mov byte [edi + 0x10], 0
mov dword [esi], 0
test al, al
je 0x599cd6
mov eax, dword [0x823684]
test eax, eax
js 0x599cd6
push eax
call dword [sym.imp.MSVCR100.dll__close]
add esp, 4
or eax, 0xffffffff
mov dword [0x823684], eax
jmp 0x5999b4
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret