Hi, as you already know, Im not that good. And now I need a push to think again.
Via FILE_END I obtain to reach the end of a file. How its possible to get the last 20 characters behind the end ?
I know a little bit about using writeFile, but readfile with this complexness I not sure.

:mad:
Posted on 2003-03-16 15:27:57 by Forginforcer
Well this probably isn't the best way but it should work.



invoke CreateFile, addr YourFile, GENERIC_READ,NULL,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL
mov hFile,eax
invoke SetFilePointer, hFile, 0,NULL,FILE_END
invoke ReadFile, hFile, addr JustRead, -20, OFFSET NumberOfBytesRead,NULL
;I think this answers your question
Posted on 2003-03-16 16:21:43 by Homer
invoke ReadFile, hFile, addr JustRead, -20, OFFSET NumberOfBytesRead,NULL

Using a negative value for bytesToRead? I don't think that's documented behaviour...
You could use this:
invoke SetFilePointer, [hFile], -20, NULL, FILE_END


Thomas
Posted on 2003-03-16 16:58:33 by Thomas
lol i'm sorry
thomas is right.

i screwed up my first answer. doh!

:stupid:
Posted on 2003-03-16 18:56:49 by Homer

lol i'm sorry
thomas is right.

i screwed up my first answer. doh!


Yeah but Homer you'll never make the same mistake now. :)

Donkey
Posted on 2003-03-16 19:02:36 by donkey
lol and i'll never have the chance to.
Posted on 2003-03-16 21:16:11 by Homer
Ah, thanks i got it !
Posted on 2003-03-17 12:15:05 by Forginforcer