This guide reads a legacy Packer wrapper from a small, known sample. The task is static inspection: create the packed text with the JavaScript Obfuscator, then recover readable source with the JavaScript Deobfuscator. The sample starts as function add(a,b){return a+b;} and should reveal the same add function.

Start with the Known Function
Use the exact specimen function add(a,b){return a+b;}. Identify its purpose before packing: it accepts a and b, then returns their sum. Keeping the example small makes the recovered text easy to compare, while the supplied result provides a reproducible compatibility check for the supported Packer format.
Create a Packer-formatted copy with the JavaScript Obfuscator. Copy the complete generated wrapper, including eval, the function body, the argument list, and the final )). Do not trim separators or rewrite the wrapper; the companion unpacker needs the complete packed text shown below.
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4 3(1,0){2 1+0}',5,5,'b|a|return|add|function'.split('|'),0,{}))Unpack the Complete Wrapper
Paste the entire wrapper above into the JavaScript Deobfuscator. Keep the literal eval(function... prefix and every argument at the end. For this specimen, the input is the wrapper as plain text. There is no need to paste it into a browser console.
Unpack the text and read the result as JavaScript source. Leave it unevaluated. The expected output below shows where to find function add(a,b) and its return expression. Compare those parts before drawing conclusions about what the original sample expressed.
function add(a,b){return a+b}Verify the Recovered Expression
The recovered result should contain function add(a,b){return a+b}. Compare the function name, parameter order, and return expression with the original specimen. A missing semicolon is not a changed expression here; the meaningful check is that add still returns a+b.
Treat this as a text comparison, not a behavior claim from execution. The supplied check is satisfied when the recovered source contains the expected function. If the wrapper is incomplete or altered, repeat the unpacking step with the complete generated text and its original separators.
Know What Cannot Be Recovered
This process reads supported Packer text without executing it, but it does not restore information already discarded before packing. Original comments and formatting are unavailable in this specimen, so the recovered source may be compact and should not be presented as the original file.
Reuse the method for supported, low-risk samples whose source you are allowed to inspect. Packed browser code can still be analyzed, so do not place credentials or other secrets in client-side code. Keep sensitive values on the server, and verify each recovered result against an independent known specimen.
- Confirm the input ends with the complete
)). - Check for
function add(a,b){return a+b}. - Do not execute the recovered output during review.