Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sasqwatch/8cf4a0ba165a2fafd059e75d52084fca to your computer and use it in GitHub Desktop.
Save sasqwatch/8cf4a0ba165a2fafd059e75d52084fca to your computer and use it in GitHub Desktop.
${🀷} = New-Object Reflection.Emit.DynamicMethod('πŸ’©', [UInt32], @([UInt32], [UInt32]))
${πŸ€”} = ${🀷}.GetILGenerator()
@(@(2, 275120805),@(3, 275120805),@(88, -261739867),@(42, 23440101)) | % {
${πŸ€”}.Emit([Activator]::CreateInstance([System.Reflection.Emit.OpCode], [Reflection.BindingFlags] 'NonPublic, Instance', $null, @(($_[0] -as [System.Reflection.Emit.OpCode].Assembly.GetType('System.Reflection.Emit.OpCodeValues')), $_[1]), $null))
}
${πŸ’©} = ${🀷}.CreateDelegate([Func``3[UInt32, UInt32, UInt32]])
${πŸ’©}.Invoke(2,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment