Comment on All My Exes Live in TextsComments−billforsternz13yDamn, was hoping this was an article about how to encode Windows executables into text.−_b8r013yAsk and ye shall receive (in powershell form): $fName = "last.exe" $fContent = get-content $fName $fContentBytes = [System.Text.Encoding]::UTF8.GetBytes($fContent) $fContentEncoded = [System.Convert]::ToBase64String($fContentBytes) $fContentEncoded set-content ($fName + ".text") Now you can at least say that all your .exes live in base64-encoded .texts.−ygra13yI guess that should rather be Get-PSDrive -PSProvider Filesystem | Get-ChildItem -Recurse -Path { $_.Root } -Filter *.exe | ForEach-Object { $bytes = Get-Content $_ -Encoding Byte -ReadCount 0 $text = [Convert]::ToBase64String($bytes) $text | Set-Content ($_.FullName + '.text') } Reading the files as UTF-8 and converting them back into a byte array isn't such a great idea, I think ;-)−billforsternz13yThanks, upvoted. (But, also, note that I wasn't really hoping this was an article about how to store my Windows .exes as text :-)
Comments
Damn, was hoping this was an article about how to encode Windows executables into text.
Ask and ye shall receive (in powershell form):
Now you can at least say that all your .exes live in base64-encoded .texts.I guess that should rather be
Reading the files as UTF-8 and converting them back into a byte array isn't such a great idea, I think ;-)Thanks, upvoted. (But, also, note that I wasn't really hoping this was an article about how to store my Windows .exes as text :-)