Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/msf/util/dot_net_deserialization/assemblies.rb
Views: 11784
module Msf1module Util2module DotNetDeserialization3module Assemblies45# see:6# * https://docs.microsoft.com/en-us/dotnet/standard/assembly/7# * https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies8# * https://docs.microsoft.com/en-us/dotnet/standard/assembly/reference-strong-named9class StrongName10def initialize(name, version, public_key_token, culture: 'neutral')11@name = name12@version = version13@public_key_token = public_key_token14@culture = culture15end1617attr_reader :name, :version, :public_key_token, :culture1819def to_s20"#{name}, Version=#{version}, Culture=#{culture}, PublicKeyToken=#{public_key_token}"21end2223def [](type_name)24QualifiedName.new(type_name, self)25end26end2728# see: https://docs.microsoft.com/en-us/dotnet/api/system.type.assemblyqualifiedname29class QualifiedName30def initialize(name, assembly)31@name = name32@assembly = assembly33end3435attr_reader :name, :assembly3637def to_s38"#{name}, #{assembly}"39end40end4142VERSIONS = {43'4.0.0.0' => {44'mscorlib' => StrongName.new('mscorlib', '4.0.0.0', 'b77a5c561934e089'),45'System' => StrongName.new('System', '4.0.0.0', 'b77a5c561934e089'),46'System.Configuration.Install' => StrongName.new('System.Configuration.Install', '4.0.0.0', 'b03f5f7f11d50a3a'),47'System.Data' => StrongName.new('System.Data', '4.0.0.0', 'b77a5c561934e089')48}49}5051end52end53end54end555657