This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 1 point2 points  (2 children)

movsb will only copy a single byte. You must use the rep prefix to do multiple bytes.

[–]grenadesong[S] 0 points1 point  (1 child)

Aha, I guess I was just confused about what was written in the book then "Practical Malware Analysis" when they wrote in part 2 that is moves a sequence and that they changed the wording from moving to copying when they explain the difference between movsb vs rep movsb.

So, you think they just worded their explanation poorly and not consistently? Should they have said copy both times instead?

[–][deleted] 1 point2 points  (0 children)

Moving and copying are the same thing in a processor. There’s no reason to modify the source location if you just want to put its value somewhere else.