Click to See Complete Forum and Search --> : Saving data to DLL?? is it possible?
kishk91
August 26th, 1999, 02:10 AM
yoo there...
whats the best way ( if its opossible) to save data (lets say.. passwords,bmp..)
and how can i do it???
i try to use the UpdateResouce() but no use...( the code works fine while the app runing but when i close and restart it the resource isnt saved)
is there any other way to do it???
thanks
kishk91
Chainard Arnaud
August 26th, 1999, 05:53 AM
All think are possible, a solution is to add a ressource like Bitmap in the dll, ressource are store in the dll without any compression so, open the dll in write mode, search the begin of the bitmap ( Look with an hexedit the begin of the file ex : BM......... ) and write on it.
FILE *FPtr = fopen ( "c:\\windows\\system\\my.dll", "wb" );
...
fclose ( FPtr );
If you want to optimise time store the possition in INI during the 1er search.
Take care to one think Un Virus store a CRC of dll to see if she was modified by virus so it can generated error with this sorte of programme ...
A++
kishk91
August 26th, 1999, 06:47 AM
ok.. now this was for BMP
but if i wanna something else like user name and password?? (plain text???)
how do i do this??
is there and special thing i should do ?
thanks
kishk
Chainard Arnaud
August 26th, 1999, 08:09 AM
FILE *FPtr = fopen ( "c:windows\\system\\mydll.dll", "wb" );
long Pos = MyFonctionWhoGiveMeThePosOfMyBmp ( FPtr );
fseek ( FPtr, Pos, SEEK_SET );
fwrite ( &MyLogin, 1, 256, FPtr );
fwrite ( &MyLogin, 1, 256, FPtr );
...
fclose ( FPtr );
The Bitmap is here only to give you some space to write in the DLL, don't use it in your app.
The code is to write the login and password to read open with "rb" and use fread
Take care to the size you read and write, you mustn't read or write info > Bmp Size ( the size of the .bmp file ).
A++
kishk91
August 26th, 1999, 08:16 AM
ok... ill try it...
what about the UpdateResource() any use of this func in this case??
if it is.. any idea how do i use it?
( i know how to use it but with what resource??)
thanks
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.