Function at 0x4b8980
Capabilities:
Delete directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [sym.postgres.exe_CurrentMemoryContext]
push ebx
push esi
push edi
push 0x25
push eax
call sym.postgres.exe_MemoryContextAlloc
mov ecx, dword [ebp + 8]
push str.PG_9.2_201204301
push ecx
mov ebx, eax
push str.pg_tblspc__u__s
push ebx
call sym.postgres.exe_pg_sprintf
push ebx
call sym.postgres.exe_AllocateDir
mov esi, eax
add esp, 0x1c
mov dword [ebp - 0x2c], esi
test esi, esi
jne 0x4b8b04
call dword [sym.imp.MSVCR100.dll__errno]
cmp dword [eax], 2
jne 0x4b8aa6
cmp byte [ebp + 0xc], 0
jne 0x4b8a1c
push esi
push str.destroy_tablespace_directories
push 0x2b7
push str.src_backendcommands_tablespace.c
push 0x13
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4b8a1c
push ebx
push str.could_not_open_directory___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]
push ebx
push ecx
call sym.postgres.exe_MemoryContextStrdup
mov esi, eax
push esi
call sym.postgres.exe_get_parent_directory
lea edx, [ebp - 0x28]
push edx
push esi
call sym.postgres.exe_pgwin32_safestat
add esp, 0x14
test eax, eax
jne 0x4b8cf5
mov eax, dword [ebp - 0x22]
and eax, 0xf000
cmp eax, 0x4000
jne 0x4b8cf5
push esi
call dword [sym.imp.MSVCR100.dll__rmdir]
add esp, 4
test eax, eax
jns 0x4b8d5b
movsx ecx, byte [ebp + 0xc]
push 0
neg ecx
push str.destroy_tablespace_directories
sbb ecx, ecx
push 0x304
and ecx, 0xfffffffb
add ecx, 0x14
push str.src_backendcommands_tablespace.c
push ecx
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4b8d5b
push esi
push str.could_not_remove_directory___s_:__m
jmp 0x4b8d44
cmp byte [ebp + 0xc], 0
je 0x4b8b04
push 0
push str.destroy_tablespace_directories
push 0x2c1
push str.src_backendcommands_tablespace.c
push 0xf
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4b8ae8
push ebx
push str.could_not_open_directory___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
push ebx
call sym.postgres.exe_pfree
add esp, 4
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
push ebx
push esi
call sym.postgres.exe_ReadDir
add esp, 8
test eax, eax
je 0x4b8c4d
lea edi, [eax + 8]
mov ecx, 0x6c0144
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4b8b40
test dl, dl
je 0x4b8b3c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4b8b40
add eax, 2
add ecx, 2
test dl, dl
jne 0x4b8b20
xor eax, eax
jmp 0x4b8b45
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4b8c3b
mov ecx, 0x6c0140
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4b8b74
test dl, dl
je 0x4b8b70
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4b8b74
add eax, 2
add ecx, 2
test dl, dl
jne 0x4b8b54
xor eax, eax
jmp 0x4b8b79
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4b8c3b
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4b8b86
sub eax, edx
mov ecx, eax
mov eax, edi
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4b8b96
sub eax, esi
lea edx, [eax + ecx + 2]
mov eax, dword [sym.postgres.exe_CurrentMemoryContext]
push edx
push eax
call sym.postgres.exe_MemoryContextAlloc
push edi
push ebx
mov esi, eax
push 0x6b04b0
push esi
call sym.postgres.exe_pg_sprintf
add esp, 0x18
cmp byte [ebp + 0xc], 0
jne 0x4b8bd8
push esi
call sym.postgres.exe_directory_is_empty
add esp, 4
test al, al
je 0x4b8cca
push esi
call dword [sym.imp.MSVCR100.dll__rmdir]
add esp, 4
test eax, eax
jns 0x4b8c2f
movsx ecx, byte [ebp + 0xc]
push 0
neg ecx
push str.destroy_tablespace_directories
sbb ecx, ecx
push 0x2df
and ecx, 0xfffffffb
add ecx, 0x14
push str.src_backendcommands_tablespace.c
push ecx
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4b8c2f
push esi
push str.could_not_remove_directory___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
push esi
call sym.postgres.exe_pfree
mov esi, dword [ebp - 0x2c]
add esp, 4
push ebx
push esi
call sym.postgres.exe_ReadDir
add esp, 8
test eax, eax
jne 0x4b8b16
push esi
call sym.postgres.exe_FreeDir
push ebx
call dword [sym.imp.MSVCR100.dll__rmdir]
add esp, 8
test eax, eax
jns 0x4b8a1c
movsx eax, byte [ebp + 0xc]
push 0
neg eax
push str.destroy_tablespace_directories
sbb eax, eax
push 0x2ec
and eax, 0xfffffffb
add eax, 0x14
push str.src_backendcommands_tablespace.c
push eax
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4b8cae
push ebx
push str.could_not_remove_directory___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
push ebx
call sym.postgres.exe_pfree
add esp, 4
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x2c]
push edx
call sym.postgres.exe_FreeDir
push esi
call sym.postgres.exe_pfree
push ebx
call sym.postgres.exe_pfree
add esp, 0xc
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
push esi
call sym.postgres.exe_pgunlink
add esp, 4
test eax, eax
jns 0x4b8d5b
cmp byte [ebp + 0xc], 0
je 0x4b8d0f
mov eax, 0xf
jmp 0x4b8d20
call dword [sym.imp.MSVCR100.dll__errno]
xor edx, edx
cmp dword [eax], 2
setne dl
lea eax, [edx + 0x13]
push 0
push str.destroy_tablespace_directories
push 0x30c
push str.src_backendcommands_tablespace.c
push eax
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4b8d5b
push esi
push str.could_not_remove_symbolic_link___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
push ebx
call sym.postgres.exe_pfree
push esi
call sym.postgres.exe_pfree
mov ecx, dword [ebp - 4]
add esp, 8
pop edi
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret