From 35090aaa6783a41332489209c514181937895f0e Mon Sep 17 00:00:00 2001 From: William Barkoff Date: Fri, 5 Jun 2020 23:23:23 -0400 Subject: [PATCH] update readme and writeup --- README.md | 2 +- WRITEUP.md | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8e7639d..a8fd3f1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # HackDalton: Decompile ## Problem: -I found this program online, but it just seems to spit out garbage whenever I run it. Can you find the flag? \ No newline at end of file +I found this program online, but I keep getting unlucky and not getting a flag. Can you help? \ No newline at end of file diff --git a/WRITEUP.md b/WRITEUP.md index 3e14b2f..1565553 100644 --- a/WRITEUP.md +++ b/WRITEUP.md @@ -17,15 +17,17 @@ class Program { } public static void main(String[] var0) { - String var1 = "hackDalton{just_4_l1ttl3_j4v4_nfM-qY3Nr5}"; - StringBuilder var2 = new StringBuilder(); - Random var3 = new Random(); - - for(int var4 = 0; var4 < var1.length(); ++var4) { - var2.appendCodePoint(var1.charAt(var4) + (char)var3.nextInt(255)); + int[] var1 = new int[]{164, 157, 159, 167, 128, 157, 168, 176, 171, 170, 183, 166, 177, 175, 176, 155, 112, 155, 168, 109, 176, 176, 168, 111, 155, 166, 112, 178, 112, 155, 170, 162, 137, 105, 173, 149, 111, 138, 174, 113, 185}; + Random var2 = new Random(); + if (var2.nextInt(256) == 257) { + for(int var3 = 0; var3 < var1.length; ++var3) { + int var4 = var1[var3] - 60; + System.out.print((char)var4); + } + } else { + System.out.println("Sorry, you got unlucky, no flag for you."); } - System.out.println(var2); } }