Updated code.

VB Code:
  1. Public Sub bArrRemoveDuplicate(ByRef ByteArray() As Byte)
  2.     Dim LowBound As Long, UpBound As Long
  3.     Dim TempArray() As Byte, TempByte As Byte, Cur As Long
  4.     Dim A As Long, B As Long
  5.    
  6.     'check for empty array
  7.     If (Not ByteArray) = True Then Exit Sub
  8.    
  9.     'we need these often
  10.     LowBound = LBound(ByteArray)
  11.     UpBound = UBound(ByteArray)
  12.    
  13.     'reserve check buffer
  14.     ReDim TempArray(LowBound To UpBound)
  15.    
  16.     'set first item
  17.     Cur = LowBound
  18.     TempArray(Cur) = ByteArray(LowBound)
  19.    
  20.     'loop through all items
  21.     For A = LowBound + 1 To UpBound
  22.         TempByte = ByteArray(A)
  23.         'make a comparison against all items
  24.         For B = LowBound To Cur
  25.             'if is a duplicate, exit array
  26.             If (TempArray(B) Xor TempByte) = 0 Then Exit For
  27.         Next B
  28.         'check if the loop was exited: add new item to check buffer if not
  29.         If B > Cur Then Cur = B: TempArray(Cur) = ByteArray(A)
  30.     Next A
  31.    
  32.     'fix size
  33.     ReDim Preserve TempArray(LowBound To Cur)
  34.     'copy
  35.     ByteArray = TempArray
  36. End Sub

Noticed a silly thing I forgot to optimize. Now it is only 1.3 times the speed of the ASM code.