Hey, here's little question: let's say i have the string "blahblah"morestuff.
How would i extract blahblah (the part betw. quotes)?

Thanks.
Posted on 2003-05-24 11:00:03 by Ghirai
The easy way is to find the first character of the peice you want to extract and the lenght then use lstrcpyn to copy the specified number of characters to a buffer. You can also do this without the penalty of the API call.

mov ecx,numofchars
mov esi,offsetoffirstchar
mov edi,offsetofnewstring
rep movsb

mov ,BYTE PTR 0 ; to null terminate the new string
Posted on 2003-05-24 11:05:06 by donkey
If stringlength unknown



mov edi,offset destination
mov esi,offset source
@@:
lodsb
or al,al
stosb
jnz @B
Posted on 2003-05-24 11:18:38 by roticv
Great. Thanks guys.
Posted on 2003-05-25 04:21:56 by Ghirai
Uhh... What's with the "or al,al"?
Posted on 2003-05-27 17:17:22 by psyphen

Uhh... What's with the "or al,al"?

Sets the zero flag if necesssary without changing the contents of the register.
Posted on 2003-05-27 17:32:26 by donkey
I'm sorry I'm a n00b in ASM. What does the Zero Flag have to do with transferring characters?
Posted on 2003-05-27 20:45:54 by psyphen
He used jnz @B that jump depends on the state of the zero flag (jump not zero)
Posted on 2003-05-27 21:17:10 by donkey
or al,al = test al,al = cmp al,0
All sets ZF if al = 0
It is just a matter of personal taste.
Posted on 2003-05-28 03:35:11 by roticv