Tuesday, December 24, 2013

decode/unwrap .plb file

find a useful link http://www.codecrete.net/UnwrapIt/, helped to see what is inside the hotfix in .plb format.

With this we are have a bit confidence to roll it out to production, while waiting for further detail explanation from vendor.



to relevant utility to create plb file is  DBMS_DDL.CREATE_WRAPPED.

more info http://www.orafaq.com/wiki/PL/SQL_FAQ

How can I protect my PL/SQL source code?

Oracle provides a binary wrapper utility that can be used to scramble PL/SQL source code. This utility was introduced in Oracle7.2 (PL/SQL V2.2) and is located in the ORACLE_HOME/bin directory.
The utility use human-readable PL/SQL source code as input, and writes out portable binary object code (somewhat larger than the original). The binary code can be distributed without fear of exposing your proprietary algorithms and methods. Oracle will still understand and know how to execute the code. Just be careful, there is no "decode" command available. So, don't lose your source!
The syntax is:
wrap iname=myscript.pls oname=xxxx.plb
Please note: there is no legal way to unwrap a *.plb binary file. You are supposed to backup and keep your *.pls source files after wrapping them. However it is possible for skilled hackers to unwrap your wrapped Oracle PL/SQL code.

How can I know which stored PL/SQL code is wrapped?

The following query gives the list of all wrapped PL/SQL code:
select owner, name, type
from dba_source
where line = 1
  and instr(text, ' wrapped'||chr(10))+instr(text, ' wrapped '||chr(10)) > 0
order by 1, 2, 3
/