j2dex-jar2dex classes.dex -o classes.jar
I opened the jar file using the Archive Manager. I could see the contents of the jar file. I navigated the directory structure mine was picoapp453-picoctf-com-picoapp, then I selected ToasterActivity.class because it looked interesting to me. Then I used the command line to decompile the class file for me so that I could read it.
javap -c ToasterActivity.class
public void displayMessage(android.view.View);
Code:
0: aload_0
1: invokevirtual #40; // Method getApplicationContext:()Landroid/content/Context;
4: ldc #42; // String Toasters don't toast toast, toast toast toast!
6: iconst_1
7: invokestatic #48; // Method android/widget/Toast.makeText:(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
10: invokevirtual #51; // Method android/widget/Toast.show:()V
13: ldc #53; // String Debug tag
15: aload_0
16: getfield #34; // Field mystery:Ljava/lang/String;
19: invokestatic #59; // Method android/util/Log.d:(Ljava/lang/String;Ljava/lang/String;)I
22: pop
23: return
Note the Debug tag comment on Code 13. Also note the string on Code 4. They were looking for the string, "Toasters don't toast toast, toast toast toast!"
So I found debug info. The flag was in this class as well. The flag was in this part.
public picoapp453.picoctf.com.picoapp.ToasterActivity();
Code:
0: aload_0
1: invokespecial #10; // Method android/support/v7/app/ActionBarActivity."<init>":()V
4: aload_0
5: new #12; // class java/lang/String
8: dup
9: bipush 33
11: newarray char
13: dup
14: iconst_0
15: ldc #13; // int 102
17: castore
18: dup
19: iconst_1
20: ldc #14; // int 108
22: castore
23: dup
24: iconst_2
25: ldc #15; // int 97
27: castore
28: dup
29: iconst_3
30: ldc #16; // int 103
32: castore
33: dup
34: iconst_4
35: ldc #17; // int 32
37: castore
38: dup
39: iconst_5
40: ldc #18; // int 105
42: castore
43: dup
44: bipush 6
46: ldc #19; // int 115
48: castore
49: dup
50: bipush 7
52: ldc #20; // int 58
54: castore
55: dup
56: bipush 8
58: ldc #17; // int 32
60: castore
61: dup
62: bipush 9
64: ldc #21; // int 119
66: castore
67: dup
68: bipush 10
70: ldc #22; // int 104
72: castore
73: dup
74: bipush 11
76: ldc #15; // int 97
78: castore
79: dup
80: bipush 12
82: ldc #23; // int 116
84: castore
85: dup
86: bipush 13
88: ldc #24; // int 95
90: castore
91: dup
92: bipush 14
94: ldc #25; // int 100
96: castore
97: dup
98: bipush 15
100: ldc #26; // int 111
102: castore
103: dup
104: bipush 16
106: ldc #27; // int 101
108: castore
109: dup
110: bipush 17
112: ldc #19; // int 115
114: castore
115: dup
116: bipush 18
118: ldc #24; // int 95
120: castore
121: dup
122: bipush 19
124: ldc #23; // int 116
126: castore
127: dup
128: bipush 20
130: ldc #22; // int 104
132: castore
133: dup
134: bipush 21
136: ldc #27; // int 101
138: castore
139: dup
140: bipush 22
142: ldc #24; // int 95
144: castore
145: dup
146: bipush 23
148: ldc #14; // int 108
150: castore
151: dup
152: bipush 24
154: ldc #26; // int 111
156: castore
157: dup
158: bipush 25
160: ldc #16; // int 103
162: castore
163: dup
164: bipush 26
166: ldc #28; // int 99
168: castore
169: dup
170: bipush 27
172: ldc #15; // int 97
174: castore
175: dup
176: bipush 28
178: ldc #23; // int 116
180: castore
181: dup
182: bipush 29
184: ldc #24; // int 95
186: castore
187: dup
188: bipush 30
190: ldc #19; // int 115
192: castore
193: dup
194: bipush 31
196: ldc #15; // int 97
198: castore
199: dup
200: bipush 32
202: ldc #29; // int 121
204: castore
205: invokespecial #32; // Method java/lang/String."<init>":([C)V
208: putfield #34; // Field mystery:Ljava/lang/String;
211: return
So I found debug info. The flag was in this class as well. The flag was in this part.
public picoapp453.picoctf.com.picoapp.ToasterActivity();
Code:
0: aload_0
1: invokespecial #10; // Method android/support/v7/app/ActionBarActivity."<init>":()V
4: aload_0
5: new #12; // class java/lang/String
8: dup
9: bipush 33
11: newarray char
13: dup
14: iconst_0
15: ldc #13; // int 102
17: castore
18: dup
19: iconst_1
20: ldc #14; // int 108
22: castore
23: dup
24: iconst_2
25: ldc #15; // int 97
27: castore
28: dup
29: iconst_3
30: ldc #16; // int 103
32: castore
33: dup
34: iconst_4
35: ldc #17; // int 32
37: castore
38: dup
39: iconst_5
40: ldc #18; // int 105
42: castore
43: dup
44: bipush 6
46: ldc #19; // int 115
48: castore
49: dup
50: bipush 7
52: ldc #20; // int 58
54: castore
55: dup
56: bipush 8
58: ldc #17; // int 32
60: castore
61: dup
62: bipush 9
64: ldc #21; // int 119
66: castore
67: dup
68: bipush 10
70: ldc #22; // int 104
72: castore
73: dup
74: bipush 11
76: ldc #15; // int 97
78: castore
79: dup
80: bipush 12
82: ldc #23; // int 116
84: castore
85: dup
86: bipush 13
88: ldc #24; // int 95
90: castore
91: dup
92: bipush 14
94: ldc #25; // int 100
96: castore
97: dup
98: bipush 15
100: ldc #26; // int 111
102: castore
103: dup
104: bipush 16
106: ldc #27; // int 101
108: castore
109: dup
110: bipush 17
112: ldc #19; // int 115
114: castore
115: dup
116: bipush 18
118: ldc #24; // int 95
120: castore
121: dup
122: bipush 19
124: ldc #23; // int 116
126: castore
127: dup
128: bipush 20
130: ldc #22; // int 104
132: castore
133: dup
134: bipush 21
136: ldc #27; // int 101
138: castore
139: dup
140: bipush 22
142: ldc #24; // int 95
144: castore
145: dup
146: bipush 23
148: ldc #14; // int 108
150: castore
151: dup
152: bipush 24
154: ldc #26; // int 111
156: castore
157: dup
158: bipush 25
160: ldc #16; // int 103
162: castore
163: dup
164: bipush 26
166: ldc #28; // int 99
168: castore
169: dup
170: bipush 27
172: ldc #15; // int 97
174: castore
175: dup
176: bipush 28
178: ldc #23; // int 116
180: castore
181: dup
182: bipush 29
184: ldc #24; // int 95
186: castore
187: dup
188: bipush 30
190: ldc #19; // int 115
192: castore
193: dup
194: bipush 31
196: ldc #15; // int 97
198: castore
199: dup
200: bipush 32
202: ldc #29; // int 121
204: castore
205: invokespecial #32; // Method java/lang/String."<init>":([C)V
208: putfield #34; // Field mystery:Ljava/lang/String;
211: return
I had to change each of those decimals in the comments (the ones after the //) into ascii characters. The flag was: what_does_log_cat_say
No comments:
Post a Comment