Function at 0x452150
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4b4
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [0x833534]
push esi
push edi
mov edi, ecx
mov edx, dword [edi + 4]
mov ecx, dword [0x833530]
mov eax, edx
shr eax, 0xd
and eax, 0x7ff
shl eax, 0xd
cmp dword [0x833544], 0
mov dword [ebp - 0x49c], edi
mov byte [ebp - 0x495], 0
mov dword [ebp - 0x4a0], eax
jne 0x4521c7
cmp dword [edi], ecx
jne 0x4521c7
mov esi, edx
shr esi, 0x18
cmp esi, ebx
jne 0x4521c7
cmp eax, dword [0x833538]
jne 0x4521c7
and edx, 0x1fff
cmp edx, dword [0x83353c]
jb 0x452a38
mov esi, dword [0x7a33d4]
test esi, esi
js 0x452247
cmp dword [edi], ecx
jne 0x4521dd
movzx eax, byte [edi + 7]
cmp eax, ebx
je 0x452247
cmp byte [0x8334e8], 0
je 0x45222a
cmp byte [0x833569], 0
je 0x45222a
push ebx
call fcn.0044a600
add esp, 4
test al, al
je 0x45222a
call sym.postgres.exe_GetRedoRecPtr
mov ecx, dword [0x833534]
push ecx
mov ecx, dword [0x833530]
call fcn.0044a600
add esp, 4
test al, al
je 0x452224
push 0x20
call sym.postgres.exe_RequestCheckpoint
add esp, 4
mov esi, dword [0x7a33d4]
push esi
call dword [sym.imp.MSVCR100.dll__close]
add esp, 4
or esi, 0xffffffff
mov dword [0x7a33d4], esi
mov dword [0x833540], 0
movzx eax, byte [edi + 7]
mov edx, dword [edi]
mov dword [0x833530], edx
mov dword [0x833534], eax
jmp 0x452270
mov esi, dword [0x7a33d4]
jmp 0x452270
mov edx, dword [0x833570]
mov eax, dword [0x83356c]
test esi, esi
js 0x4522a9
cmp dword [0x833540], 4
jne 0x452717
mov ebx, dword [ebp - 0x49c]
mov ecx, dword [ebx]
cmp ecx, eax
jb 0x4526ea
jne 0x4522af
cmp dword [ebx + 4], edx
jb 0x4526ea
jmp 0x4522af
mov ebx, dword [ebp - 0x49c]
cmp byte [sym.postgres.exe_StandbyMode], 0
je 0x45267f
lea esp, [esp]
call sym.postgres.exe_WalRcvInProgress
test al, al
je 0x452375
test byte [0x833544], 4
je 0x4522dd
call sym.postgres.exe_ShutdownWalRcv
jmp 0x4522c0
mov ecx, dword [ebx]
mov eax, dword [0x83356c]
cmp ecx, eax
jb 0x452539
jne 0x4522fd
mov edx, dword [0x833570]
cmp dword [ebx + 4], edx
jb 0x45253f
lea ecx, [ebp - 0x4ac]
push ecx
call sym.postgres.exe_GetWalRcvWriteRecPtr
mov ecx, dword [ebx]
add esp, 4
mov dword [0x83356c], eax
mov dword [0x833570], edx
cmp ecx, eax
jb 0x4524bd
jne 0x45232c
cmp dword [ebx + 4], edx
jb 0x4524bd
call fcn.0044fdb0
test al, al
jne 0x452260
mov edx, dword [0x83350c]
push 0x1388
add edx, 0x48c
push 9
push edx
call sym.postgres.exe_WaitLatch
mov eax, dword [0x83350c]
add eax, 0x48c
push eax
call sym.postgres.exe_ResetLatch
add esp, 0x10
call sym.postgres.exe_HandleStartupProcInterrupts
mov ebx, dword [ebp - 0x49c]
jmp 0x4522c0
mov eax, dword [0x7a33d4]
xor esi, esi
cmp eax, esi
jl 0x452394
push eax
call dword [sym.imp.MSVCR100.dll__close]
add esp, 4
mov dword [0x7a33d4], 0xffffffff
cmp byte [ebp + 0x10], 0
je 0x4523a0
mov dword [0x833460], esi
mov eax, dword [0x833544]
mov ecx, eax
not ecx
test cl, 3
jne 0x452464
cmp byte [0x8334ea], 0
mov dword [0x833544], esi
je 0x4523ce
call fcn.00451630
test al, al
jne 0x4522c0
push 0
call dword [sym.imp.MSVCR100.dll__time32]
mov ecx, dword [0x833578]
cdq
add esp, 4
mov edi, eax
sub edi, ecx
mov esi, edx
sbb esi, dword [0x83357c]
test esi, esi
jg 0x452414
jl 0x4523f7
cmp edi, 5
jae 0x452414
sub ecx, eax
add ecx, 5
imul ecx, ecx, 0xf4240
push ecx
call sym.postgres.exe_pg_usleep
push 0
call dword [sym.imp.MSVCR100.dll__time32]
add esp, 8
cdq
mov dword [0x83357c], edx
mov edx, dword [0x8334ec]
mov dword [0x833578], eax
test edx, edx
je 0x45245f
cmp byte [ebp + 0xc], 0
je 0x45244a
mov ecx, dword [0x833508]
mov eax, dword [0x833504]
push edx
push ecx
push eax
call sym.postgres.exe_RequestXLogStreaming
add esp, 0xc
jmp 0x4522c0
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
push edx
push ecx
push eax
call sym.postgres.exe_RequestXLogStreaming
add esp, 0xc
jmp 0x4522c0
mov eax, dword [0x833544]
mov edx, dword [0x833530]
mov edi, dword [0x833534]
not eax
and eax, 3
mov ebx, eax
push ebx
push 0xd
push edx
call fcn.00450bf0
mov esi, eax
add esp, 0xc
mov dword [0x7a33d4], esi
mov byte [ebp - 0x495], 1
test esi, esi
jns 0x4526d6
or dword [0x833544], ebx
call fcn.0044fdb0
test al, al
jne 0x4529fa
call sym.postgres.exe_HandleStartupProcInterrupts
mov ebx, dword [ebp - 0x49c]
jmp 0x4522c0
mov esi, dword [ebp - 0x4ac]
cmp ecx, esi
jb 0x45253f
jne 0x4524d4
mov ecx, dword [ebx + 4]
cmp ecx, dword [ebp - 0x4a8]
jb 0x45253f
call sym.postgres.exe_GetCurrentTimestamp
mov esi, dword [0x83350c]
push 0
mov edi, esi
push 1
add esi, 0x51c
push esi
mov dword [0x833548], eax
mov dword [0x83354c], edx
mov ebx, eax
mov dword [ebp - 0x4b0], edx
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
test eax, eax
je 0x45251c
push 0x17f2
push str.src_backend_access_transamxlog.c
push esi
call sym.postgres.exe_s_lock
add esp, 0xc
mov edx, dword [ebp - 0x4b0]
mov eax, dword [0x83356c]
mov dword [edi + 0x508], ebx
mov dword [edi + 0x50c], edx
mov dword [esi], 0
mov edx, dword [0x833570]
mov esi, dword [0x7a33d4]
test esi, esi
jns 0x45266c
mov eax, dword [0x833534]
mov ecx, dword [0x833530]
mov esi, dword [0x8333c0]
push eax
push ecx
push esi
push str._08X_08X_08X
mov ebx, eax
lea eax, [ebp - 0x44]
mov edi, ecx
push 0x40
push eax
mov dword [ebp - 0x4a4], edi
call sym.postgres.exe_pg_snprintf
push ebx
push edi
push esi
push str.pg_xlog__08X_08X_08X
lea ecx, [ebp - 0x494]
push 0x400
push ecx
call sym.postgres.exe_pg_snprintf
push 0
lea edx, [ebp - 0x494]
push 0x8000
push edx
mov byte [0x8334d7], 0
call sym.postgres.exe_BasicOpenFile
mov edi, eax
add esp, 0x3c
test edi, edi
js 0x452608
lea eax, [ebp - 0x44]
push eax
push str.recovering__s
lea ecx, [ebp - 0x94]
push 0x50
push ecx
mov dword [0x833460], esi
call sym.postgres.exe_pg_snprintf
lea edx, [ebp - 0x94]
push 0
push edx
call sym.postgres.exe_set_ps_display
mov eax, 4
mov esi, edi
add esp, 0x18
mov dword [0x833540], eax
mov dword [0x833550], eax
mov dword [0x7a33d4], esi
mov byte [ebp - 0x495], 1
jmp 0x4526d6
call dword [sym.imp.MSVCR100.dll__errno]
push 0
push str.XLogFileRead
push 0xb4c
push str.src_backend_access_transamxlog.c
push 0x16
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x452658
mov eax, dword [ebp - 0x4a4]
push ebx
push eax
lea ecx, [ebp - 0x494]
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
or edi, 0xffffffff
mov esi, edi
mov dword [0x7a33d4], esi
mov byte [ebp - 0x495], 1
jmp 0x4526d6
mov ecx, 4
mov dword [0x833540], ecx
mov dword [0x833550], ecx
jmp 0x4526ea
test esi, esi
jns 0x4526e1
cmp byte [ebp + 0x10], 0
je 0x452693
mov dword [0x833460], 0
cmp byte [0x8334d6], 0
mov eax, 2
je 0x4526a6
mov eax, 3
mov edx, dword [ebp + 8]
mov edi, dword [0x833534]
push eax
mov eax, dword [0x833530]
push edx
push eax
call fcn.00450bf0
mov esi, eax
add esp, 0xc
mov dword [0x7a33d4], esi
mov byte [ebp - 0x495], 1
test esi, esi
js 0x452a25
mov eax, dword [0x83356c]
mov edx, dword [0x833570]
cmp dword [0x833540], 4
jne 0x452717
mov edi, dword [ebp - 0x49c]
cmp dword [edi], eax
jne 0x45271d
mov ecx, dword [edi + 4]
xor ecx, edx
test ecx, 0xffffe000
jne 0x45271d
mov ebx, dword [ebp - 0x4a0]
and edx, 0xffffff
sub edx, ebx
mov dword [0x83353c], edx
jmp 0x45272d
mov edi, dword [ebp - 0x49c]
mov ebx, dword [ebp - 0x4a0]
mov dword [0x83353c], 0x2000
cmp byte [ebp - 0x495], 0
je 0x452822
test ebx, ebx
je 0x452822
mov edx, dword [0x833554]
push 0x2000
push edx
push esi
mov dword [0x833538], 0
call dword [sym.imp.MSVCR100.dll__read]
add esp, 0xc
cmp eax, 0x2000
je 0x4527fd
cmp dword [0x833540], 2
mov ecx, dword [edi]
mov edx, dword [edi + 4]
mov eax, dword [ebp + 8]
jne 0x4527a6
cmp eax, 0xf
jne 0x4527a6
cmp ecx, dword [0x833580]
jne 0x45279a
cmp edx, dword [0x833584]
jne 0x45279a
mov eax, 0xe
jmp 0x4527a6
mov dword [0x833580], ecx
mov dword [0x833584], edx
push 0
push str.XLogPageRead
push 0x29ab
push str.src_backend_access_transamxlog.c
push eax
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4529a5
mov eax, dword [0x833538]
mov ecx, dword [0x833534]
mov edx, dword [0x833530]
push eax
push ecx
push edx
push str.could_not_read_from_log_file__u__segment__u__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
jmp 0x4529a5
mov eax, dword [0x833554]
mov edi, dword [ebp + 8]
push 1
push eax
mov ecx, edi
call fcn.00451140
add esp, 8
test al, al
je 0x4529a5
mov esi, dword [0x7a33d4]
jmp 0x452825
mov edi, dword [ebp + 8]
push 0
push ebx
push esi
mov dword [0x833538], ebx
call dword [sym.imp.MSVCR100.dll__lseek]
add esp, 0xc
test eax, eax
jns 0x4528d3
cmp dword [0x833540], 2
mov esi, dword [ebp - 0x49c]
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov eax, edi
jne 0x45287c
cmp edi, 0xf
jne 0x45287c
cmp ecx, dword [0x833580]
jne 0x452870
cmp edx, dword [0x833584]
jne 0x452870
lea eax, [edi - 1]
jmp 0x45287c
mov dword [0x833580], ecx
mov dword [0x833584], edx
push 0
push str.XLogPageRead
push 0x29b9
push str.src_backend_access_transamxlog.c
push eax
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4529a5
mov eax, dword [0x833538]
mov ecx, dword [0x833534]
mov edx, dword [0x833530]
push eax
push ecx
push edx
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
jmp 0x4529a5
mov eax, dword [0x833554]
mov ecx, dword [0x7a33d4]
push 0x2000
push eax
push ecx
call dword [sym.imp.MSVCR100.dll__read]
add esp, 0xc
cmp eax, 0x2000
je 0x45298a
cmp dword [0x833540], 2
mov esi, dword [ebp - 0x49c]
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov eax, edi
jne 0x45293a
cmp edi, 0xf
jne 0x45293a
cmp ecx, dword [0x833580]
jne 0x452929
cmp edx, dword [0x833584]
jne 0x452929
lea eax, [edi - 1]
jmp 0x45293a
mov edx, ecx
mov ecx, dword [esi + 4]
mov dword [0x833580], edx
mov dword [0x833584], ecx
push 0
push str.XLogPageRead
push 0x29c1
push str.src_backend_access_transamxlog.c
push eax
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4529a5
mov edx, dword [0x833538]
mov eax, dword [0x833534]
mov ecx, dword [0x833530]
push edx
push eax
push ecx
push str.could_not_read_from_log_file__u__segment__u__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
jmp 0x4529a5
mov edx, dword [0x833554]
push 0
push edx
mov ecx, edi
call fcn.00451140
add esp, 8
test al, al
jne 0x452a38
mov eax, dword [0x833540]
or dword [0x833544], eax
mov eax, dword [0x7a33d4]
xor edi, edi
cmp eax, edi
jl 0x4529c5
push eax
call dword [sym.imp.MSVCR100.dll__close]
add esp, 4
or esi, 0xffffffff
cmp byte [sym.postgres.exe_StandbyMode], 0
mov dword [0x7a33d4], esi
mov dword [0x83353c], edi
mov dword [0x833540], edi
jne 0x452270
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
mov eax, dword [0x7a33d4]
xor esi, esi
cmp eax, esi
jl 0x452a0f
push eax
call dword [sym.imp.MSVCR100.dll__close]
add esp, 4
mov dword [0x7a33d4], 0xffffffff
mov dword [0x83353c], esi
mov dword [0x833540], esi
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
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret