How to check the source code of a package?

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
User avatar
heraldoaraujo
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 41
Joined: Sun, 19 Feb 2012 12:10 pm

Good afternoon,

I wanted to know what the means of checking the source code of a packages. Can someone help me?
Tinho
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 325
Joined: Mon, 16 Nov 2009 4:50 pm
Location: São Paulo - SP

Dear Heraldo,

I usually use the following code, see if it helps:

Select all

 
 
SELECT * 
  FROM DBA_OBJECTS UO 
 WHERE UO.OWNER = 'SYSTUR' 
   AND UO.OBJECT_TYPE IN ('PACKAGE','PACKAGE BODY','PROCEDURE') 
   AND (    TRIM(UPPER(UO.OBJECT_NAME)) LIKE TRIM(UPPER('%sitef%')) 
         or TRIM(UPPER(UO.OBJECT_NAME)) LIKE TRIM(UPPER('%cart%cr%dito%'))   ) 
   AND UO.status = 'VALID'         ; 
--   AND (    TRIM(UPPER(UO.OBJECT_NAME)) LIKE TRIM(UPPER('%CLIE%')) ); 
--         OR TRIM(UPPER(UO.OBJECT_NAME)) LIKE TRIM(UPPER('%GEN%'))  
--         OR TRIM(UPPER(UO.OBJECT_NAME)) LIKE TRIM(UPPER('%PES%')) ), 
 
-- 
-- SELECT * FROM ALL_OBJECTS WHERE 
SELECT DISTINCT NAME 
  FROM ALL_SOURCE  
 WHERE OWNER                = 'SYSTUR' 
   AND TYPE                IN ('PACKAGE','PACKAGE BODY')--,'PROCEDURE','FUNCTION') 
   AND (    TRIM(UPPER(TEXT)) LIKE TRIM(UPPER('%sitef%')) 
         or TRIM(UPPER(TEXT)) LIKE TRIM(UPPER('%cart%cr%dito%')) 
         /*or TRIM(UPPER(TEXT)) LIKE TRIM(UPPER('%OURO%'))*/         ); 
 
Att.,
User avatar
heraldoaraujo
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 41
Joined: Sun, 19 Feb 2012 12:10 pm

Thank you very much, I'll test tonight, but it really works with an encrypted packages, is it possible?
Tinho
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 325
Joined: Mon, 16 Nov 2009 4:50 pm
Location: São Paulo - SP

I do not know much of encryption in Oracle because I never had the need to create, because in the majority of the places I'vê worked on this routine was already developed.

However I know that there are specific packages for this purposes, as you can see at the following link:
http://en.glufke.net/oracle/viewtopic.php?t=200
Att.,
Tinho
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 325
Joined: Mon, 16 Nov 2009 4:50 pm
Location: São Paulo - SP

As I was interested in the subject, I suggest the following links, if you want to take your doubts about encryption. Just see the method used to encrypt and reverse, follow:

TDE http://www.profissionaisti.com.br/2011/ ... com-o-tde/
wrapper http://www.linhadecodigo.com.br/artigo/ ... apper.aspx http://www.devmedia.com.br/pl-sql-wrapper/4636
DBMS_Crypto http://docs.oracle.com/cd/B28359_01/app ... crypto.htm http://psoug.org/reference/dbms_crypto.html
Obfuscation Tookit / MD5 http://www.siltechconsult.com.br/silverblog/?p=29 http://www.oraclehome.com.br/2011/08/30 ... no-oracle/
In addition, there are more topics here on the site.

abcs.,
User avatar
stcoutinho
Moderador
Moderador
Posts: 850
Joined: Wed, 11 May 2011 5:15 pm
Location: são Paulo - SP

Speak Tinho!

very cool the tips he posted, but I fear that it is not possible to decrypt a package, function or procedure that is encrypted.

The purpose of the encryption of PL / SQL codes is that of precisely hide the logic of the consultation business as the Heraldoaraujo is desiring to do.

For example, Oracle EBS (Oracle ERP) is full of encrypted packages that prevent competitors from knowing the application's business rules.

Oracle always recommends that developers, if they think of encrypting sources, which maintain a decrypted copy of them.

Hugs,

Sergio Coutinho
User avatar
heraldoaraujo
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 41
Joined: Sun, 19 Feb 2012 12:10 pm

Good morning class,

I already predicted that it was not possible, as the colleague of above spoke. I wanted to be sure about this.

Thank you all.
Tinho
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 325
Joined: Mon, 16 Nov 2009 4:50 pm
Location: São Paulo - SP

Ah, I understand, Vlw, very cool that.

is that I was imagining being an intentional encryption, that is, made by some developer.

Thanks.

Abç.
User avatar
fbifabio
Moderador
Moderador
Posts: 199
Joined: Tue, 22 Feb 2011 1:51 pm
Location: São Paulo - SP
Contact:
Fábio Prado
www.fabioprado.net

Personnel,

to everyone's surprise, unfortunately it is possible to recover the wrapped code from a PL / SQL object:
http://www.blackhat.com/presentations/b ... nnigan.pdf
[99]][]s
Post Reply
  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 1 guest