I have a simple snippet with several instructions:
01: mov edi, [ebp+8]
02: mov edx, edi
03: xor eax, eax
04: or ecx, 0FFFFFFFFh
05: repne scasb
06: add ecx, 2
07: neg ecx
08: mov al, [ebp+0Ch]
09: mov edi, edx
10: rep stosb
11: mov eax, edx
I should explain:
1.What is the type of the
[ebp+8]
in line01
and[ebp+C]
in line08
, respectively.2.What this code does?
Line
01
is something likeedi = *(ebp+8)
, it stores destination address, not sure. But i can't explain line08
By following the
intel
manualSCASB (scan byte string)
i assume what this code does initialize a buffer for the string, repeatedly writes0
byteeax
times, then assignal
toedi
.