Hi everyone,
I want to add text to a existing file ::)
And the point of view is:
1) Get the file.
2) Seek the end of the file.
3) Add text at end.
The file which I wanna append is existing already and the file is not with any extension.
The file can be opened with notepad.
nice name you picked - lol
took all day to think of it, eh ?
now - your file
so, you want us to guess the filename ?
my guess is.....
hosts
tell us what you want to stick in there
be specific - as in, tell us the url
Precious mind......
Well its some thing I want to avoid server check. :wink
I never thought you can think of it lol
127.0.0.1 www.xxxx.com
----------------
Do you know me, off course not - so I am unknown
Moreover Its better than some numeric name lol
xxx.com ?
lol
your originality is gonna kill me
Quotebe specific - as in, tell us the url
opps.....I did not write xxx, I wrote xxxx lol
Anyway,
127.0.0.1 client.msnslide.com
I hope we can move on solving the problem :wink
well, first, let me tell you that the forum has rather strict rules about cracking, etc
second, most of us won't write a program for you
you have to learn assembly language and write it yourself
if you are new to programming, i would suggest you pick a simpler language to start with
Quote from: unknown on August 24, 2009, 11:11:11 AMThe file can be opened with notepad.
Then...use notepad.
Quote from: dedndave on August 24, 2009, 11:48:21 AM
well, first, let me tell you that the forum has rather strict rules about cracking, etc
second, most of us won't write a program for you
you have to learn assembly language and write it yourself
if you are new to programming, i would suggest you pick a simpler language to start with
Where do I mention its for cracking.
I am a asm coder but not so good...
I coded the solution but it not seem to be working...
Well forget everything, delete this post admins...or the last reply for help! :8)
1. CreateFile
HANDLE WINAPI CreateFile(
__in LPCTSTR lpFileName,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile
2. SetFilePointer to FILE_END
DWORD WINAPI SetFilePointer(
__in HANDLE hFile,
__in LONG lDistanceToMove,
__inout_opt PLONG lpDistanceToMoveHigh,
__in DWORD dwMoveMethod
3. WriteFile
BOOL WINAPI WriteFile(
__in HANDLE hFile,
__in LPCVOID lpBuffer,
__in DWORD nNumberOfBytesToWrite,
__out_opt LPDWORD lpNumberOfBytesWritten,
__inout_opt LPOVERLAPPED lpOverlapped
4. CloseHandle
BOOL WINAPI CloseHandle(
__in HANDLE hObject
Quote
What a mentality you have, So you think I am crazy writing just for fun right here, I can modify but its not for me
For others I cant tell every newbie individual to add it!
I decided to come here on this forum because I hoped for any help, and not this kind of help....
I told every thing what 'dedndave' wanted.
I want to append host file with specified text, now what you want out of me ?!
Charmed, I'm sure.
Thanks for the hints...
dedndave, learn from it, not everything can be solved with your way....Aquire the reason and follow and it seem you were the first to think about stupid idea of cracking here ...and I really don't believe you can be... :wink
And where did I mention to code for me, did I, just want hints!
Just like this:
http://www.masm32.com/board/index.php?topic=9209.msg91889#msg91889
Just remember, the hosts file is one of the things that antivirus and antispyware programs keep tabs on.
There are a few available on the internet, they just give you the whole hosts file.
I've also seen that it's not much use anyway, so who knows?
i know what a hosts file is
and i know that if XYZ software wants to put ABC software out of business, adding www.XYZ.com to the hosts file will help
and, Sinsi - i have used the hosts file - and i know it helps
i also use it to get rid of advertisements
mine is currently about 600 kb
there are other ways to use the file, as well - i won't go into it here
unknown - if you have some code that isn't working - post it
Quote from: dedndave on August 24, 2009, 01:35:02 PM
i know what a hosts file is
and i know that if XYZ software wants to put ABC software out of business, adding www.XYZ.com to the hosts file will help
and, Sinsi - i have used the hosts file - and i know it helps
i also use it to get rid of advertisements
mine is currently about 600 kb
there are other ways to use the file, as well - i won't go into it here
unknown - if you have some code that isn't working - post it
Better I think better reply this time lol, Well I already coded!
I used GetSystemDirectory > copied to buffer and combining the text '\drivers\etc\Hosts' > Seeked the end of file by using FILE_END > Input the text by WriteFile > and then
closed file!
Thanks to sinsi and
Quoteyou have to learn assembly language and write it yourself
if you are new to programming, i would suggest you pick a simpler language to start with
your attitude made me do it :lol
normally, i would use FindFile to get the size, then set the pointer using SetFilePointer to the desired position
seeing as you are going straight to the end, you don't even need to use FindFile
one of the SetFilePointer options is to set it to the current end of file
1) use CreateFile to open it
2) use SetFilePointer to point to end of file
3) use WriteFile to write
4) use CloseHandle to close the file
Or for easy you could use the MASM32 fopen, fseek, fprint, and fclose macros.
this is abit random but to me it seriously blew my mind to find out php/perl didn't have a setfilepoint equivilant built in. for php a addon like pear might give it the ability, but you'd think itd have it as its core, considering how essential it is.
i think they have security issues in mind
there are a lot of limitations for coding webpages because of security
very different from writing applications
Quote from: dedndave on August 25, 2009, 10:11:38 AM
i think they have security issues in mind
there are a lot of limitations for coding webpages because of security
very different from writing applications
eh idk about that one, only explanation i've gotten is PHP is more about speed, and focuses on offloading most of the workload onto other things(like databases) that way users can be accomdated faster. The lack of setfilepointer still doesn't fit as you can read entire files into memory, do what you like, then write it back out, which is not ideal at all.
abdul,
Its always our pleasure to have members from all over the world and Saudi Arabia is no exception but a word of wisdom here, this forum must survive in a dangerous and often unfriendly internet world and to do that we act to protect our members by setting a clear set of rules about content and techniques. If you join and then immediately ask unusual questions then argue with the members, we end up suspicious about what you are after.
When someone asks you about WHY you are writing something or what you want to do with it, its because we have been bitten many times by people who have done similar things so they can hack websites, crack software or write malicious code like viruses and trojans.