flat assembler
Message board for the users of flat assembler.

Index > Windows > Usage of lstrcpy

Author
Thread Post new topic Reply to topic
Hicel



Joined: 09 Sep 2004
Posts: 55
Hicel
Can someone give me an example of how to use lstrcpy. I searched the forum but didn't find a solution for my problem.
Because this doesnt work:
Code:
stringI db "    ",0
stringII db "test",0

push dword [stringII]
push dword [stringI]
call lstrcpy
    


stringI is still nothing? but why?

this was just written from mind now because i'm not at home at the moment
I need to do this with pushes and i don't know if it was only "call lstrcpy" i think not but i hope you know what i want to do.. i don't want to use invoke.
Post 17 Aug 2005, 02:21
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17715
Location: In your JS exploiting you and your system
revolution
Code:
stringI db "    ",0 
stringII db "test",0 

push stringII  ;push the address of the string
push stringI   ;push the address of the string
call lstrcpy 
    
Post 17 Aug 2005, 02:31
View user's profile Send private message Visit poster's website Reply with quote
Matriark TerVel



Joined: 09 Aug 2005
Posts: 8
Location: Cincinnati, OH, USA
Matriark TerVel
Hicel wrote:
Can someone give me an example of how to use lstrcpy. I searched the forum but didn't find a solution for my problem.
Because this doesnt work:
Code:
stringI db "    ",0
stringII db "test",0

push dword [stringII]
push dword [stringI]
call lstrcpy
    


stringI is still nothing? but why?

this was just written from mind now because i'm not at home at the moment
I need to do this with pushes and i don't know if it was only "call lstrcpy" i think not but i hope you know what i want to do.. i don't want to use invoke.


You could also do:

Code:
           mov esi,stringII
           mov edi,stringI
.sloop:    movsb
           ; use [esi] if you don't want to copy the trailing 0
           cmp byte [esi-1],0
           jnz .sloop
    


and avoid lstrcpy all together. Wink

FYI: The reason you wern't getting anything with lstrcpy is because you were dereferencing the pointers.

_________________
Tim
Post 18 Aug 2005, 14:55
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.