Function at 0x48acf0
Capabilities:
Reference sql statements

Disassembly:
sub esp, 0x3c8
mov eax, dword [0x65ada4]
xor eax, esp
mov dword [esp + 0x3c4], eax
push ebx
push ebp
mov ebp, dword [esp + 0x3d4]
push esi
xor eax, eax
push edi
mov edi, dword [sym.imp.MSVCR90.dll_sprintf]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
lea eax, [esp + 0x48]
push str.SELECT_s.rkey_owner_grantee_use_priv
push eax
call edi
lea esi, [esp + eax + 0x50]
mov eax, dword [ebp + 0x1a]
add esp, 8
cmp eax, 0x8b
je 0x48ad43
cmp eax, 0x8c
jne 0x48ad50
push str._sm.mkey_resulttype
push esi
call edi
add esp, 8
add esi, eax
push str._FROM____sysexternal__s
push esi
call edi
add esi, eax
mov eax, dword [ebp + 0x1a]
add esp, 8
cmp eax, 0x89
je 0x48ad7b
cmp eax, 0x8a
je 0x48ad7b
push str._INNER_JOIN____sysexternalmethod__sm_ON_s.rkeysm.rkey
push esi
call edi
add esp, 8
add esi, eax
push str._LEFT_JOIN____sysexternalpriv__sp_ON_s.rkeysp.rkey_AND__grantee__OR_grantee0_
push esi
call edi
add esi, eax
mov eax, dword [ebp + 0x1a]
add esp, 8
cmp eax, 0x89
je 0x48ada0
cmp eax, 0x8a
je 0x48ada0
push str._AND_sm.mkeysp.mkey
jmp 0x48ada5
push str._AND_sp.mkey_IS_NULL
push esi
call edi
add esp, 8
add esi, eax
push str._AND_use_privG_WHERE
push esi
call edi
mov ecx, dword [str.public]
add esi, eax
mov eax, dword [ebp + 0x1a]
add ecx, 0x120
add esp, 8
lea ebx, [ebp + 0x18394]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], ebx
cmp eax, 0x89
je 0x48ae4d
cmp eax, 0x8a
je 0x48ae4d
push str.sqlname__AND_LOWER_sqlsig_LOWER___CAST_CHAR___
push esi
call edi
lea eax, [esp + 0x24]
push eax
push 3
lea edx, [ebp + 0x1849c]
lea ecx, [esp + 0x24]
push ecx
mov dword [esp + 0x38], edx
lea edx, [esp + 0x24]
push edx
push fcn.00472210
lea eax, [esp + 0x64]
push 0
push eax
call fcn.0050dfb0
mov esi, eax
add esp, 0x24
test esi, esi
je 0x48aead
push 0x7dd
push 0
call fcn.00406f10
mov eax, dword [esp + 0x18]
add esp, 8
test eax, eax
je 0x48ae46
push eax
call fcn.0050dec0
add esp, 4
mov eax, esi
jmp 0x48b30a
cmp byte [ebp + 0x184f7], 0
jne 0x48ae73
cmp byte [ebp + 0x184f8], 0
jne 0x48ae73
push str.s.rkey_
push esi
call edi
lea ecx, [ebp + 0x184f3]
mov dword [esp + 0x28], ecx
jmp 0x48ae7b
push str.rname_
push esi
call edi
add esp, 8
lea edx, [esp + 0x1c]
push edx
push 2
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x1c]
push ecx
push fcn.00472210
lea edx, [esp + 0x5c]
push 0
push edx
call fcn.0050dfb0
mov esi, eax
add esp, 0x1c
test esi, esi
jne 0x48ae26
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x48af16
mov eax, dword [esp + 0x10]
push eax
call fcn.0050dec0
add esp, 4
test eax, eax
jne 0x48ae26
mov eax, dword [ebp + 0x1a]
cmp eax, 0x89
je 0x48aef4
cmp eax, 0x8a
je 0x48aef4
xor ecx, ecx
cmp byte [ebp + 0x184f7], 1
setne cl
add ecx, 0x40d9
mov esi, ecx
jmp 0x48af8e
push 0x5a8a1a
push ebx
push 0x7dd
push 0x40db
call fcn.00406f10
add esp, 0x10
mov eax, 0x40db
jmp 0x48b30a
mov ecx, dword [ebp + 0x1a]
cmp ecx, 0x8b
je 0x48af36
cmp ecx, 0x8c
je 0x48af36
mov dword [esp + 0x24], 0
jmp 0x48afdc
cmp byte [ebp + 0x184f7], 1
movzx ecx, word [eax + 0xa]
jne 0x48af68
cmp cx, word [eax + 0xc]
jne 0x48af4d
xor edx, edx
jmp 0x48af52
movsx edx, cx
add edx, eax
cmp byte [edx], 0x56
jne 0x48afbc
mov edx, dword [esp + 0x10]
push edx
call fcn.0050dec0
mov esi, 0x40d9
jmp 0x48af8b
cmp cx, word [eax + 0xc]
jne 0x48af72
xor edx, edx
jmp 0x48af77
movsx edx, cx
add edx, eax
cmp byte [edx], 0x56
je 0x48afbc
mov eax, dword [esp + 0x10]
push eax
call fcn.0050dec0
mov esi, 0x40da
add esp, 4
lea ecx, [esp + 0x1d8]
push ecx
add ebp, 0x1849c
push ebp
call fcn.004614b0
push eax
push ebx
push 0x7dd
push esi
call fcn.00406f10
add esp, 0x18
mov eax, 0x40db
jmp 0x48b30a
movzx edx, word [eax + 8]
cmp dx, cx
jne 0x48afc9
xor ecx, ecx
jmp 0x48afce
movsx ecx, dx
add ecx, eax
mov edx, dword [ecx]
lea ecx, [esp + 0x40]
mov dword [esp + 0x40], edx
mov dword [esp + 0x24], ecx
movzx ecx, word [eax]
cmp cx, word [eax + 2]
jne 0x48afe9
xor ecx, ecx
jmp 0x48afee
movsx ecx, cx
add ecx, eax
mov edx, dword [ecx]
mov dword [esp + 0x38], edx
movzx ecx, word [eax + 2]
cmp cx, word [eax + 4]
jne 0x48b002
xor ecx, ecx
jmp 0x48b007
movsx ecx, cx
add ecx, eax
mov ecx, dword [ecx]
mov edx, dword [str.public]
cmp ecx, dword [edx + 0x120]
sete cl
mov byte [esp + 0x1b], cl
test cl, cl
jne 0x48b0a7
mov edi, 0x5acad0
lea ecx, [edx + 0x80]
nop
mov dl, byte [ecx]
cmp dl, byte [edi]
jne 0x48b050
test dl, dl
je 0x48b04c
mov dl, byte [ecx + 1]
cmp dl, byte [edi + 1]
jne 0x48b050
add ecx, 2
add edi, 2
test dl, dl
jne 0x48b030
xor ecx, ecx
jmp 0x48b055
sbb ecx, ecx
sbb ecx, 0xffffffff
test ecx, ecx
je 0x48b0a7
lea esp, [esp]
movzx edx, word [eax + 4]
movzx ecx, word [eax + 6]
cmp dx, cx
je 0x48b081
movsx edx, dx
add edx, eax
je 0x48b081
cmp cx, word [eax + 8]
je 0x48b081
movsx ecx, cx
add ecx, eax
jne 0x48b0a7
mov eax, dword [esp + 0x10]
push 0
lea edx, [esp + 0x18]
push edx
push eax
call fcn.00490540
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x48ae26
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x48b060
mov ecx, dword [esp + 0x10]
push ecx
call fcn.0050dec0
add esp, 4
test eax, eax
jne 0x48ae26
cmp dword [esp + 0x14], eax
jne 0x48b12a
mov ebp, dword [ebp + 0x1a]
cmp ebp, 0x89
je 0x48b0fa
cmp ebp, 0x8a
je 0x48b0f2
mov eax, str.grant_usage_on_external_routine
cmp ebp, 0x8b
je 0x48b0e7
mov eax, str.revoke_usage_from_external_routine
mov edx, dword [str.public]
push ebx
push eax
push edx
jmp 0x48b10e
cmp ebp, 0x89
jne 0x48b101
mov eax, str.grant_usage_on_external
jmp 0x48b106
mov eax, str.revoke_usage_from_external
push ebx
push eax
mov eax, dword [str.public]
push eax
push 0x7dd
push 0x1f69
call fcn.00406f10
add esp, 0x14
mov eax, 0x1f69
jmp 0x48b30a
cmp dword [ebp + 0x12], 0
mov dword [esp + 0x30], 0
jle 0x48b308
lea ebx, [ebp + 0x17a9f]
mov ecx, dword [ebx]
lea edx, [esp + 0x44]
push edx
lea eax, [esp + 0x20]
push eax
push 1
push 6
mov dword [esp + 0x2c], ecx
call fcn.00444330
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x48b34f
mov eax, dword [esp + 0x44]
test eax, eax
je 0x48b323
mov ecx, dword [eax + 8]
push 6
mov dword [esp + 0x40], ecx
call fcn.004432b0
mov esi, eax
add esp, 4
test esi, esi
jne 0x48b34f
mov ecx, dword [str.public]
lea edx, [esp + 0x3c]
mov dword [esp + 0x1c], edx
lea edx, [esp + 0x48]
lea eax, [esp + 0x38]
add ecx, 0x120
push str.SELECT_use_priv_FROM____sysexternalpriv__WHERE_grantee__AND_rkey__AND_mkey__AND_grantor_
lea edi, [ebp + 0x18312]
push edx
mov dword [esp + 0x28], eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edi
call dword [sym.imp.MSVCR90.dll_sprintf]
lea eax, [esp + 0x24]
push eax
push 4
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x24]
push edx
push fcn.00472210
lea eax, [esp + 0x64]
push esi
push eax
call fcn.0050dfb0
mov esi, eax
add esp, 0x24
test esi, esi
jne 0x48ae26
mov ecx, dword [esp + 0x14]
mov byte [ebp + 0x11], 1
test ecx, ecx
jne 0x48b22e
mov eax, dword [ebp + 0x1a]
cmp eax, 0x89
je 0x48b214
cmp eax, 0x8b
jne 0x48b22e
lea ecx, [esp + 0x1c]
push ecx
push 5
push 0
push fcn.00472210
push 0
push str.INSERT_INTO____sysexternalpriv__VALUES___________NULL_NULL_
jmp 0x48b2cc
mov eax, dword [ebp + 0x1a]
cmp eax, 0x8a
je 0x48b2af
cmp eax, 0x8c
je 0x48b2af
movzx eax, word [ecx]
cmp ax, word [ecx + 2]
jne 0x48b24c
xor eax, eax
jmp 0x48b24f
cwde
add eax, ecx
movzx ecx, byte [edi]
mov al, byte [eax]
mov byte [esp + 0x34], al
cmp al, cl
je 0x48b2a9
mov edx, dword [esp + 0x34]
push edx
push ecx
call fcn.004cf000
add esp, 8
cmp byte [edi], al
jne 0x48b2a9
mov edx, dword [str.public]
lea eax, [esp + 0x3c]
mov dword [esp + 0x20], eax
lea eax, [esp + 0x1c]
push eax
push 5
push 0
push fcn.00472210
lea ecx, [esp + 0x48]
add edx, 0x120
push 0
mov dword [esp + 0x30], edi
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], edx
push str.UPDATE____sysexternalpriv__SET_use_priv__WHERE_grantee__AND_mkey__AND_rkey__AND_grantor_
jmp 0x48b2cc
mov byte [ebp + 0x11], 0
jmp 0x48b2de
lea edx, [esp + 0x1c]
push edx
push 5
push 0
push fcn.00472210
lea ecx, [esp + 0x2b]
push 0
mov dword [esp + 0x40], ecx
push str.DELETE_FROM____sysexternalpriv__WHERE_grantee__AND_rkey__AND_mkey__AND__grantor__OR___
call fcn.0050df80
mov esi, eax
add esp, 0x18
test esi, esi
jne 0x48ae26
mov eax, dword [esp + 0x10]
push eax
call fcn.0050dec0
add esp, 4
test eax, eax
jne 0x48ae26
mov eax, dword [esp + 0x30]
inc eax
add ebx, 4
cmp eax, dword [ebp + 0x12]
mov dword [esp + 0x30], eax
jl 0x48b142
xor eax, eax
mov ecx, dword [esp + 0x3d4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00586584
add esp, 0x3c8
ret
mov ecx, dword [esp + 0x30]
mov edx, dword [ebp + ecx*4 + 0x17a9f]
push edx
push 0x7dd
push 0x1f7f
call fcn.00406f10
push 6
call fcn.004432b0
add esp, 0x10
mov eax, 0x1f7f
jmp 0x48b30a
push 0x7dd
push 0
call fcn.00406f10
add esp, 8
mov eax, esi
jmp 0x48b30a