mardi 29 septembre 2020

Loading a .NET assembly from a byte array

I'm getting this error when I try to load a program in memory

error:

GAC    Version        Location
---    -------        --------
False  v2.0.50727

here my code:

$Path = "D:\calc.exe"
$bytes = [System.IO.File]::ReadAllBytes($Path)

$string = [System.Convert]::ToBase64String($bytes)

$bytees = [System.Convert]::FromBase64String($string)
[System.Reflection.Assembly]::Load($bytees)




Aucun commentaire:

Enregistrer un commentaire