0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Powershellでのbase64のデコードのやり方

Posted at

この記事は人間が書いていますが、LLMの情報を元にしています。

Linux

Linuxでバイナリデータをbase64化

$ base64 binary.data > base64.txt

Linuxでbase64をバイナリデータに戻す

$ base64 -d base64.txt > binary.data

Linuxで9MByteごとに分割する

$ split -C 9m -d -a 3 --additional-suffix=.txt  base64.txt splited

Windows Powershell

Windows powershellでbase64デコード

出力先は絶対パスにしないとホームディレクトリに保存されました。

$base64 = Get-Content -Path "base64.txt" -Raw
try {
  $bytes = [System.Convert]::FromBase64String($base64)
  [System.IO.File]::WriteAllBytes("C:\output.bin", $bytes)
  Write-Host "出力完了"
} catch {
  Write-Host "Base64デコードに失敗しました: $($_.Exception.Message)"
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?