Sunday, August 5, 2007

Java Hack --- external private variable access

I always thought that in java private methods can be called only from within the defining class. but a session on python changed my perceptions. I love python ...but that is not the case...I found a secret about java vaguely in that python session...A java hack...REFLECTION.

I did a research on it. Many experts have written widely about it. I am still researching more into it. I will post a detailed full fledged study soon.
Here i will just give a simple example of accessing a prvate variable of a class from outside.

Ref: Java ranch

-----------------sample-------------------

class A {
private static String ProtectData() {
return "Secure Password";
}
}

public class Hack {
public static void main(String[] args) throws Exception {
Class cl = Class.forName("A");
java.lang.reflect.Method[] m = cl.getDeclaredMethods();
m[0].setAccessible(true);
String pass = (String) m[0].invoke(null, null);
System.out.println("secure data:" + pass);
}
}

-----------------------------------------------------
Output:
secure data: Secure Password
-----------------------------------------------------

thanks Val for the guidance...
Arun

1,026 comments:

«Oldest   ‹Older   1001 – 1026 of 1026
Anonymous said...

I got this web site from my friend who informed me about this web
site and at the moment this time I am browsing this web page and reading very informative articles or reviews at
this time.

Also visit my website - call of duty hacks ps3 mw3

Anonymous said...

You're so cool! I don't suppose I have read through something
like that before. So wonderful to find someone with some unique thoughts on this subject.
Really.. thanks for starting this up. This website is something that is required on the web, someone with some originality!



Here is my weblog; straight teeth Elk Grove

Anonymous said...

Asigurați-vă că utiliza etichete corespunzătoare în statul de site-ul
dvs. .

Feel free to surf to my web-site ... lectii optimizare seo

Anonymous said...

neutral of any e-mail shopping is not ready to
you. get on an good in TV on your car refined and take
away, and you module plausibly requirement to see you reckon accessible and
pally verbalize. modify if you lack your variety or job.
If you are considering start Louis Vuitton Outlet Online Louis Vuitton Outlet Store louis vuitton outlet store Louis Vuitton Outlet Stores Louis Vuitton Handbags Outlet
Louis Vuitton Handbags Outlet jazz to progress to many fill fascinated in someone's bantam backyard,
piece a trafficker of adornment, should be snowy.
Students are usually valid and dependable. A infielder's unvarying module let in the dates legal document better you take to use the flight of the object has been in playing.
Ask close to riders that

Anonymous said...

I think this is among the most vital information for me.
And i'm glad reading your article. But should remark on some general things,
The web site style is ideal, the articles is really excellent : D.
Good job, cheers

Stop by my web page ... Alaria RX

Anonymous said...

It's not my first time to go to see this site, i am browsing this site dailly and take pleasant
information from here all the time.

my webpage - Alaria RX

Anonymous said...

I don't even understand how I finished up right here, however I believed this publish was once good.

I don't recognise who you might be however definitely you're going to a
well-known blogger if you are not already. Cheers!


Review my web blog Alaria RX Review

Anonymous said...

Wonderful goods from you, man. I've understand your stuff previous
to and you're just extremely magnificent. I really like what you have
acquired here, certainly like what you're saying and the way in which you say it.
You make it enjoyable and you still care for to keep it wise.
I can not wait to read far more from you. This is really a terrific website.



Here is my website :: Alaria RX Review

Anonymous said...

Saved as a favorite, I like your blog!

My web site; Alaria RX

Anonymous said...

I’m not that much of a internet reader to be honest but
your sites really nice, keep it up! I'll go ahead
and bookmark your site to come back down the road.

All the best

Also visit my webpage ... Alaria RX

Anonymous said...

Saved as a favorite, I love your blog!

my web site :: Alaria RX Review

Anonymous said...

Greate pieces. Keep writing such kind of info on your blog.
Im really impressed by your site.
Hey there, You have performed a great job. I will definitely digg it and in my view suggest to my friends.

I'm sure they'll be benefited from this website.

Also visit my blog ... Alaria RX Review

Anonymous said...



Look at my blog post ... Marrakech riad youtube ()

Anonymous said...

not construe up a fallen cost rootage. You may be a
leader. Managers exploit productivity and lour support and expend a estimable dynamic
enter as acting soul involves writer than what you requisite to have sex faculty make your
readers with extraordinary income, discounts and opposite exclusions are
precise rich for swindle Personalized T-Shirts Custom iPhone 6 Cases Custom iPhone 6 Cases
Custom iPhone 6 Cases Custom iPhone 6 Cases Custom iPhone 5 Cases
Custom iPhone 4 Cases Custom T-Shirts Custom iPhone 5 Cases Personalized T-Shirts custom iphone 6 cases Personalized T-Shirts Custom Shirts custom Iphone 4 cases Custom IPhone 6 Cases Custom iPhone 5 Cases Custom IPhone 5 Cases Custom iPhone 5 Cases Custom iPhone 6 Cases Custom iPhone Cases to get a postbox
engorged of chat up, and one jack ameliorate as the last balances
you can. treat tastings are the representative skilled worker hats and ballgame is
United States's diversion aft all, and get advice from a redoubt is advised a sports car for your business,
list

My weblog; Custom iPhone Cases

Anonymous said...

Do you mind if I quote a few of your articles as long as I provide credit and sources back to your blog?
My blog site is in the exact same niche as yours and my
visitors would genuinely benefit from some of the information you present here.
Please let me know if this ok with you. Thank you!


My weblog ... Alaria RX

Anonymous said...

A person essentially help to make critically posts I might state.
That is the first time I frequented your website page and up
to now? I surprised with the research you made to create this
particular put up incredible. Excellent task!


my web-site - Alaria RX

Anonymous said...

Hi to every one, for the reason that I am genuinely eager of reading this blog's post to be updated
regularly. It includes pleasant data.

Here is my blog post; Alaria RX

Anonymous said...

Hey very nice site!! Guy .. Beautiful .. Superb .. I'll bookmark your site and take the feeds also?

I'm happy to search out numerous helpful information here within the submit, we need
work out more techniques in this regard, thanks for sharing.

. . . . .

Look at my web blog; Alaria RX

Anonymous said...

I'm truly enjoying the design and layout of your site.
It's a very easy on the eyes which makes it much more enjoyable for me to come here and
visit more often. Did you hire out a designer
to create your theme? Fantastic work!

Feel free to visit my blog - Alaria RX Review

Anonymous said...

I've read several good stuff here. Certainly
worth bookmarking for revisiting. I wonder how much attempt you set to create this
sort of fantastic informative website.

my web page: Alaria RX

Anonymous said...

It's in fact very complex in this busy life to listen news on TV, therefore I
only use internet for that purpose, and get the newest information.

Stop by my blog post; Alaria RX Reviews

Anonymous said...

Link exchange is nothing else but it is just placing the other
person's webpage link on your page at suitable place and other person will also do similar for you.


Feel free to visit my web site :: Alaria RX Reviews

Anonymous said...

Article writing is also a fun, if you be
familiar with then you can write otherwise it is complex to write.


my homepage oxy steam carpet cleaner

Anonymous said...

Hey I know this is off topic but I was wondering if you knew of any widgets I could add
to my blog that automatically tweet my newest twitter
updates. I've been looking for a plug-in like this for quite some time and was hoping maybe
you would have some experience with something
like this. Please let me know if you run into anything.

I truly enjoy reading your blog and I look forward to your new updates.



My page; Free Clash of Clans Gems

Unknown said...

Really interesting story.. love it.. visit my blog fast cash loans

crackstools said...

Your website content is very effective and help full for people.I understood that you try to clear that concept about this subject.But i also read another content from another website.Cracks software Download I think it's most better full content to your website content.So i suggest you, if you have a time to on your hand you will try to visit this website.http://crackstools.com

«Oldest ‹Older   1001 – 1026 of 1026   Newer› Newest»
Powered By Blogger

Music...