1

I am trying to understand keylogger code (for ethical hacking) on YouTUBE

But I cannot understand the purpose of

  1. Opening outputfile for reading
  2. Saving to buffer
  3. Closing the outputfile
  4. Opening the outputfile for writing
  5. Save all log information as a variable

Why not simply open writable file and then close when the program terminates?

What is the logic to the above approach? Is there some sort of best practice? Please clarify

enter image description here

1 Answer 1

2

This is because if your file already has any data, then the keylogger will first combine all the old data and new data together and then finally write it into your output file. If it directly writes it then the old data will be vanished...

Yeaa! you can try using f=open('c:\output.txt', 'a')
the 'a' here will then append data and the old data will be automatically saved.... try this out! may be this helps solve your problem

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.