[API]
RtlMoveMemory
GlobalAlloc
GlobalFree

[INCLUDE]
UnHexByte
MessageBox

[CODE]
Public Function CreateAssemblyFromHexString(ByVal ByteCode As String) As Long
  Dim xLong1 As Long
  Dim xLong2 As Long
  Dim xByteA1() As Byte
  
  xLong1 = Len(ByteCode)
  ReDim xByteA1(xLong1 - 1&)
  Call RtlMoveMemory(xByteA1(0), ByVal ByteCode, xLong1)
  xLong1 = xLong1 \ 2&
  CreateAssemblyFromHexString = GlobalAlloc(0&, xLong1)
  If CreateAssemblyFromHexString = 0& Then
    RaiseAssemblyTermination
    End If
  For xLong2 = 0& To xLong1 - 1&
    xByteA1(xLong2) = UnHexByte(xByteA1(xLong2 * 2&)) * 16& + UnHexByte(xByteA1(xLong2 * 2& + 1&))
    Next
  Call RtlMoveMemory(ByVal CreateAssemblyFromHexString, xByteA1(0), xLong1)
  End Function

Private Sub RaiseAssemblyTermination()
  
  End
  End Sub
