joyce8/EMBER2024-capa huggingface dataset:
Function at 0x5a09c0
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
mov edi, eax
push 0
call fcn.005a04a0
add esp, 4
test al, al
je 0x5a0b76
cmp dword [ebp + 8], 0
mov eax, dword [sym.postgres.exe_error_context_stack]
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x20], 0x5a0780
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x24], eax
mov dword [sym.postgres.exe_error_context_stack], ecx
jne 0x5a0a20
mov edx, dword [edi]
mov ecx, dword [edi + 4]
push 0xffffffffffffffff
sub esp, 0xc
mov eax, esp
mov dword [eax], edx
mov edx, dword [edi + 8]
mov dword [eax + 4], ecx
mov dword [eax + 8], edx
call sym.postgres.exe_smgropen
add esp, 0x10
mov dword [ebp + 8], eax
mov eax, dword [edi + 0x24]
mov ecx, dword [sym.postgres.exe_BufferBlocks]
shl eax, 0xd
mov edx, dword [eax + ecx + 4]
mov eax, dword [eax + ecx]
push edx
push eax
call sym.postgres.exe_XLogFlush
add esp, 8
push 0
push 1
lea esi, [edi + 0x20]
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
test eax, eax
je 0x5a0a62
push 0x78e
push str.src_backend_storage_buffer_bufmgr.c
push esi
call sym.postgres.exe_s_lock
add esp, 0xc
movzx ecx, word [edi + 0x14]
mov ebx, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
and ecx, 0xffffffdf
mov word [edi + 0x14], cx
mov dword [esi], 0
cmp byte [sym.postgres.exe_track_io_timing], 0
je 0x5a0a88
lea edx, [ebp - 0x10]
push edx
call ebx
mov eax, dword [edi + 0x24]
mov ecx, dword [edi + 0x10]
mov edx, dword [edi + 0xc]
shl eax, 0xd
add eax, dword [sym.postgres.exe_BufferBlocks]
push 0
push eax
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
call sym.postgres.exe_smgrwrite
add esp, 0x14
cmp byte [sym.postgres.exe_track_io_timing], 0
je 0x5a0b01
lea ecx, [ebp - 8]
push ecx
call ebx
mov edx, dword [ebp - 0x10]
sub dword [ebp - 8], edx
mov eax, dword [ebp - 0xc]
lea ecx, [ebp - 0x18]
sbb dword [ebp - 4], eax
push ecx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
fild qword [ebp - 8]
fmul qword [0x6cb7e8]
fild qword [ebp - 0x18]
fdivp st(1)
call fcn.006a8d46
add dword [sym.postgres.exe_pgStatBlockWriteTime], eax
mov eax, dword [ebp - 4]
adc dword [0x8363bc], edx
mov edx, dword [ebp - 8]
add dword [0x869310], edx
adc dword [0x869314], eax
inc dword [0x8692ec]
push 0
push 1
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
test eax, eax
je 0x5a0b29
push 0xb1d
push str.src_backend_storage_buffer_bufmgr.c
push esi
call sym.postgres.exe_s_lock
add esp, 0xc
movzx ecx, word [edi + 0x14]
and ecx, 0xffffffe7
mov word [edi + 0x14], cx
mov dx, word [edi + 0x14]
test dl, 0x20
jne 0x5a0b4a
movzx eax, word [edi + 0x14]
and eax, 0xffffff7e
mov word [edi + 0x14], ax
mov cx, word [edi + 0x14]
mov word [edi + 0x14], cx
mov dword [esi], 0
mov edx, dword [edi + 0x2c]
push edx
mov dword [0x836f08], 0
call sym.postgres.exe_LWLockRelease
mov eax, dword [ebp - 0x24]
add esp, 4
mov dword [sym.postgres.exe_error_context_stack], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x5a5740
Capabilities:
Create directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x804
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
cmp eax, 0x67f
je 0x5a578a
cmp eax, 0x680
je 0x5a578a
push str.pgsql_tmp
push str.PG_9.2_201204301
push eax
push str.pg_tblspc__u__s__s
lea eax, [ebp - 0x404]
push 0x400
push eax
call sym.postgres.exe_pg_snprintf
add esp, 0x18
jmp 0x5a57a8
push str.pgsql_tmp
push str.base__s
lea ecx, [ebp - 0x404]
push 0x400
push ecx
call sym.postgres.exe_pg_snprintf
add esp, 0x10
mov eax, dword [0x8370ec]
mov edx, dword [sym.postgres.exe_MyProcPid]
push eax
push edx
inc eax
push str.pgsql_tmp
mov dword [0x8370ec], eax
lea eax, [ebp - 0x404]
push eax
push str._s__s_d._ld
lea ecx, [ebp - 0x804]
push 0x400
push ecx
call sym.postgres.exe_pg_snprintf
push 0x180
lea edx, [ebp - 0x804]
push 0x8302
push edx
call sym.postgres.exe_PathNameOpenFile
add esp, 0x28
test eax, eax
jg 0x5a585a
lea eax, [ebp - 0x404]
push esi
push eax
call dword [sym.imp.MSVCR100.dll__mkdir]
push 0x180
lea ecx, [ebp - 0x804]
push 0x8302
push ecx
call sym.postgres.exe_PathNameOpenFile
mov esi, eax
add esp, 0x10
test esi, esi
jg 0x5a5857
cmp byte [ebp + 0xc], 0
je 0x5a5857
push str.OpenTemporaryFileInTablespace
push 0x409
push str.src_backend_storage_file_fd.c
call sym.postgres.exe_elog_start
lea edx, [ebp - 0x804]
push edx
push str.could_not_create_temporary_file___s_:__m
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x18
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret

Function at 0x5a5870
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, dword [ebp + 8]
mov eax, edi
call fcn.005a54f0
test eax, eax
js 0x5a58fa
push ebx
imul edi, edi, 0x2c
mov ebx, dword [sym.imp.MSVCR100.dll__errno]
push esi
lea ecx, [ecx]
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
mov edx, dword [0x836f48]
push eax
mov eax, dword [edi + edx]
push ecx
push eax
call dword [sym.imp.MSVCR100.dll__read]
mov esi, eax
add esp, 0xc
test esi, esi
jns 0x5a58fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x5aa
je 0x5a58c9
push eax
call sym.postgres.exe__dosmaperr
add esp, 4
jmp 0x5a58de
push 0x3e8
call sym.postgres.exe_pg_usleep
add esp, 4
call ebx
mov dword [eax], 0x2714
call ebx
cmp dword [eax], 0x2714
je 0x5a5890
mov ecx, dword [0x836f48]
mov eax, esi
pop esi
mov dword [edi + ecx + 0x18], 0xffffffff
pop ebx
pop edi
pop ebp
ret
mov eax, dword [0x836f48]
add dword [edi + eax + 0x18], esi
mov eax, esi
pop esi
pop ebx
pop edi
pop ebp
ret

Function at 0x5a7fe0
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push esi
mov esi, dword [ebp + 8]
call fcn.005a7e00
push 0x73a2c0
push 0x87
push str.src_backend_storageipcipc.c
call sym.postgres.exe_elog_start
push esi
push str.exit__d_
push 0xc
call sym.postgres.exe_elog_finish
add esp, 0x18
push esi
call dword [sym.imp.MSVCR100.dll_exit]
int3
Function at 0x5ad2a0
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [0x8374c4], 0
je 0x5ad2c6
cmp dword [0x8374c8], 0
jne 0x5ad35a
mov eax, dword [sym.postgres.exe_CurrentResourceOwner]
mov ecx, dword [sym.postgres.exe_PG_exception_stack]
mov edx, dword [sym.postgres.exe_error_context_stack]
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x44]
push 0
push eax
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x48], edx
call sub.MSVCR100.dll__setjmp3
add esp, 8
test eax, eax
jne 0x5ad368
mov edx, dword [sym.postgres.exe_TopTransactionResourceOwner]
lea ecx, [ebp - 0x44]
mov dword [sym.postgres.exe_PG_exception_stack], ecx
mov dword [sym.postgres.exe_CurrentResourceOwner], edx
cmp dword [0x8374c4], eax
jne 0x5ad323
push 3
push 0xa35
call sym.postgres.exe_heap_open
add esp, 8
mov dword [0x8374c4], eax
cmp dword [0x8374c8], 0
jne 0x5ad340
push 3
push 0xa7b
call sym.postgres.exe_index_open
add esp, 8
mov dword [0x8374c8], eax
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov dword [sym.postgres.exe_PG_exception_stack], eax
mov dword [sym.postgres.exe_error_context_stack], ecx
mov dword [sym.postgres.exe_CurrentResourceOwner], edx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov dword [sym.postgres.exe_PG_exception_stack], eax
mov dword [sym.postgres.exe_error_context_stack], ecx
mov dword [sym.postgres.exe_CurrentResourceOwner], edx
call sym.postgres.exe_pg_re_throw
push 1
call dword [sym.imp.MSVCR100.dll_exit]
int3
Function at 0x5ad390
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [0x8374c4], 0
jne 0x5ad3b6
cmp dword [0x8374c8], 0
je 0x5ad457
cmp byte [ebp + 8], 0
je 0x5ad443
mov eax, dword [sym.postgres.exe_CurrentResourceOwner]
mov ecx, dword [sym.postgres.exe_PG_exception_stack]
mov edx, dword [sym.postgres.exe_error_context_stack]
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x44]
push 0
push eax
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x48], edx
call sub.MSVCR100.dll__setjmp3
add esp, 8
test eax, eax
jne 0x5ad465
mov eax, dword [0x8374c8]
mov edx, dword [sym.postgres.exe_TopTransactionResourceOwner]
lea ecx, [ebp - 0x44]
mov dword [sym.postgres.exe_PG_exception_stack], ecx
mov dword [sym.postgres.exe_CurrentResourceOwner], edx
test eax, eax
je 0x5ad415
push 0
push eax
call sym.postgres.exe_index_close
add esp, 8
mov eax, dword [0x8374c4]
test eax, eax
je 0x5ad429
push 0
push eax
call sym.postgres.exe_relation_close
add esp, 8
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov dword [sym.postgres.exe_PG_exception_stack], eax
mov dword [sym.postgres.exe_error_context_stack], ecx
mov dword [sym.postgres.exe_CurrentResourceOwner], edx
mov dword [0x8374c4], 0
mov dword [0x8374c8], 0
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov dword [sym.postgres.exe_PG_exception_stack], eax
mov dword [sym.postgres.exe_error_context_stack], ecx
mov dword [sym.postgres.exe_CurrentResourceOwner], edx
call sym.postgres.exe_pg_re_throw
push 1
call dword [sym.imp.MSVCR100.dll_exit]
int3
Function at 0x5b06a0
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [sym.postgres.exe_update_process_title], 0
push esi
mov esi, dword [ebp + 8]
movzx eax, byte [esi + 0xf]
movzx ecx, ax
mov edx, dword [ecx*4 + 0x73b41c]
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], edx
mov dword [ebp - 0x48], 0
je 0x5b0748
lea eax, [ebp - 0x4c]
push eax
call sym.postgres.exe_get_ps_display
mov ecx, dword [ebp - 0x4c]
mov edx, dword [sym.postgres.exe_CurrentMemoryContext]
add ecx, 9
push ecx
mov esi, eax
push edx
mov dword [ebp - 0x64], esi
call sym.postgres.exe_MemoryContextAlloc
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x48]
push eax
push esi
push ecx
call sub.MSVCR100.dll_memcpy
mov eax, dword [ebp - 0x48]
add eax, dword [ebp - 0x4c]
mov edx, dword [str._waiting]
mov dword [eax], edx
mov ecx, dword [0x73ab44]
mov dword [eax + 4], ecx
mov dl, byte [0x73ab48]
mov byte [eax + 8], dl
mov eax, dword [ebp - 0x48]
push 0
push eax
call sym.postgres.exe_set_ps_display
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov esi, dword [ebp - 0x54]
add esp, 0x20
mov byte [ecx + edx], 0
push 1
call sym.postgres.exe_pgstat_report_waiting
mov eax, dword [ebp + 0xc]
mov ecx, dword [sym.postgres.exe_PG_exception_stack]
mov edx, dword [sym.postgres.exe_error_context_stack]
mov dword [0x837528], eax
lea eax, [ebp - 0x44]
push 0
push eax
mov dword [0x837518], esi
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x50], edx
call sub.MSVCR100.dll__setjmp3
add esp, 0xc
test eax, eax
jne 0x5b0818
mov edx, dword [ebp - 0x5c]
mov esi, dword [ebp - 0x54]
push edx
lea ecx, [ebp - 0x44]
push esi
mov dword [sym.postgres.exe_PG_exception_stack], ecx
call sym.postgres.exe_ProcSleep
add esp, 8
test eax, eax
je 0x5b07c3
mov eax, dword [esi + 0x1c]
and eax, 0xf
add eax, 0x31
push eax
mov dword [0x837518], 0
call sym.postgres.exe_LWLockRelease
add esp, 4
call sym.postgres.exe_DeadLockReport
mov ecx, dword [ebp - 0x58]
mov edx, dword [ebp - 0x50]
push 0
mov dword [sym.postgres.exe_PG_exception_stack], ecx
mov dword [sym.postgres.exe_error_context_stack], edx
mov dword [0x837518], 0
call sym.postgres.exe_pgstat_report_waiting
add esp, 4
cmp byte [sym.postgres.exe_update_process_title], 0
je 0x5b0809
mov eax, dword [ebp - 0x48]
push 0
push eax
call sym.postgres.exe_set_ps_display
mov ecx, dword [ebp - 0x48]
push ecx
call sym.postgres.exe_pfree
add esp, 0xc
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x58]
mov eax, dword [ebp - 0x50]
push 0
mov dword [sym.postgres.exe_PG_exception_stack], edx
mov dword [sym.postgres.exe_error_context_stack], eax
call sym.postgres.exe_pgstat_report_waiting
add esp, 4
cmp byte [sym.postgres.exe_update_process_title], 0
je 0x5b0853
mov ecx, dword [ebp - 0x48]
push 0
push ecx
call sym.postgres.exe_set_ps_display
mov edx, dword [ebp - 0x48]
push edx
call sym.postgres.exe_pfree
add esp, 0xc
call sym.postgres.exe_pg_re_throw
push 1
call dword [sym.imp.MSVCR100.dll_exit]
int3
Function at 0x5b5460
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
mov ebx, dword [ebp + 8]
push esi
lea eax, [ebx + 0x14]
push 8
push eax
push eax
call sym.postgres.exe_SHMQueueNext
push 0
push 0x1c
mov esi, eax
call sym.postgres.exe_LWLockAcquire
add esp, 0x14
test esi, esi
je 0x5b54d1
push edi
push 8
lea edi, [esi + 8]
lea eax, [ebx + 0x14]
push edi
push eax
call sym.postgres.exe_SHMQueueNext
mov ebx, eax
lea eax, [esi + 0x10]
push eax
call sym.postgres.exe_SHMQueueDelete
push edi
call sym.postgres.exe_SHMQueueDelete
mov edx, dword [esi + 4]
mov eax, dword [0x837748]
lea ecx, [ebp - 1]
push ecx
shl edx, 4
xor edx, dword [ebp + 0xc]
push 2
push edx
push esi
push eax
call sym.postgres.exe_hash_search_with_hash_value
add esp, 0x28
mov esi, ebx
test ebx, ebx
mov ebx, dword [ebp + 8]
jne 0x5b5488
pop edi
push 0x1c
call sym.postgres.exe_LWLockRelease
lea eax, [ebx + 0x14]
push eax
call sym.postgres.exe_SHMQueueEmpty
add esp, 8
test al, al
je 0x5b5500
mov ecx, dword [ebp + 0xc]
mov edx, dword [0x837740]
push 0
push 2
push ecx
push ebx
push edx
call sym.postgres.exe_hash_search_with_hash_value
add esp, 0x14
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x5befe0
Capabilities:
Terminate process

Disassembly:
mov eax, dword [0x86928c]
or eax, 4
push eax
mov dword [0x86928c], eax
call sym.postgres.exe_pqsigsetmask
add esp, 4
cmp byte [sym.postgres.exe_ClientAuthInProgress], 0
je 0x5bf012
cmp dword [sym.postgres.exe_whereToSendOutput], 2
jne 0x5bf012
mov dword [sym.postgres.exe_whereToSendOutput], 0
push 0
push 0x73d478
push 0x9f2
push str.src_backend_tcoppostgres.c
push 0x13
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5bf071
push str.In_a_moment_you_should_be_able_to_reconnect_to_the_database_and_repeat_your_command.
call sym.postgres.exe_errhint
add esp, 4
push eax
push str.The_postmaster_has_commanded_this_server_process_to_roll_back_the_current_transaction_and_exit__because_another_server_process_exited_abnormally_and_possibly_corrupted_shared_memory.
call sym.postgres.exe_errdetail
add esp, 4
push eax
push str.terminating_connection_because_of_crash_of_another_server_process
call sym.postgres.exe_errmsg
add esp, 4
push eax
push 0x20201c5
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 0x10
call sym.postgres.exe_on_exit_reset
push 2
call dword [sym.imp.MSVCR100.dll_exit]
int3
Function at 0x5df0d0
Capabilities:
Enumerate pe sections

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 8]
pop ebp
jmp fcn.005db920
Function at 0x613160
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x10]
cdq
and edx, 7
add eax, edx
mov edx, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
sar eax, 3
push edi
mov edi, eax
cmp eax, 4
jb 0x613194
nop
mov ecx, dword [esi]
cmp ecx, dword [edx]
jne 0x613198
sub edi, 4
add edx, 4
add esi, 4
cmp edi, 4
jae 0x613180
test edi, edi
je 0x6131db
movzx ebx, byte [edx]
movzx ecx, byte [esi]
sub ecx, ebx
jne 0x6131d3
cmp edi, 1
jbe 0x6131db
movzx ecx, byte [esi + 1]
movzx ebx, byte [edx + 1]
sub ecx, ebx
jne 0x6131d3
cmp edi, 2
jbe 0x6131db
movzx ecx, byte [esi + 2]
movzx ebx, byte [edx + 2]
sub ecx, ebx
jne 0x6131d3
cmp edi, 3
jbe 0x6131db
movzx ecx, byte [esi + 3]
movzx edx, byte [edx + 3]
sub ecx, edx
sar ecx, 0x1f
or ecx, 1
jmp 0x6131dd
xor ecx, ecx
test ecx, ecx
jne 0x613231
mov esi, dword [ebp + 0x10]
and esi, reloc.WSOCK32.dll_getsockopt
jns 0x6131f1
dec esi
or esi, 0xfffffff8
inc esi
je 0x613231
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
movzx ecx, byte [eax + ecx]
movzx edx, byte [eax + edx]
mov eax, esi
test eax, eax
jle 0x613216
mov bl, dl
xor bl, cl
js 0x61321d
dec eax
add ecx, ecx
add edx, edx
test eax, eax
jg 0x613207
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret
mov eax, 0
test cl, 0x80
setne al
pop edi
pop esi
pop ebx
lea eax, [eax + eax - 1]
pop ebp
ret
pop edi
pop esi
mov eax, ecx
pop ebx
pop ebp
ret

Function at 0x61eaf0
Capabilities:
Get geographical location

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, ecx
push esi
push str.cbSG
call sym.postgres.exe_pg_strcasecmp
add esp, 8
test eax, eax
je 0x61ebd4
push esi
push str.posix
call sym.postgres.exe_pg_strcasecmp
add esp, 8
test eax, eax
je 0x61ebd4
push esi
push 2
call dword [sym.imp.MSVCR100.dll__create_locale]
add esp, 8
test eax, eax
je 0x61ebc3
mov ecx, dword [eax]
mov esi, dword [ecx + 0x14]
test esi, esi
jne 0x61eb51
mov esi, 0x409
push edi
push eax
call dword [sym.imp.MSVCR100.dll__free_locale]
mov edi, dword [sym.imp.KERNEL32.dll_GetLocaleInfoA]
add esp, 4
push 0x20
lea edx, [ebp - 0x44]
push edx
push 0x59
push esi
call edi
test eax, eax
je 0x61eb80
push 0x20
lea eax, [ebp - 0x24]
push eax
push 0x5a
push esi
call edi
test eax, eax
jne 0x61eb92
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x24]
push ecx
lea edx, [ebp - 0x44]
push edx
push 0x749484
push 0x1f
push 0x845984
call sym.postgres.exe_pg_snprintf
add esp, 0x14
pop edi
mov eax, 0x845984
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 0x43
mov word [0x845984], ax
xor ecx, ebp
mov eax, 0x845984
pop esi
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
Function at 0x637d30
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
lea eax, [ebp - 0x24]
sub esp, 0x24
push eax
call sym.postgres.exe_initStringInfo
add esp, 4
call sym.postgres.exe_SPI_connect
cmp eax, 1
je 0x637d6f
push str.pg_get_viewdef_worker
push 0x1cd
push str.src_backendutils_adt_ruleutils.c
call sym.postgres.exe_elog_start
push str.SPI_connect_failed
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
mov eax, dword [0x85e070]
test eax, eax
jne 0x637ddc
mov edx, dword [str.SELECT__FROM_pg_catalog.pg_rewrite_WHERE_ev_class___1_AND_rulename___2]
push esi
lea ecx, [ebp - 0xc]
push ecx
push 2
push edx
mov dword [ebp - 0xc], 0x1a
mov dword [ebp - 8], 0x13
call sym.postgres.exe_SPI_prepare
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x637dcb
push str.pg_get_viewdef_worker
push 0x1dd
push str.src_backendutils_adt_ruleutils.c
call sym.postgres.exe_elog_start
mov eax, dword [str.SELECT__FROM_pg_catalog.pg_rewrite_WHERE_ev_class___1_AND_rulename___2]
push eax
push str.SPI_prepare_failed_for___s_
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x18
push esi
call sym.postgres.exe_SPI_keepplan
mov eax, esi
add esp, 4
mov dword [0x85e070], eax
pop esi
push 2
push 1
lea ecx, [ebp - 4]
push ecx
lea edx, [ebp - 0x14]
push edx
push eax
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], str._RETURN
mov word [ebp - 4], 0x2020
call sym.postgres.exe_SPI_execute_plan
add esp, 0x14
cmp eax, 5
je 0x637e2a
push str.pg_get_viewdef_worker
push 0x1eb
push str.src_backendutils_adt_ruleutils.c
call sym.postgres.exe_elog_start
push edi
push str.failed_to_get_pg_rewrite_tuple_for_view__u
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x18
cmp dword [sym.postgres.exe_SPI_processed], 1
je 0x637e46
lea eax, [ebp - 0x24]
push str.Not_a_view
push eax
call sym.postgres.exe_appendStringInfo
add esp, 8
jmp 0x637e67
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
mov eax, dword [sym.postgres.exe_SPI_tuptable]
push ecx
mov ecx, dword [eax + 0x10]
mov eax, dword [eax + 0xc]
mov ecx, dword [ecx]
push edx
lea edx, [ebp - 0x24]
push edx
call fcn.006369c0
add esp, 0xc
call sym.postgres.exe_SPI_finish
cmp eax, 2
je 0x637e94
push str.pg_get_viewdef_worker
push 0x1fc
push str.src_backendutils_adt_ruleutils.c
call sym.postgres.exe_elog_start
push str.SPI_finish_failed
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
mov eax, dword [ebp - 0x24]
mov esp, ebp
pop ebp
ret
Function at 0x638950
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
lea eax, [ebp - 0x1c]
sub esp, 0x1c
push eax
call sym.postgres.exe_initStringInfo
add esp, 4
call sym.postgres.exe_SPI_connect
cmp eax, 1
je 0x63898f
push str.pg_get_ruledef_worker
push 0x138
push str.src_backendutils_adt_ruleutils.c
call sym.postgres.exe_elog_start
push str.SPI_connect_failed
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
push esi
mov esi, dword [0x85e06c]
test esi, esi
jne 0x6389f4
mov edx, dword [str.SELECT__FROM_pg_catalog.pg_rewrite_WHERE_oid___1]
lea ecx, [ebp - 8]
push ecx
push 1
push edx
mov dword [ebp - 8], 0x1a
call sym.postgres.exe_SPI_prepare
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x6389e5
push str.pg_get_ruledef_worker
push 0x147
push str.src_backendutils_adt_ruleutils.c
call sym.postgres.exe_elog_start
mov eax, dword [str.SELECT__FROM_pg_catalog.pg_rewrite_WHERE_oid___1]
push eax
push str.SPI_prepare_failed_for___s_
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x18
push esi
call sym.postgres.exe_SPI_keepplan
add esp, 4
mov dword [0x85e06c], esi
push 1
push 1
lea ecx, [ebp - 1]
push ecx
lea edx, [ebp - 0xc]
push edx
push esi
mov dword [ebp - 0xc], edi
mov byte [ebp - 1], 0x20
call sym.postgres.exe_SPI_execute_plan
add esp, 0x14
pop esi
cmp eax, 5
je 0x638a3a
push str.pg_get_ruledef_worker
push 0x153
push str.src_backendutils_adt_ruleutils.c
call sym.postgres.exe_elog_start
push edi
push str.failed_to_get_pg_rewrite_tuple_for_rule__u
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x18
cmp dword [sym.postgres.exe_SPI_processed], 1
je 0x638a56
lea eax, [ebp - 0x1c]
push 0x6c3240
push eax
call sym.postgres.exe_appendStringInfo
add esp, 8
jmp 0x638a74
mov eax, dword [sym.postgres.exe_SPI_tuptable]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0x10]
mov eax, dword [eax + 0xc]
push ebx
push ecx
mov ecx, dword [edx]
lea ebx, [ebp - 0x1c]
call fcn.00638560
add esp, 4
pop ebx
call sym.postgres.exe_SPI_finish
cmp eax, 2
je 0x638aa1
push str.pg_get_ruledef_worker
push 0x164
push str.src_backendutils_adt_ruleutils.c
call sym.postgres.exe_elog_start
push str.SPI_finish_failed
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
mov eax, dword [ebp - 0x1c]
mov esp, ebp
pop ebp
ret