This is only filling the buffer with one A.
Andy
xor ecx,ecx
comp:
mov ebx,offset Buffer
mov [ebx],byte ptr 'A'
inc ebx
inc ecx
cmp ecx,5
jne comp
The code is setting EBX to the start of the buffer at the top of the loop... you need to move your loop label.
xor ecx,ecx
mov ebx,offset Buffer
comp:
mov [ebx],byte ptr 'A'
inc ebx
inc ecx
cmp ecx,5
jne comp
See the difference? Your code, each time the loop starts you reload the Buffer address into ebx, move an "A", then reload the address. You keep resetting the pointer each iteration.
Thanks.
Andy
I know that buffer overruns are bad, but I wanted to see what happened if I did.
If I put another buffer after the 1st one, it writes into that.
Otherwise, I assume it is writing over my code.
Just for information, when does that become a problem ?
I could not see any ill effects writing 30 bytes over.
it's a trick used for malware
we can't really discuss it any further on this forum :P