1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
| import time, sys, hashlib class vm: def __init__(self): self.dict = {} self.codeparameter = [] self._input = '' self.d = [[],[],[],[],[]] self.e = 65 self.flag1 = 0 def _add(self, key): def の(f): self.dict[key] = f return f return の def _get(self, key): return self.dict.get(key) def _run(self): i = 0 while i < 28: a = self.codeparameter[i][0] b = self.codeparameter[i][1] c = self.codeparameter[i][2] fun = self._get(a) fun(b, c) i += 1 _vm = vm() @_vm._add('_init') def f1(a, b): _vm.d[a] = b @_vm._add('_output') def f2(a, b): \ \ \ \ \ \ if a == 3 and _vm.flag1 == 0: print((_vm.flag), end='') \ \ @_vm._add('_exit()') def f3(a, b): _vm.flag1 = 0 \ \ _vm._input = input() @_vm._add('_stop') def f5(a, b): time.sleep(a) @_vm._add('_cmp') def f6(a, b): if len(_vm._input) % 2 != 0: _vm.flag1 = 1 for i in _vm._input: if ord(i) > 52 or ord(i) < 48: _vm.flag1 = 1 str1 = ''.join(_vm._input) x = str(hashlib.new('md5', bytes((str1), encoding='utf8')).hexdigest()) if x[:6] != 'e3a912': _vm.flag1 = 1 _vm.flag = x @_vm._add('inputeffect') def f7(a, b): j = 0 for i in range(0, len(_vm._input), 2): j += 1 a = int(_vm._input[i]) b = int(_vm._input[(i + 1)]) _vm.d[a][b] = j @_vm._add('_cmp2') def f8(a, b): if _vm.d[0][1] != 24 or _vm.d[4][3] != 2: _vm.flag1 = 1 if _vm.d[0][2] != 1 or _vm.d[2][3] != 20: _vm.flag1 = 1 if _vm.d[1][0] != 23 or _vm.d[3][4] != 3: _vm.flag1 = 1 @_vm._add('_cmp3') def f9(a, b): e = 0 if b == -1: for i in range(5): e += _vm.d[a][i] if e != _vm.e: _vm.flag1 = 1 else: for i in range(5): e += _vm.d[i][b] if e != _vm.e: _vm.flag1 = 1 _vm.codeparameter = [ [ '_output', 'welcome baby~ ', 0], [ '_output', 'input your flag~:', 0], [ '_input', 0, 0], [ '_output', 'your input is:', 0], [ '_output', 1, 0], [ '_output', "let's check......", 0], [ '_stop', 0.5, 0], [ '_init', 0, [0 for i in range(5)]], [ '_init', 1, [0 for i in range(5)]], [ '_init', 2, [0 for i in range(5)]], [ '_init', 3, [0 for i in range(5)]], [ '_init', 4, [0 for i in range(5)]], [ '_cmp', 0, 0], [ 'inputeffect', 0, 0], [ '_cmp2', 0, 0], [ '_cmp3', 0, -1], [ '_cmp3', 1, -1], [ '_cmp3', 2, -1], [ '_cmp3', 3, -1], [ '_cmp3', 4, -1], [ '_cmp3', 0, 0], [ '_cmp3', 0, 1], [ '_cmp3', 0, 2], [ '_cmp3', 0, 3], [ '_cmp3', 0, 4], [ '_output', 'Goodjob!', 0], [ '_output', 'The flag is vnctf{', 0], [ '_output', 3, 0], [ '_output', '}', 0], [ '_exit()', 0, 0]]
_vm.flag1 = 0 _vm._run()
|