Welcome back all
Today I'm gonna go ahead and play around with different cases
and we will also place this in a function, in order to clean the main function a little bit.
So what do I mean by play around with cases?
Well, this keylogger is very far from being perfect.
It can definitely be a little bit useful
but it's useless until it can actually send some information somewhere
and I have it running, so let's stop it.
Anyway, it's not very useful now.
Not because it can't send information
I will deal with that separately
but rather instead because of the way in which it records information.
If you press tabs or space or something of a kind
it doesn't really record it that well in the file
and that we've seen in the previous tutorials.
So we need to deal with that.
We will deal with it with a switch statement
before we actually do that let's just go ahead and put credit all of this into a
single function make things a little bit easier for us this function will be void
it will return it nothing I will call it log and it will receive no arguments of
what it will require no arguments of whatsoever I have written the type of
their so down here all day to function of copy disk but let's just cut it will
be easier there we go
and I we need to do is type in log here hold a function in Maine that's it so
this will work you can test it out in control of 11 and things out
ok let's go ahead and check the file out thing this is the same lower or upper ok
we got some nuances to see this is a this this is a big problem
the big problem the saudis keys enter shift something like that I'm sure it
makes no difference whatsoever because we don't want them to be written and
written in this fashion want to be written in a different fashion and you
see a DL it says does it work
interesting ok so let's close this and delete this file so that it is so that
it is clean and how I stopped program no I haven't stopped program excellent so
just see if they're ago so now the school through different cases could
make a separate function here we could actually stick around
try to rate in here well that is already here there's no need to actually ready
separate function for this now the first thing that we're going to do is delete
right see we will rewrite it later on as a default gay so in case none of the
above that will get executed for switch just each tape in which
open prevent disease he is the condition so we are going to pass the characters
see to switch and then based upon what that character C is switch will do
something so let's go ahead and type in case one case one actually known as case
one case eight so if she has a numerical value of aid see character has a
numerical value of fate in ASCII that spans the backspace so here it is
says back space ok no problems let's just do it here and they played colon
not a semicolon here
space and then we're going to use right from here
output and we are simply going to substitute
we're not being told to see to it rather instead in case she is eight we're going
to output something else and Casey has an American value of it so what should
we go out but I like to do it like this with the lesser than sign and then type
in case this is just how I like the substitute backspace
mean if you don't feel free to like it any way you like completely up to you so
let's go ahead and type in Michael and here and that's it
now we need to jump into the case so case and then we will find something I'm
sure it is
have plenty of these cases you can play around with them as much as you like as
much as you wish so let's see what else are we going to substitute so we have a
live feed vertical feed data which can also have fun with skip we can also
substitute escape which is 27 and delete which is one hundred and twenty-seven 27
so what was that
see you believe that this will be sufficient and 127 right so we place
here
27 del
so you get the general idea you just keep on writing delete this for every
case that you wish to that you wish to modify what I would suggest is let's go
ahead and find a switch is 32 so those are some of the things that you should
change so case 32 right so obviously you could write space in I don't know
doesn't seem very logical to me I just like to say but in cyberspace quite
literally tens certain space and nothing else but you could also type in
something here
rights and then have that outfit that's also an option I just don't like doing
that and case for enter surer where the where exactly it is I just go ahead and
take a look so separator and anybody see enter here should be around here
somewhere like this
okay so it's thirteen 13 hits a return sorry of course so 30 case 13 I would
like you to right center maybe there isn't a need for this but then I would
also like you to insert a new life so that our entire record log file is not
all in one single I'd which can be a talk quick to read and file can be
difficult to see review ok so we have inserted some of them as let's just
creating default case in cases of the above the fold right right see so this
will be the same as before you will just see out let's go ahead press Ctrl F 11
yes
ok so it is running now let's go ahead and open up our Console is so slightly
best baseless backspace key pressing it and now we need to type in something and
actually its press Enter
amplifying first then type in this new text over a longer text and take a look
at backspace ask a lil editor backs faces no problems there and to enter
this and then gave Dell case I pressed enter have no idea let's just go ahead
and write a check the lead press backspace and press enter once this is
the new president earning more times but the if I have messed something up we
will fix it in the fall of Doral doesn't really matter
mistakes are bound to happen here so it's a school and opened the file
txt case have pressed enter way too many times here what's the problem
13 it right
enter if it's 32
wartime see if we can actually figure it out here if not all have the solution
for you to follow tutorial but I will not edit my mistakes out I want to keep
them in here we have a lot of backs basis one character is not getting
interpreted right not sure what that is but it seems to be interpreting Space
Center probably messed up with DES key values because you can see in between
every word is putting up so this is the new text and I seem to have a problem
with my ASCII code I will check it out on the website one more time and see how
it works out from there but that is completely irrelevant as I will have the
solution for you to follow tutorial what you want to be looking at is the switch
statement and how you can define individual cases so individual cases
which are like have a tab you have a controlled you have you have the windows
home but you have space and enter you have shifted damage and shift also have
backspace and I del arrows and I do believe the dead is it escaped as well
that is it so we gotta make quite a few of these cases and once we have made
them all then we will have a proper file one of the next steps would be to
differentiate between lowercase and uppercase letters anyway but you'll
farewell and I hope to see you in default of tutorial