Function at 0x487340
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
mov ebx, eax
mov eax, dword [edi]
sub eax, 0
push esi
mov dword [ebp - 4], 0
je 0x487585
dec eax
je 0x487523
dec eax
jne 0x4875e5
test ebx, ebx
jle 0x4875e5
mov eax, dword [ebp - 4]
cmp eax, dword [ebp + 0xc]
jge 0x4875e5
cmp byte [edi + 0xc], 0
jne 0x4875e5
mov eax, dword [edi + 8]
mov ecx, dword [eax + 0xc]
cmp ecx, dword [eax + 4]
jl 0x4874e0
call sym.postgres.exe_pq_getbyte
mov esi, eax
cmp esi, 0xffffffff
jne 0x4873e4
push 0
push str.CopyGetData
push 0x239
push str.src_backendcommandscopy.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4873e4
push str.unexpected_EOF_on_client_connection_with_an_open_transaction
call sym.postgres.exe_errmsg
add esp, 4
push eax
push 0x6000200
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov edx, dword [edi + 8]
push 0
push edx
call sym.postgres.exe_pq_getmessage
add esp, 8
test eax, eax
je 0x487439
push 0
push str.CopyGetData
push 0x23d
push str.src_backendcommandscopy.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x487439
push str.unexpected_EOF_on_client_connection_with_an_open_transaction
call sym.postgres.exe_errmsg
add esp, 4
push eax
push 0x6000200
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
lea eax, [esi - 0x48]
cmp eax, 0x1e
ja case.0x487448.73
movzx eax, byte [eax + 0x487604]
jmp dword [eax*4 + 0x4875f0]
push 0
push str.CopyGetData
push 0x24a
push str.src_backendcommandscopy.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je case.0x487448.100
mov ecx, dword [edi + 8]
push ecx
call sym.postgres.exe_pq_getmsgstring
push eax
push str.COPY_from_stdin_failed:__s
call sym.postgres.exe_errmsg
add esp, 0xc
push eax
push 0x40401c5
jmp 0x4874c0
push 0
push str.CopyGetData
push 0x25a
push str.src_backendcommandscopy.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je case.0x487448.100
push esi
push str.unexpected_message_type_0x_02X_during_COPY_from_stdin
call sym.postgres.exe_errmsg
add esp, 8
push eax
push 0x1020200
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [edi + 8]
mov edx, dword [eax + 0xc]
cmp edx, dword [eax + 4]
jge case.0x487448.72
mov eax, dword [edi + 8]
mov esi, dword [eax + 4]
sub esi, dword [eax + 0xc]
cmp esi, ebx
jle 0x4874ef
mov esi, ebx
mov ecx, dword [ebp + 8]
push esi
push ecx
push eax
call sym.postgres.exe_pq_copymsgbytes
add dword [ebp + 8], esi
add dword [ebp - 4], esi
sub ebx, esi
add esp, 0xc
test ebx, ebx
jg 0x487370
mov eax, dword [ebp - 4]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 4]
pop esi
mov byte [edi + 0xc], 1
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
push esi
push edx
call sym.postgres.exe_pq_getbytes
add esp, 8
test eax, eax
je 0x48757a
push 0
push str.CopyGetData
push 0x226
push str.src_backendcommandscopy.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x48757a
push str.unexpected_EOF_on_client_connection_with_an_open_transaction
call sym.postgres.exe_errmsg
add esp, 4
push eax
push 0x6000200
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov dword [ebp - 4], esi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 4]
mov ecx, dword [ebp + 8]
push eax
push ebx
push 1
push ecx
call dword [sym.imp.MSVCR100.dll_fread]
mov edx, dword [edi + 4]
push edx
mov dword [ebp - 4], eax
call dword [sym.imp.MSVCR100.dll_ferror]
add esp, 0x14
test eax, eax
je 0x4875e5
push 0
push str.CopyGetData
push 0x216
push str.src_backendcommandscopy.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4875e5
push str.could_not_read_from_COPY_file:__m
call sym.postgres.exe_errmsg
add esp, 4
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [ebp - 4]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret