I'm looking for a way to execute bytes sequence like a function. For example, I've got a sequence:
[Byte[]]$bytes = 0xb8, 0x15, 0x03, 0x00, 0x00, 0xbb, 0x42, 0x00, 0x00, 0x00, 0x03, 0xc3
which is:
mov eax, 315h
mov ebx, 42h
add eax, ebx
ret
I know about execution this via VirtualAlloc but I'm looking for a way based on the reflection and\or generic delegates.