Function at 0x596a40
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
mov edx, dword [0x836dfc]
mov ecx, dword [0x869174]
push ebx
mov ebx, dword [0x836e0c]
push esi
push edi
mov edi, dword [0x836e14]
mov eax, dword [edi + ebx*4]
mov esi, dword [eax + 4]
mov eax, dword [0x836e18]
lea edx, [esi + edx + 1]
mov dword [ebp - 8], ecx
cmp eax, edx
jbe 0x596a81
push str.fatal_flex_scanner_internal_error__end_of_buffer_missed
call fcn.00596150
mov edx, dword [edi + ebx*4]
cmp dword [edx + 0x28], 0
jne 0x596a9b
sub eax, ecx
dec eax
neg eax
sbb eax, eax
pop edi
neg eax
pop esi
inc eax
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, eax
sub edx, ecx
dec edx
mov dword [ebp - 4], edx
test edx, edx
jle 0x596ac0
mov dword [ebp - 0xc], edx
lea ebx, [ebx]
mov ecx, dword [ebp - 8]
mov cl, byte [ecx]
inc dword [ebp - 8]
mov byte [esi], cl
inc esi
dec dword [ebp - 0xc]
jne 0x596ab0
mov ecx, dword [edi + ebx*4]
mov esi, 2
cmp dword [ecx + 0x2c], esi
jne 0x596adc
xor eax, eax
mov dword [0x836dfc], eax
mov dword [ecx + 0x10], eax
jmp 0x596cec
mov esi, dword [ecx + 0xc]
sub esi, edx
dec esi
test esi, esi
jg 0x596b51
mov esi, edi
neg esi
sbb esi, esi
and esi, ecx
mov ecx, dword [esi + 4]
sub eax, ecx
cmp dword [esi + 0x14], 0
mov dword [ebp - 0xc], eax
je 0x596b28
mov eax, dword [esi + 0xc]
lea edx, [eax + eax]
test edx, edx
jg 0x596b0d
mov edx, eax
shr edx, 3
add edx, eax
mov eax, edx
add eax, 2
push eax
push ecx
mov dword [esi + 0xc], edx
call dword [sym.imp.MSVCR100.dll_realloc]
mov edx, dword [ebp - 4]
add esp, 8
mov dword [esi + 4], eax
jmp 0x596b2f
mov dword [esi + 4], 0
mov esi, dword [esi + 4]
test esi, esi
je 0x596bfc
mov eax, dword [ebp - 0xc]
mov ecx, dword [edi + ebx*4]
add eax, esi
mov esi, dword [ecx + 0xc]
sub esi, edx
dec esi
mov dword [0x836e18], eax
test esi, esi
jle 0x596ae6
cmp esi, 0x2000
jle 0x596b5e
mov esi, 0x2000
mov ecx, dword [edi + ebx*4]
cmp dword [ecx + 0x18], 0
je 0x596c22
mov dword [ebp - 8], 0
test esi, esi
je 0x596c15
lea ebx, [ebx]
mov edx, dword [sym.postgres.exe_replication_yyin]
push edx
call dword [sym.imp.MSVCR100.dll_getc]
mov edi, dword [0x836e14]
mov ebx, dword [0x836e0c]
add esp, 4
cmp eax, 0xffffffff
je 0x596bc0
cmp eax, 0xa
je 0x596bc5
mov ecx, dword [edi + ebx*4]
mov edx, dword [ecx + 4]
add edx, dword [ebp - 8]
mov ecx, dword [ebp - 4]
mov byte [edx + ecx], al
mov ecx, dword [ebp - 8]
inc ecx
mov dword [ebp - 8], ecx
cmp ecx, esi
jb 0x596b80
cmp eax, 0xa
jne 0x596bda
mov edx, dword [edi + ebx*4]
mov ecx, dword [ebp - 8]
mov edx, dword [edx + 4]
mov esi, dword [ebp - 4]
add edx, ecx
inc ecx
mov byte [edx + esi], al
mov dword [ebp - 8], ecx
cmp eax, 0xffffffff
jne 0x596c12
mov eax, dword [sym.postgres.exe_replication_yyin]
push eax
call dword [sym.imp.MSVCR100.dll_ferror]
add esp, 4
test eax, eax
je 0x596c06
push str.input_in_flex_scanner_failed
call fcn.00596150
push str.fatal_error___scanner_input_buffer_overflow
call fcn.00596150
mov edi, dword [0x836e14]
mov ebx, dword [0x836e0c]
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov dword [0x836dfc], eax
jmp 0x596cdf
mov edi, dword [sym.imp.MSVCR100.dll__errno]
call edi
mov edx, dword [0x836e14]
mov ebx, dword [ebp - 4]
mov dword [eax], 0
mov ecx, dword [sym.postgres.exe_replication_yyin]
mov eax, dword [0x836e0c]
push ecx
mov ecx, dword [edx + eax*4]
mov edx, dword [ecx + 4]
push esi
add edx, ebx
push 1
push edx
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x10
mov dword [0x836dfc], eax
test eax, eax
jne 0x596cd0
mov eax, dword [sym.postgres.exe_replication_yyin]
push eax
call dword [sym.imp.MSVCR100.dll_ferror]
add esp, 4
test eax, eax
je 0x596ccb
call edi
cmp dword [eax], 0x2714
jne 0x596bf2
call edi
mov dword [eax], 0
mov ecx, dword [sym.postgres.exe_replication_yyin]
push ecx
call dword [sym.imp.MSVCR100.dll_clearerr]
mov edx, dword [sym.postgres.exe_replication_yyin]
mov eax, dword [0x836e14]
mov ecx, dword [0x836e0c]
push edx
mov edx, dword [eax + ecx*4]
mov eax, dword [edx + 4]
push esi
add eax, ebx
push 1
push eax
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x14
mov dword [0x836dfc], eax
test eax, eax
je 0x596c63
jmp 0x596cd0
mov eax, dword [0x836dfc]
mov edi, dword [0x836e14]
mov ebx, dword [0x836e0c]
mov edx, dword [ebp - 4]
mov ecx, dword [edi + ebx*4]
mov dword [ecx + 0x10], eax
test eax, eax
jne 0x596d27
lea esi, [eax + 2]
test edx, edx
jne 0x596d1c
mov edx, dword [sym.postgres.exe_replication_yyin]
push edx
mov dword [ebp - 8], 1
call sym.postgres.exe_replication_yyrestart
mov edi, dword [0x836e14]
mov ebx, dword [0x836e0c]
mov eax, dword [0x836dfc]
mov edx, dword [ebp - 4]
add esp, 4
jmp 0x596d2e
mov ecx, dword [edi + ebx*4]
mov dword [ebp - 8], esi
mov dword [ecx + 0x2c], esi
jmp 0x596d2e
mov dword [ebp - 8], 0
mov ecx, dword [edi + ebx*4]
lea esi, [eax + edx]
mov dword [ebp - 0xc], esi
cmp esi, dword [ecx + 0xc]
jbe 0x596d6e
mov ecx, dword [ecx + 4]
mov esi, eax
sar esi, 1
add esi, eax
add esi, edx
push esi
push ecx
call dword [sym.imp.MSVCR100.dll_realloc]
mov edx, dword [edi + ebx*4]
mov dword [edx + 4], eax
mov eax, dword [edi + ebx*4]
add esp, 8
cmp dword [eax + 4], 0
jne 0x596d6b
push str.out_of_dynamic_memory_in_yy_get_next_buffer__
call fcn.00596150
mov esi, dword [ebp - 0xc]
mov ecx, dword [edi + ebx*4]
mov edx, dword [ecx + 4]
mov eax, esi
mov byte [eax + edx], 0
mov ecx, dword [edi + ebx*4]
mov edx, dword [ecx + 4]
mov byte [edx + eax + 1], 0
mov dword [0x836dfc], eax
mov eax, dword [edi + ebx*4]
mov ecx, dword [eax + 4]
mov eax, dword [ebp - 8]
pop edi
pop esi
mov dword [0x869174], ecx
pop ebx
mov esp, ebp
pop ebp
ret