Obscuring Information in Function Calls

While the usefulness of this is questionable, it is possible to obscure valid information in a bogus function call. Check out the following code:

class Example
	def new(*args)
		puts "Got data: " + args[1] if method_name == :new
	end
end

You can then write the following code:

Example.new("127.0.0.1", 1342)

And it should print out “127.0.0.1”. What’s more, the actual call looks like an internet connection, not something that might print something. Again, the usefulness of this is questionably, but it could be useful.

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: