Function at 0x588720
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov ebx, dword [esi]
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 4], edi
mov dword [ebp - 8], ebx
cmp ebx, 0xc
jl 0x588973
mov eax, dword [edi]
mov ecx, dword [edi + 4]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [edi + 8]
mov dword [ebp - 0x20], eax
test al, al
jne 0x58890c
mov edx, eax
shr edx, 8
test dl, dl
jne 0x58890c
shr eax, 0x10
test ax, ax
je 0x58890c
mov edx, 0x1f7
cmp ax, dx
ja 0x58890c
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x58890c
cmp cl, 0x74
je 0x5887a0
cmp cl, 0x66
je 0x5887a0
cmp cl, 0x54
je 0x5887a0
cmp cl, 0x46
jne 0x58890c
lea ebx, [eax + 9]
xor edi, edi
xor esi, esi
cmp dword [ebp - 8], ebx
jl 0x58896a
cmp cl, 0x54
je 0x5887c1
mov dword [ebp - 0xc], 1
cmp cl, 0x46
jne 0x5887c8
mov dword [ebp - 0xc], 8
and edx, 0x800000ff
jns 0x5887d8
dec edx
or edx, 0xffffff00
inc edx
lea eax, [edx*4 + 0x836990]
mov dword [ebp - 0x14], eax
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
test eax, eax
je 0x588810
mov eax, dword [eax + 8]
test eax, eax
je 0x588810
mov edx, dword [eax]
mov ecx, dword [edx]
cmp ecx, dword [ebp - 0x1c]
je 0x58880e
test ecx, ecx
jne 0x588805
test esi, esi
jne 0x588805
mov esi, edx
mov eax, dword [eax + 4]
test eax, eax
jne 0x5887f2
jmp 0x588810
mov edi, edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 8]
cmp cl, 0x66
je 0x58888b
cmp cl, 0x46
je 0x58888b
add eax, 9
test edi, edi
je 0x588868
movzx ecx, word [ebp - 0x1e]
push ecx
push eax
lea esi, [edi + 4]
push esi
call sym.postgres.exe_appendBinaryStringInfo
mov edx, dword [ebp - 0xc]
mov eax, dword [esi + 4]
mov ecx, dword [esi]
push edx
push eax
push ecx
call sym.postgres.exe_write_syslogger_file
mov dword [edi], 0
mov edx, dword [esi]
push edx
call sym.postgres.exe_pfree
add dword [ebp - 4], ebx
mov edi, dword [ebp - 4]
add esp, 0x1c
sub dword [ebp - 8], ebx
mov ebx, dword [ebp - 8]
jmp 0x58895f
mov ecx, dword [ebp - 0xc]
movzx edx, word [ebp - 0x1e]
push ecx
push edx
push eax
call sym.postgres.exe_write_syslogger_file
add dword [ebp - 4], ebx
mov edi, dword [ebp - 4]
add esp, 0xc
sub dword [ebp - 8], ebx
mov ebx, dword [ebp - 8]
jmp 0x58895f
test edi, edi
je 0x5888b5
movzx ecx, word [ebp - 0x1e]
push ecx
add eax, 9
push eax
add edi, 4
push edi
call sym.postgres.exe_appendBinaryStringInfo
add dword [ebp - 4], ebx
mov edi, dword [ebp - 4]
add esp, 0xc
sub dword [ebp - 8], ebx
mov ebx, dword [ebp - 8]
jmp 0x58895f
test esi, esi
jne 0x5888db
mov edx, dword [sym.postgres.exe_CurrentMemoryContext]
push 0x14
push edx
call sym.postgres.exe_MemoryContextAlloc
mov esi, eax
mov eax, dword [ebp - 0x10]
push esi
push eax
call sym.postgres.exe_lappend
mov ecx, dword [ebp - 0x14]
add esp, 0x10
mov dword [ecx], eax
mov edx, dword [ebp - 0x1c]
mov dword [esi], edx
add esi, 4
push esi
call sym.postgres.exe_initStringInfo
movzx eax, word [ebp - 0x1e]
mov ecx, dword [ebp - 4]
push eax
add ecx, 9
push ecx
push esi
call sym.postgres.exe_appendBinaryStringInfo
add dword [ebp - 4], ebx
mov edi, dword [ebp - 4]
add esp, 0x10
sub dword [ebp - 8], ebx
mov ebx, dword [ebp - 8]
jmp 0x58895f
mov esi, 1
cmp ebx, esi
jle 0x588920
cmp byte [esi + edi], 0
je 0x588920
inc esi
cmp esi, ebx
jl 0x588915
mov edx, dword [0x836da0]
push edx
push esi
push 1
push edi
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
cmp eax, esi
je 0x588955
call dword [sym.imp.MSVCR100.dll__errno]
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCR100.dll_strerror]
push eax
push str.could_not_write_to_log_file:__s_n
call sym.postgres.exe_write_stderr
add esp, 0xc
add edi, esi
sub ebx, esi
mov dword [ebp - 4], edi
mov dword [ebp - 8], ebx
cmp ebx, 0xc
jge 0x588740
jmp 0x588970
mov edi, dword [ebp - 4]
mov ebx, dword [ebp - 8]
mov esi, dword [ebp + 0xc]
test ebx, ebx
jle 0x58898a
mov eax, dword [ebp + 8]
cmp edi, eax
je 0x58898a
push ebx
push edi
push eax
call dword [sym.imp.MSVCR100.dll_memmove]
add esp, 0xc
pop edi
mov dword [esi], ebx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret