Function at 0x5fdf30
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0x14]
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x2c], eax
test edx, edx
jg 0x5fdfdf
jl 0x5fdf60
test esi, esi
jae 0x5fdfd1
mov ebx, dword [ebp + 0x10]
test ebx, ebx
jg 0x5fdf7a
jl 0x5fdf6d
test edi, edi
jae 0x5fdf7a
mov esi, edi
neg esi
mov edx, ebx
adc edx, 0
neg edx
jmp 0x5fdfd1
lea ecx, [ebp - 0x28]
push ecx
push eax
call sym.postgres.exe_pgwin32_safestat
add esp, 8
test eax, eax
jns 0x5fdfc7
push 0
push 0x7471c4
push 0x6b
push str.src_backendutils_adtgenfile.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5fdfc7
mov edx, dword [ebp - 0x2c]
push edx
push str.could_not_stat_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 [ebp - 0x14]
cdq
mov esi, eax
sub esi, edi
sbb edx, ebx
test edx, edx
jl 0x5fe01f
jg 0x5fdfdf
cmp esi, 0x3ffffffb
jbe 0x5fe01f
push 0
push 0x7471c4
push 0x75
push str.src_backendutils_adtgenfile.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5fe01f
push str.requested_length_too_large
call sym.postgres.exe_errmsg
add esp, 4
push eax
push 0x3080082
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [ebp - 0x2c]
push 0x6bf9bc
push eax
call sym.postgres.exe_AllocateFile
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x5fe071
push eax
push 0x7471c4
push 0x7b
push str.src_backendutils_adtgenfile.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5fe071
mov ecx, dword [ebp - 0x2c]
push ecx
push str.could_not_open_file___s__for_reading:__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
cmp dword [ebp + 0x10], 0
jl 0x5fe081
jg 0x5fe07d
test edi, edi
jb 0x5fe081
xor eax, eax
jmp 0x5fe086
mov eax, 2
push eax
mov eax, edi
cdq
push edx
push eax
push ebx
call dword [sym.imp.MSVCR100.dll__fseeki64]
add esp, 0x10
test eax, eax
je 0x5fe0d9
push 0
push 0x7471c4
push 0x81
push str.src_backendutils_adtgenfile.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5fe0d9
mov edx, dword [ebp - 0x2c]
push edx
push str.could_not_seek_in_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 ecx, dword [sym.postgres.exe_CurrentMemoryContext]
lea eax, [esi + 4]
push eax
push ecx
call sym.postgres.exe_MemoryContextAlloc
push ebx
mov edi, eax
push esi
lea edx, [edi + 4]
push 1
push edx
call dword [sym.imp.MSVCR100.dll_fread]
push ebx
mov esi, eax
call dword [sym.imp.MSVCR100.dll_ferror]
add esp, 0x1c
test eax, eax
je 0x5fe148
push 0
push 0x7471c4
push 0x8a
push str.src_backendutils_adtgenfile.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5fe148
mov eax, dword [ebp - 0x2c]
push eax
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
lea ecx, [esi*4 + 0x10]
push ebx
mov dword [edi], ecx
call sym.postgres.exe_FreeFile
mov ecx, dword [ebp - 4]
add esp, 4
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret