Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Newbie needs help. Java virus

Hey, I'm new to the java programming and I have been learning about viruses also. So i'm trying to make a virus in java, that will search for the main method of a class and if there is a main class then it would alter the data of the arrays and all the other data variables present in that main class. So any ideas, help is welcome. 

PS. I know its a stupid idea but help me out in it. Thanks.
Java reflections allow you to load classes at runtime so that might be a good starting point.
You won't be able to make proper malware with Java tho.
Hey I have a signature.
(Dec 19, 2017 07:46 AM)Sogomn Wrote:  Java reflections allow you to load classes at runtime so that might be a good starting point.
You won't be able to make proper malware with Java tho.

yeah because of the limitations of java, thanks btw
(Dec 19, 2017 10:16 AM)N33D3DR3LI3F Wrote:  yeah because of the limitations of java, thanks btw

Well with the Java Native Interface you could get around those issues, but you would still have to dive into a little bit of C or C++ programming. Of course with the amount of native programming necessary, you might as well just write the whole damn thing in C++.
"I shot a boy the other day, but it was in Florida so it was ok." -America
You can use a bytecode manipulation API like ASM, BCEL, JavaAssist & ByteBuddy to edit method bodies at runtime.
Update: you're not even needing to change method bodies so it could be done with reflection, use a ClassLoader to load the class and then create a new instance using reflection and then change the fields


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by ๖ۣۜSaadiJun 20, 2018 10:50 AM 2 242 Jun 20, 2018 10:50 AM
Last Post: Tenno
[Java] by ejshadowJun 16, 2016 05:04 AM 7 409 Jun 16, 2016 05:04 AM
Last Post: ejshadow
[.NET] by TholekDec 6, 2014 03:26 PM 5 125 Dec 6, 2014 03:26 PM
Last Post: Alison Wonderland