Home > Code > Copy Bytes

Copy Bytes

I’ve seen so many posts from ppl complaining about CopyMemory, vbaCopyBytes and so on being dettected by Avira and some other AVs but there are many more APIs to do the same.

Here is a simple example, moving 4 bytes using lstrcpynW, more than enough to patch an address and do whatever we want.

Private Declare Function lstrcpynW Lib “kernel32″ (ByVal lDstVal As Long, ByVal lSrcVal As Long, ByVal iMaxLength As Long) As Long

Private Sub Form_Load()
Dim lSource As Long
Dim lDst As Long

lDst = 0
lSource = 123
lstrcpynW VarPtr(lDst), VarPtr(lSource), 4
Debug.Print lSource = lDst

End Sub

Categories: Code
  1. Native
    June 4th, 2010 at 19:27 | #1

    u can also make a RtlMoveMemory Function replace using this api looply :D

  2. damnation
    June 6th, 2010 at 13:05 | #2

    w0w this is really fucking brilliant!!!
    thanks c0bein

  3. demien
    June 7th, 2010 at 15:53 | #3

    wow, good =)
    thanx c0bein

  4. common26
    June 15th, 2010 at 17:43 | #4

    Any little example on a Runpe portion so I can have an idea where to begin :)

    Thanks!
    <!>

  5. common26
    June 26th, 2010 at 18:11 | #5

    Any working activity replacement for copybytes :$ plz

  1. No trackbacks yet.
You must be logged in to post a comment.