Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package se.proxus;
- import java.awt.image.BufferedImage;
- import java.io.BufferedReader;
- import java.io.ByteArrayInputStream;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.IOException;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Scanner;
- import javax.imageio.ImageIO;
- import org.apache.commons.codec.binary.Base64;
- public class Main {
- public static void main(String[] args) {
- System.out.println("Yes hello, we're going to be decoding this file like it's fucking new years eve, biatch.");
- /*try {
- saveImage(decodeToImage(readFile("F:/Oliver/Misc/kony.txt")));
- } catch (IOException e) {
- e.printStackTrace();
- }*/
- try {
- for (String data : getNameAndEncryption("F:/Oliver/Misc/osu.txt")) {
- //System.out.println(data);
- String[] konyfy = data.split(":§:");
- saveImage(decodeToImage(konyfy[1]), "F:/Oliver/Misc/osu decrypted images/" + konyfy[0]);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.out.println("Wow, you did it, good job!");
- }
- public static BufferedImage decodeToImage(String imageString) {
- BufferedImage image = null;
- byte[] imageByte;
- try {
- imageByte = Base64.decodeBase64(imageString);
- ByteArrayInputStream bis = new ByteArrayInputStream(imageByte);
- image = ImageIO.read(bis);
- bis.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return image;
- }
- public static File saveImage(BufferedImage bufferedImage, String fileName) {
- File outputfile = new File(fileName + ".png");
- try {
- ImageIO.write(bufferedImage, "png", outputfile);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return outputfile;
- }
- public static String readFile(String file) throws IOException {
- BufferedReader br = new BufferedReader(new FileReader(file));
- String everything = "";
- try {
- StringBuilder sb = new StringBuilder();
- String line = br.readLine();
- while (line != null) {
- sb.append(line);
- line = br.readLine();
- }
- everything = sb.toString();
- } finally {
- br.close();
- }
- return everything;
- }
- public static ArrayList<String> getNameAndEncryption(String fileName) {
- File file = new File(fileName);
- String line = "";
- ArrayList<String> testArray = new ArrayList<String>();
- String swag = "";
- boolean canGo = false;
- List<String> tempArray = new ArrayList<String>();
- if (file.exists()) {
- BufferedReader fileReader;
- try {
- fileReader = new BufferedReader(new FileReader(file));
- try {
- while ((line = fileReader.readLine()) != null) {
- if (line.startsWith(" <data name=")) {
- swag = line.split("\"")[1] + ":§:";
- }
- /*if (line.startsWith(" <value>") && !line.contains("microsoft") && !line.contains("2.0</value>") && !line.contains("<value>System.Resources")) {
- String swell = line + "\r\n";
- List<String> tempArray = new ArrayList<String>();
- swag = swag + ":§:" + swell.replace(" ", "");
- }*/
- if (line.startsWith(" ")) {
- tempArray.add(line.split(" ")[1]);
- } if (line.equals("</value>"))
- canGo = true;
- if (canGo) {
- swag = swag + tempArray.toString().replace(", ", "").replace("[", "").replace("]", "");
- }
- if (!testArray.contains(swag) && canGo) {
- testArray.add(swag);
- tempArray.clear();
- canGo = false;
- }
- }
- fileReader.close();
- } catch (Exception exception) {
- exception.printStackTrace();
- }
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- }
- return testArray;
- }
- }
Add Comment
Please, Sign In to add comment