Question
HACKING ATM IN JAVA Basically, what I need to do is to u se reflection to Hack into an ATM so you can withdraw as
HACKING ATM IN JAVA
Basically, what I need to do is to use reflection to "Hack" into an ATM so you can withdraw as much cash as the machine has. I have the starter code from Card.java class that needs to be modified in order to make the whole file work. You need to use getDeclaredField to get the fields, set them to be accessible, used get() and set() to get moneyInMachine and set userBalance to that value in order to find members and hack into the atm. No need for creating ATM class file or any other new classes.
STARTING CODE:
public class Card { private static String name = "Johnny Cash"; // Card holdersname private static int cardNumber = 123456789; // Card holders number private static int accountNumber = 978945; // Account number private static int pinNumber = 1234; // Pin Number private static int messageKey = 832923932; // Secret Message Key Encrypted private static int messageResult = 13439; // Secret Message Key Decrypted // Swipe method, this method takes in an ATM object and returns the cards data if the ATM // is considered a valid one or returns null if the ATM is found to be invalid.
public static ATM.Data swipe(ATM anATM) { int result = anATM.applyDecryption(messageKey); if(result == messageResult) { return new ATM.Data(cardNumber, accountNumber, name, pinNumber); } return null; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started