This is the evilest thing I can imagine! [C version]

This is the evilest thing I can imagine! [C version]

Post by RatkinHHK on Wed Dec 10, 2014 6:42 pm
([msg=85774]see This is the evilest thing I can imagine! [C version][/msg])

First the question: If I have a special character, encoded in a different format, how can I add it in a source file among other 'normal' characters?

And now the plan, so the above question makes sense:
The greek '?' character, encoded with U+037E, looks exactly like the latin semicolon: ';' Therefore, if I can somehow add this character in a source, it will not compile, but will look normal.
"You have enemies? Good. That means you've stood up for something, sometime in your life." --- Winston Churchill
User avatar
RatkinHHK
Experienced User
Experienced User
 
Posts: 72
Joined: Tue Nov 11, 2014 6:06 pm
Blog: View Blog (0)


Re: This is the evilest thing I can imagine! [C version]

Post by ghost107 on Wed Dec 10, 2014 7:06 pm
([msg=85776]see Re: This is the evilest thing I can imagine! [C version][/msg])

Edit:
As for encoding on the source depends on your editor, if you want to name variables with special encoding characters will not work, but you can simply add the character to the strings, and comments, without any problems.
Last edited by ghost107 on Wed Dec 10, 2014 7:11 pm, edited 2 times in total.
User avatar
ghost107
Poster
Poster
 
Posts: 316
Joined: Wed Jul 02, 2008 7:57 am
Blog: View Blog (0)


Re: This is the evilest thing I can imagine! [C version]

Post by RatkinHHK on Wed Dec 10, 2014 7:08 pm
([msg=85777]see Re: This is the evilest thing I can imagine! [C version][/msg])

I want to use the character while I write the source, not use it at runtime.
"You have enemies? Good. That means you've stood up for something, sometime in your life." --- Winston Churchill
User avatar
RatkinHHK
Experienced User
Experienced User
 
Posts: 72
Joined: Tue Nov 11, 2014 6:06 pm
Blog: View Blog (0)


Re: This is the evilest thing I can imagine! [C version]

Post by pretentious on Thu Dec 11, 2014 12:44 am
([msg=85779]see Re: This is the evilest thing I can imagine! [C version][/msg])

RatkinHHK wrote:The greek '?' character, encoded with U+037E, looks exactly like the latin semicolon: ';' Therefore, if I can somehow add this character in a source, it will not compile, but will look normal.

Saw this on the interwebs recently too. The compiler error is pretty straight forward eg unrecognised character ';' at etc
But anyway, try using a character map or something that's off the top of my head ꓒꓤꓱꓷ
Goatboy wrote:Oh, that's simple. All you need to do is dedicate many years of your life to studying security.

IF you feel like exchanging ASCII arrays, let me know ;)
Can you say brainwashing It's a non stop disco
User avatar
pretentious
Addict
Addict
 
Posts: 1202
Joined: Wed Mar 03, 2010 12:48 am
Blog: View Blog (0)


Re: This is the evilest thing I can imagine! [C version]

Post by cyberdrain on Thu Dec 11, 2014 6:04 pm
([msg=85790]see Re: This is the evilest thing I can imagine! [C version][/msg])

What's the point of this: why would you upload broken but easily fixed code? You might as well add some hard to debug bugs to it.
Free your mind / Think clearly
User avatar
cyberdrain
Expert
Expert
 
Posts: 2160
Joined: Sun Nov 27, 2011 1:58 pm
Blog: View Blog (0)


Re: This is the evilest thing I can imagine! [C version]

Post by RatkinHHK on Fri Dec 12, 2014 12:23 am
([msg=85801]see Re: This is the evilest thing I can imagine! [C version][/msg])

I did not realise it is so easy to fix. I did not take the compiler messages into account. Therefore, it won't work. Case Closed...
"You have enemies? Good. That means you've stood up for something, sometime in your life." --- Winston Churchill
User avatar
RatkinHHK
Experienced User
Experienced User
 
Posts: 72
Joined: Tue Nov 11, 2014 6:06 pm
Blog: View Blog (0)


Re: This is the evilest thing I can imagine! [C version]

Post by cyberdrain on Fri Dec 12, 2014 12:09 pm
([msg=85812]see Re: This is the evilest thing I can imagine! [C version][/msg])

Oh come on, there's more fun where this came from. You could try to remove quotes from a string and use that to create cryptic error-messages. Maybe you could create a pointer based on some kind of weird character and get that to show problems much later in the program? Or do some string manipulation with a string that includes broken characters? It's a good idea, but it needs more work :)
Free your mind / Think clearly
User avatar
cyberdrain
Expert
Expert
 
Posts: 2160
Joined: Sun Nov 27, 2011 1:58 pm
Blog: View Blog (0)



Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests