Git Product home page Git Product logo

Comments (2)

AveYo avatar AveYo commented on May 29, 2024

You can pushd / set-location to the directory you want before running it, and it will unpack there

As for using it purely via powershell, it needs more adjustments since it's made to support multiple file attachments.
I plan to restructure the output to make that easier.

But if you can't wait, here's your example with BAT85 and randomized password:

# first, mimic $f as it is in the batch file output - the first attachment would be $f[2] 
$f = @(0,0)
$f+= @'
::!e^f7}}}}}zpN]c}}}}}-{0Xr}}}}}}=9K9}OOh0V8SfqpTx3.}||hw}66|U}}}}}}}UECg^Oq/^JPQCbZiR,^l8a4^C,JJ}}}_U}}}}}fnUWb2!oz~^_Sa-$mr67-~db4
::}0+l;WG=TE}}VZu}}|hU}}_@V}}_@V}9o.GWj5Q
'@

# second, add the decode part
$b='Microsoft.VisualBasic';Add-Type -As $b;$k=iex "[$b.Interaction]::InputBox('Key',85)";if($k.Length-ne85){exit};Add-Type -Ty @'
using System.IO; public class BAT85 {public static void Dec (ref string[] f, int x, string fo, string key) { unchecked {
byte[] b85=new byte[256];long n=0;int p=0,q=0,c=255,z=f[x].Length; while (c>0) b85[c--]=85; while (c<85) b85[key[c]]=(byte)c++;
int[] p85={52200625,614125,7225,85,1}; using (FileStream o=new FileStream(fo,FileMode.Create)) { for (int i=0;i != z;i++) {
c=b85[f[x][i]]; if (c==85) continue; n += c * p85[p++]; if (p==5) {p=0; q=4; while (q > 0) {q--; o.WriteByte((byte)(n>>8*q));}
n=0;}} if (p>0) {for (int i=0;i<5-p;i++) {n += 84 * p85[p+i];} q=4; while (q>(5-p)) {o.WriteByte((byte)(n>>8*(--q)));} } } }}}
'@; cd -Lit($env:__CD__); function X([int]$x=1){[BAT85]::Dec([ref]$f,$x+1,$x,$k); expand -R $x -F:* .; del $x -force}

# third, call decode function - with arg = 1 because it's the 1st attachment
X(1)

use this randomized key when asked:
}V0UN9@Sd_23{A-WBqh(.oHC!w]|lb)D$pJfK^/n+x7zrQR&1?cmvIOMXa4uZL#TiGkFjPy;esYt[Eg~86=5,

from compressed2txt.

Davider-code avatar Davider-code commented on May 29, 2024

You can pushd / set-location to the directory you want before running it, and it will unpack there

As for using it purely via powershell, it needs more adjustments since it's made to support multiple file attachments. I plan to restructure the output to make that easier.

But if you can't wait, here's your example with BAT85 and randomized password:

# first, mimic $f as it is in the batch file output - the first attachment would be $f[2] 
$f = @(0,0)
$f+= @'
::!e^f7}}}}}zpN]c}}}}}-{0Xr}}}}}}=9K9}OOh0V8SfqpTx3.}||hw}66|U}}}}}}}UECg^Oq/^JPQCbZiR,^l8a4^C,JJ}}}_U}}}}}fnUWb2!oz~^_Sa-$mr67-~db4
::}0+l;WG=TE}}VZu}}|hU}}_@V}}_@V}9o.GWj5Q
'@

# second, add the decode part
$b='Microsoft.VisualBasic';Add-Type -As $b;$k=iex "[$b.Interaction]::InputBox('Key',85)";if($k.Length-ne85){exit};Add-Type -Ty @'
using System.IO; public class BAT85 {public static void Dec (ref string[] f, int x, string fo, string key) { unchecked {
byte[] b85=new byte[256];long n=0;int p=0,q=0,c=255,z=f[x].Length; while (c>0) b85[c--]=85; while (c<85) b85[key[c]]=(byte)c++;
int[] p85={52200625,614125,7225,85,1}; using (FileStream o=new FileStream(fo,FileMode.Create)) { for (int i=0;i != z;i++) {
c=b85[f[x][i]]; if (c==85) continue; n += c * p85[p++]; if (p==5) {p=0; q=4; while (q > 0) {q--; o.WriteByte((byte)(n>>8*q));}
n=0;}} if (p>0) {for (int i=0;i<5-p;i++) {n += 84 * p85[p+i];} q=4; while (q>(5-p)) {o.WriteByte((byte)(n>>8*(--q)));} } } }}}
'@; cd -Lit($env:__CD__); function X([int]$x=1){[BAT85]::Dec([ref]$f,$x+1,$x,$k); expand -R $x -F:* .; del $x -force}

# third, call decode function - with arg = 1 because it's the 1st attachment
X(1)

use this randomized key when asked: }V0UN9@Sd_23{A-WBqh(.oHC!w]|lb)D$pJfK^/n+x7zrQR&1?cmvIOMXa4uZL#TiGkFjPy;esYt[Eg~86=5,

Thank you very much for your reply
I'm looking forward to code enhancement. Pure PowerShell code can support custom expand paths,

from compressed2txt.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.