Function at 0x450590
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x280c
call fcn.006a8ce0
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
push edi
push eax
push ecx
push edx
push str.pg_xlog__08X_08X_08X
lea eax, [ebp - 0x804]
push 0x400
push eax
call sym.postgres.exe_pg_snprintf
push 0
lea ecx, [ebp - 0x804]
push 0x8000
push ecx
call sym.postgres.exe_BasicOpenFile
mov ebx, eax
add esp, 0x24
test ebx, ebx
jns 0x450624
push 0
push str.XLogFileCopy
push 0xa38
push str.src_backend_access_transamxlog.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x450624
lea edx, [ebp - 0x804]
push edx
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
call dword [sym.imp.MSVCR100.dll__getpid]
push eax
push str.pg_xlog_xlogtemp._d
lea eax, [ebp - 0x404]
push 0x400
push eax
call sym.postgres.exe_pg_snprintf
lea ecx, [ebp - 0x404]
push ecx
call sym.postgres.exe_pgunlink
push 0x180
lea edx, [ebp - 0x404]
push 0x8502
push edx
call sym.postgres.exe_BasicOpenFile
mov edi, eax
add esp, 0x20
mov dword [ebp - 0x2808], edi
test edi, edi
jns 0x4506b4
push 0
push str.XLogFileCopy
push 0xa47
push str.src_backend_access_transamxlog.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4506b4
lea eax, [ebp - 0x404]
push eax
push str.could_not_create_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 esi, dword [sym.imp.MSVCR100.dll__errno]
mov dword [ebp - 0x280c], 0x800
call esi
push 0x2000
lea ecx, [ebp - 0x2804]
push ecx
push ebx
mov dword [eax], 0
call dword [sym.imp.MSVCR100.dll__read]
add esp, 0xc
cmp eax, 0x2000
je 0x450766
call esi
cmp dword [eax], 0
push 0
push str.XLogFileCopy
je 0x450734
push 0xa54
push str.src_backend_access_transamxlog.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x450766
lea edx, [ebp - 0x804]
push edx
push str.could_not_read_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
jmp 0x450766
push 0xa57
push str.src_backend_access_transamxlog.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x450766
lea eax, [ebp - 0x804]
push eax
push str.not_enough_data_in_file___s_
call sym.postgres.exe_errmsg
push eax
call sym.postgres.exe_errfinish
add esp, 0xc
call esi
push 0x2000
lea ecx, [ebp - 0x2804]
push ecx
push edi
mov dword [eax], 0
call dword [sym.imp.MSVCR100.dll__write]
add esp, 0xc
cmp eax, 0x2000
je 0x4507f3
call esi
mov edi, dword [eax]
lea edx, [ebp - 0x404]
push edx
call sym.postgres.exe_pgunlink
add esp, 4
test edi, edi
jne 0x4507a7
mov edi, 0x1c
call esi
push 0
push str.XLogFileCopy
push 0xa67
push str.src_backend_access_transamxlog.c
push 0x14
mov dword [eax], edi
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4507ed
lea eax, [ebp - 0x404]
push eax
push str.could_not_write_to_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 edi, dword [ebp - 0x2808]
dec dword [ebp - 0x280c]
jne 0x4506c4
push edi
call sym.postgres.exe_pg_fsync
add esp, 4
test eax, eax
je 0x45084e
push 0
push str.XLogFileCopy
push 0xa6e
push str.src_backend_access_transamxlog.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x45084e
lea ecx, [ebp - 0x404]
push ecx
push str.could_not_fsync_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 esi, dword [sym.imp.MSVCR100.dll__close]
push edi
call esi
add esp, 4
test eax, eax
je 0x4508a0
push 0
push str.XLogFileCopy
push 0xa73
push str.src_backend_access_transamxlog.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4508a0
lea edx, [ebp - 0x404]
push edx
push str.could_not_close_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
push ebx
call esi
push 0
lea eax, [ebp - 0x404]
push 0
push eax
xor ecx, ecx
lea esi, [ebp + 0xc]
lea edi, [ebp + 8]
call fcn.0044a730
add esp, 0x10
pop edi
pop esi
pop ebx
test al, al
jne 0x4508e8
push str.XLogFileCopy
push 0xa7b
push str.src_backend_access_transamxlog.c
call sym.postgres.exe_elog_start
push str.InstallXLogFileSegment_should_not_have_failed
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret