Jump to content

C# Console App


Quovadis

Recommended Posts

Im currently studying C# and almost finished the console part.

Each time I do a project , I try to add something funny and unexpected to kinda to show my teacher I can do research and surpise him.

For this project I have to do a console application.

What I wanted to do is to implement a method that plays an audio file.

I already got it working perfectly now the only problem is that my teacher will probably find it before opening the .exe

He always read the whole code before doing so and since its a little competition between me and him I would love to find a way to hide it from him.

I have to give him the whole solution of the project in visual studio.

Would there be a way to hide if from what is shown in visual studio?

Like to call a method that would get the method from another file that isnt in the solution?

 

PS: I want to put a wav of the nyan cat song.

Should piss him enough haha

Link to comment
Share on other sites

  • Clan Friend

It sounds hard to do, you could try to obfuscate it a bit, but he would find out imho (or at least he'll find a part that's not clear, and he will try to understand what it does).

 

I don't know how you play sounds in c#, do you call a windows api? Maybe you could getprocaddress from an encrypted (even in a simple way) name, and encrypt the filename likewise.

Link to comment
Share on other sites

  • Clan Friend

That way it's obvious, hmm...

 

I don't know c# much, but maybe you can open a different process to play the sound, for example windows media player or vlc

 

string lol = @"path to vlc encrypted in some way or it's obvious";

string asdasd = @"path to wav encrypted";

 

the encryption can be really basic, e.g. adding x to each character, you encrypt with another little program you don't give him :P

call a funtion or do something to decrypt those names in real time, then System.Diagnostics.Process.Start(lol, asdasd);

 

it will call vlc media player to play the wav

 

Actually if you do System.Diagnostics.Process.Start(sound_filename_string) it will open it as if you doubleclick, i.e. it will open the associated media player in the system.

 

It's still obvious, but at least it would give him some trouble :P

 

edit:

actually, if you could turn the sound into a self-playing .exe (i think there is some software to do it, but I never tried), and you run that exe with that function above, it would be even better...

Edited by SunLight
Link to comment
Share on other sites

Maybe, create a separate program that is of type TSR (terminate and stay resident program) , and probably run that program before your teacher sits down in front of that visual studio PC. The TSR sits down and waits for the trigger key to be activated. Once activated, it will auto play the song.

 

So when your teacher presses Page Down or Down Arrow keys (which is usually being done when viewing source codes) that would activate the TSR trigger and automatically plays the songto piss of your teacher.

 

Do at your own risk ofcourse! :P

Link to comment
Share on other sites

  • Clan Friend

You could write a dll with a function to load and play the sound, then call it, but I think it would be cheating since you must give him all the source code, you can't write a separate part without giving him the source of that part

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.