---
# System prepended metadata

title: HTB apocalypse 2025

---

# EncryptedScroll  
```python=
n=b'IUC|t2nqm4`gm5h`5s2uin4u2d~'
for i in n:
    print(chr(i-1),end='')
#HTB{s1mpl3_fl4g_4r1thm3t1c}
```
# EndlessCycle  
```python=
from Crypto.Util.number import*

n=[0xC5AD9EB6, 0xD5DFFA92, 0xC7DCA8A1, 0xE18BA4CE, 0xE1DCA28A, 0xD29DFA89, 0x0000B79A]
l=b''
for i in n: l+=(long_to_bytes(0xBEEFCAFE^i)[::-1])
print(l)
#b'HTB{l00k_b3y0nd_th3_w0rld}\xef\xbe'
```
# Impossimaze  
```python=
from random import shuffle
from hashlib import sha256
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
def scramble(a, b):
    """Apply permutation a to list b"""
    return [b[a[i]] for i in range(len(a))]

def super_scramble(a, e):
    """Apply permutation a to the identity permutation e times using square-and-multiply algorithm"""
    b = list(range(len(a)))
    while e:
        if e & 1:
            b = scramble(b, a)
        a = scramble(a, a)
        e >>= 1
    return b

def unscramble_message(scrambled_message, e, n):
    """Recover the original message from scrambled_message"""
    # Find cycles in scrambled_message
    visited = [False] * n
    cycles = []
    
    for i in range(n):
        if not visited[i]:
            cycle = []
            current = i
            while not visited[current]:
                visited[current] = True
                cycle.append(current)
                current = scrambled_message[current]
            cycles.append(cycle)
    
    # Construct the original message by working with each cycle
    original_message = [0] * n
    
    for cycle in cycles:
        cycle_length = len(cycle)
        # Calculate the inverse of e modulo cycle_length
        e_inv = pow(e, -1, cycle_length)
        
        # For each position in the cycle, calculate its predecessor in the original permutation
        for i in range(cycle_length):
            # If we shift by e in the original, we get the scrambled position
            # So to get the original, we shift by e^(-1)
            source_idx = i
            target_idx = (i + e_inv) % cycle_length
            original_message[cycle[source_idx]] = cycle[target_idx]
    
    return original_message

def main():
    n = 0x1337  # 4919 in decimal
    e = 0x10001  # 65537 in decimal
    
    # In a real scenario, scrambled_message would be given
    # For testing, let's generate a scrambled_message
    
    # Assume scrambled_message is given (for this example, let's use a simple permutation)
    scrambled_message = scrambled_message = [57, 570, 374, 3616, 1775, 1107, 1997, 4868, 1882, 1314, 738, 3255, 1823, 3830, 912, 3191, 3471, 13, 4714, 3569, 4432, 3498, 3136, 2907, 1145, 4049, 596, 3904, 2882, 2839, 3881, 4759, 3015, 342, 3559, 4749, 140, 2032, 4460, 1890, 817, 1759, 2657, 1684, 3792, 263, 4280, 2884, 1946, 3417, 2298, 4772, 2972, 4410, 3077, 1769, 47, 2496, 3405, 1674, 2423, 4687, 1011, 764, 2103, 1235, 2212, 3763, 4189, 3556, 3885, 960, 1201, 720, 4615, 3126, 692, 3178, 4186, 1881, 1222, 983, 2052, 3968, 2570, 4824, 2260, 228, 1691, 4577, 2467, 3424, 3296, 3984, 3793, 1486, 3679, 1651, 4291, 4293, 2058, 2237, 4470, 3976, 4483, 2426, 782, 3944, 2435, 4832, 1494, 879, 1308, 2599, 849, 777, 1322, 1020, 4076, 3391, 491, 2810, 1565, 3825, 3972, 1383, 1860, 2398, 1361, 593, 625, 4157, 1472, 652, 3974, 468, 133, 2530, 4163, 3184, 823, 1278, 2714, 4636, 4751, 4058, 2835, 3774, 15, 419, 463, 2601, 4001, 2834, 128, 1112, 2690, 2080, 4676, 327, 3988, 506, 4472, 104, 1856, 1218, 1016, 1430, 1800, 3819, 1194, 504, 3860, 4037, 718, 3606, 786, 3226, 2862, 78, 2904, 1302, 2897, 1392, 648, 4886, 1099, 3578, 1896, 1599, 290, 260, 2095, 3963, 991, 4004, 4437, 1163, 583, 4860, 2615, 3495, 4773, 662, 1263, 1441, 486, 829, 1720, 636, 1382, 1761, 337, 51, 1076, 929, 968, 1057, 3784, 2278, 2387, 34, 1723, 8, 1244, 3565, 288, 988, 1329, 4527, 2893, 4231, 1654, 1927, 203, 2381, 1567, 2672, 3797, 1071, 976, 198, 982, 4298, 1173, 3466, 4776, 3421, 2648, 1542, 2492, 1341, 299, 3461, 4287, 1215, 4345, 949, 1295, 1169, 2847, 1141, 4752, 113, 967, 700, 2415, 3145, 207, 3513, 2350, 1647, 4785, 2471, 3491, 4820, 3711, 1601, 148, 3515, 3059, 2513, 2767, 769, 4711, 1933, 1930, 185, 3080, 305, 3634, 3179, 396, 774, 3499, 118, 3891, 3216, 3485, 1174, 3663, 4376, 4628, 182, 4601, 4222, 4729, 1936, 3800, 4834, 806, 3482, 1042, 1387, 623, 1658, 3866, 256, 2359, 2348, 2659, 3981, 1280, 2376, 4081, 2168, 3661, 3092, 2045, 1303, 576, 4816, 1433, 1608, 1593, 433, 1602, 1489, 380, 2993, 3134, 3870, 16, 3707, 4255, 3808, 1661, 4847, 4146, 1552, 2006, 3728, 4358, 574, 326, 2569, 2226, 4689, 4697, 4841, 3540, 4132, 1491, 956, 1962, 3248, 2450, 1758, 1730, 2738, 713, 1183, 3465, 167, 3604, 4899, 3501, 1735, 1298, 3107, 1649, 2608, 535, 108, 4905, 739, 656, 3857, 1682, 736, 1330, 56, 4425, 4365, 3901, 4544, 3827, 3348, 52, 1809, 1864, 2846, 3648, 4683, 3725, 2678, 620, 2259, 3675, 229, 3754, 2995, 2572, 3140, 3315, 119, 3871, 2547, 1748, 1880, 4250, 3917, 180, 4359, 2146, 2141, 3458, 139, 3031, 794, 999, 126, 2524, 4531, 3509, 4442, 4319, 106, 1875, 1803, 3423, 217, 4149, 2424, 811, 3073, 2318, 4466, 490, 1148, 1344, 1683, 1754, 1650, 3740, 4050, 1786, 4070, 4299, 1229, 4692, 3807, 1816, 116, 2697, 2421, 3526, 3274, 121, 2983, 3647, 4763, 4170, 2221, 908, 3762, 49, 2571, 3594, 3148, 4192, 2979, 2619, 3865, 166, 4118, 3629, 4491, 2723, 3520, 1747, 1575, 568, 655, 3853, 3110, 1623, 2716, 298, 1008, 1043, 1315, 693, 3710, 1109, 1784, 3640, 2637, 2971, 141, 1644, 213, 2099, 152, 2881, 2568, 4209, 1058, 4538, 1413, 1247, 4783, 4731, 2674, 1458, 3549, 454, 4102, 3908, 1040, 4074, 1609, 3470, 4643, 3927, 1399, 2353, 6, 1209, 2096, 1419, 4567, 2172, 3671, 2900, 394, 2590, 3462, 3177, 2774, 1483, 2235, 737, 3949, 2990, 2859, 804, 4071, 93, 1213, 4040, 1725, 1607, 1873, 161, 1999, 1120, 483, 800, 1958, 1636, 2193, 4373, 3068, 2803, 4032, 698, 3924, 2702, 846, 4286, 1727, 3128, 3437, 3748, 4623, 2155, 117, 1362, 3847, 2213, 2639, 3132, 1401, 2975, 3704, 1123, 1193, 1289, 2412, 4180, 3618, 1867, 4223, 1738, 129, 178, 1676, 2180, 3779, 88, 4493, 957, 1618, 3601, 4504, 2928, 1610, 2544, 2087, 4404, 3232, 3215, 1084, 114, 3624, 4552, 1187, 3460, 521, 360, 89, 3654, 1925, 2305, 2484, 4012, 892, 2349, 4843, 1496, 1572, 1258, 1447, 2282, 747, 3322, 3896, 2775, 410, 3687, 3213, 2526, 3564, 4315, 1440, 2267, 2150, 542, 3064, 761, 2216, 646, 3325, 4187, 661, 4343, 3999, 2641, 3883, 3364, 3502, 2755, 970, 2932, 1199, 212, 3745, 194, 2761, 3086, 1231, 4575, 4782, 2171, 2602, 1869, 2821, 2261, 248, 4521, 460, 2090, 3803, 417, 985, 3841, 1356, 1915, 3282, 285, 2425, 247, 1225, 2947, 4476, 2825, 2589, 2557, 4530, 4520, 725, 4870, 2363, 3097, 3550, 4289, 2951, 1512, 2843, 3390, 4016, 1955, 2334, 2949, 3150, 3359, 2459, 2274, 250, 2015, 3256, 1497, 1591, 1596, 3918, 4672, 1485, 809, 3085, 2419, 2815, 202, 1595, 4695, 2722, 1090, 3617, 3087, 397, 4066, 1010, 4638, 1508, 253, 4506, 3889, 1742, 4238, 3525, 1182, 4240, 3376, 1868, 2371, 3406, 4008, 2581, 3753, 3118, 3720, 2397, 541, 2281, 3925, 531, 3203, 2358, 332, 1751, 1838, 4259, 234, 4251, 1831, 3317, 2265, 1328, 1947, 3402, 3141, 2495, 2004, 2705, 2082, 4418, 1226, 749, 2922, 4632, 2413, 3996, 1615, 1167, 1325, 381, 4892, 3665, 2241, 330, 3095, 2488, 2268, 4252, 3279, 683, 2302, 3088, 1477, 4696, 516, 481, 2125, 832, 405, 2987, 2478, 3933, 258, 2649, 3777, 3112, 2542, 353, 1032, 3895, 4317, 1097, 2166, 3431, 540, 2756, 5, 4810, 434, 4494, 758, 3416, 3492, 3288, 567, 4085, 3119, 255, 2321, 1745, 4202, 2623, 833, 2676, 3067, 2477, 4863, 2927, 1257, 4394, 3245, 2437, 3923, 4850, 3778, 2952, 3185, 3409, 911, 137, 1443, 4635, 4059, 2643, 4173, 3387, 4443, 2333, 1342, 3169, 1277, 1780, 1932, 2997, 997, 681, 2411, 1421, 578, 1488, 4562, 464, 670, 2912, 1642, 4325, 2853, 768, 1883, 267, 4321, 4795, 3449, 633, 2796, 1678, 4077, 279, 688, 1276, 2002, 935, 3931, 612, 891, 3373, 2482, 4106, 2256, 2137, 98, 2516, 500, 1858, 3103, 1555, 2019, 4798, 4403, 3319, 1624, 62, 4616, 1275, 2670, 690, 3159, 164, 3576, 2331, 1365, 834, 848, 517, 3706, 4705, 4766, 3670, 2652, 676, 3592, 3990, 4500, 3488, 2332, 3212, 3127, 1368, 496, 2379, 2108, 3660, 1144, 3519, 2964, 352, 3445, 4126, 421, 1578, 1037, 3641, 3368, 4649, 1569, 595, 392, 2430, 1292, 4793, 4139, 4915, 1626, 3730, 3173, 2677, 4310, 266, 757, 3905, 3020, 293, 1740, 4086, 4710, 4278, 2610, 1967, 3328, 702, 3170, 4707, 4235, 2929, 97, 1003, 1476, 3407, 169, 1268, 4046, 2521, 445, 4614, 204, 60, 2308, 1294, 4777, 2287, 2284, 1597, 1845, 529, 1972, 2577, 4881, 875, 4671, 4907, 4753, 3749, 2185, 3369, 821, 3382, 548, 1590, 2603, 4790, 812, 887, 2192, 2131, 3512, 102, 2357, 4279, 3278, 2324, 3447, 309, 2063, 501, 4896, 4276, 4895, 3434, 940, 3527, 1311, 1811, 2364, 357, 1625, 1092, 3174, 147, 993, 2038, 699, 3664, 1571, 2956, 1110, 1438, 2075, 4204, 3472, 440, 3642, 2431, 4668, 3335, 4597, 1214, 3299, 1081, 1638, 1687, 1479, 1713, 2454, 4721, 48, 3207, 23, 4028, 3130, 3958, 2295, 1114, 3153, 4160, 3798, 3997, 1734, 3305, 3960, 4357, 1087, 2905, 4737, 2277, 4145, 4010, 367, 1317, 2081, 2890, 1504, 673, 4427, 3397, 4680, 582, 3155, 1388, 2901, 3453, 2326, 2314, 3433, 4833, 2485, 4101, 1014, 3102, 3000, 4878, 3139, 3738, 3946, 2638, 165, 895, 4564, 323, 2863, 2207, 4898, 3858, 2094, 2269, 1360, 1426, 645, 3856, 3455, 3386, 1180, 1926, 4610, 4156, 3420, 1611, 3238, 1619, 1810, 560, 4364, 4185, 951, 880, 4329, 4110, 2556, 2389, 3208, 375, 1151, 1847, 883, 3490, 1726, 2545, 1171, 2957, 2826, 2417, 4535, 1179, 613, 4634, 1070, 4852, 3721, 495, 3836, 4846, 1055, 4872, 1910, 4463, 275, 4883, 4509, 1543, 3560, 4502, 3436, 2490, 1628, 2960, 1475, 3070, 2655, 4637, 1667, 1973, 3668, 1434, 1460, 1951, 824, 320, 1895, 1073, 1534, 4022, 3284, 205, 2887, 4720, 2701, 1640, 3998, 1525, 518, 665, 3775, 1980, 10, 1580, 1353, 803, 850, 1227, 3897, 4909, 81, 4618, 537, 1029, 2554, 3537, 4248, 4864, 467, 4862, 474, 1175, 715, 3209, 2062, 513, 3123, 2640, 4027, 2077, 2407, 2594, 1585, 831, 130, 3394, 4068, 857, 947, 4181, 1995, 3662, 1249, 3351, 471, 566, 1849, 2136, 3392, 4324, 1082, 4645, 1184, 2848, 745, 2104, 2681, 376, 1763, 4826, 4174, 4704, 1752, 1770, 856, 218, 2145, 2223, 3374, 943, 2989, 3046, 1128, 639, 1300, 455, 1178, 3608, 379, 1634, 955, 2713, 4067, 2735, 3324, 1949, 4501, 3055, 4912, 2501, 685, 4438, 2464, 2609, 1833, 3950, 3689, 1852, 4769, 3063, 1874, 4029, 2667, 558, 1518, 3965, 4227, 2812, 3627, 4563, 4746, 2106, 443, 4536, 756, 343, 3012, 4405, 2199, 3295, 2611, 157, 3973, 2751, 1797, 2710, 2962, 4458, 772, 4272, 1132, 4748, 3799, 1795, 4453, 1733, 3316, 112, 3810, 2354, 1038, 2588, 1711, 4478, 4114, 1637, 2251, 3539, 2852, 1924, 100, 873, 2042, 784, 2230, 1251, 3605, 4152, 3840, 390, 3362, 1310, 4123, 2660, 4897, 1796, 3047, 1971, 1708, 3566, 2948, 3956, 2666, 1195, 3585, 1372, 903, 368, 87, 71, 3166, 4652, 4339, 714, 1564, 2009, 3590, 3588, 2272, 84, 2559, 1703, 1929, 160, 2345, 3570, 2910, 4867, 4229, 1943, 3221, 3980, 2996, 1965, 3378, 2064, 4136, 1693, 1021, 2264, 2016, 2849, 1465, 4283, 3921, 1819, 1697, 3481, 325, 219, 3105, 2184, 4265, 3040, 3287, 2532, 4516, 2939, 348, 741, 1729, 4191, 1605, 2122, 143, 2217, 2461, 4885, 3306, 2340, 1709, 3845, 3534, 3849, 1696, 4078, 240, 660, 2858, 4421, 2000, 334, 3639, 3249, 1812, 4354, 1887, 3757, 691, 4806, 2896, 1240, 4607, 2958, 4263, 1086, 2296, 3263, 3497, 4514, 4719, 3922, 3336, 1630, 862, 2346, 4486, 1804, 3483, 1789, 4125, 4622, 3307, 3094, 154, 426, 4323, 432, 4481, 783, 4744, 1106, 1741, 1115, 4007, 3571, 2954, 3677, 588, 4091, 1728, 4025, 4690, 611, 3452, 2691, 1219, 4417, 4511, 401, 2406, 966, 3620, 2941, 507, 4162, 4525, 923, 3071, 1007, 1389, 4670, 2613, 2085, 2351, 627, 4911, 3192, 3747, 4168, 3698, 3091, 2132, 494, 4499, 3479, 1900, 4725, 1885, 2508, 2134, 2786, 4117, 680, 1449, 2001, 575, 4456, 1986, 3310, 3154, 3603, 2500, 2626, 355, 3301, 965, 4754, 2091, 4620, 438, 1006, 4825, 3718, 3929, 2008, 1200, 3722, 3009, 1369, 876, 2731, 771, 67, 4459, 3246, 2787, 188, 2819, 3863, 1375, 1045, 3804, 2679, 1406, 3552, 4855, 1545, 273, 2451, 3312, 3833, 675, 2130, 1012, 1561, 2175, 2867, 4300, 3467, 882, 206, 928, 4150, 3731, 1643, 1516, 4778, 1902, 2899, 3144, 3964, 3411, 1367, 4266, 1901, 386, 3082, 4856, 3428, 779, 3484, 562, 2914, 3400, 4331, 1989, 959, 170, 1296, 4143, 2483, 3022, 637, 1839, 1743, 4890, 668, 1783, 1098, 1705, 324, 1533, 3697, 2894, 1993, 1736, 4842, 2937, 3176, 1299, 865, 2980, 4419, 1274, 4679, 159, 12, 282, 1604, 2309, 4144, 4281, 4497, 4664, 2198, 2824, 2083, 1771, 1023, 2497, 79, 2777, 4910, 4762, 1064, 1260, 1418, 1841, 291, 1541, 1211, 1425, 271, 3164, 4155, 2630, 4708, 1842, 4873, 3220, 4682, 998, 874, 2689, 503, 1850, 658, 2011, 447, 2138, 371, 3930, 2875, 1354, 450, 4760, 1192, 3672, 3864, 3360, 2051, 345, 579, 563, 3066, 4219, 3076, 801, 1036, 3151, 303, 1221, 3254, 1269, 2829, 973, 2462, 942, 3878, 2698, 4598, 3133, 2634, 3822, 2797, 1405, 4197, 805, 4706, 2311, 3321, 659, 2231, 2707, 634, 1712, 3331, 1513, 3051, 3909, 4273, 978, 1370, 1004, 1731, 294, 2312, 4377, 4243, 4267, 408, 66, 3875, 969, 321, 1287, 2519, 4587, 3967, 2970, 272, 3649, 703, 796, 701, 359, 3375, 885, 640, 4480, 2720, 793, 163, 2112, 2592, 243, 4583, 4496, 3714, 2593, 3666, 4109, 1435, 1487, 958, 3829, 4080, 3167, 3222, 4866, 2457, 3767, 561, 4653, 2891, 2504, 1888, 3794, 508, 1603, 55, 4072, 223, 4130, 3680, 1539, 798, 2982, 4657, 932, 2636, 4831, 3916, 1872, 4448, 158, 1284, 1984, 3412, 530, 653, 2595, 626, 3530, 4352, 2428, 4302, 35, 3340, 1717, 4270, 4857, 3195, 2190, 3994, 3379, 1721, 4388, 1165, 1840, 4277, 4799, 3339, 1846, 2093, 1600, 123, 4539, 1467, 2642, 68, 2466, 1124, 2280, 3265, 1309, 1617, 4420, 2718, 1547, 547, 2522, 511, 2656, 2014, 4519, 3621, 686, 2229, 4176, 395, 3932, 4171, 1027, 2433, 3090, 4543, 2347, 4105, 224, 2152, 602, 3157, 609, 4367, 4356, 2959, 2328, 4063, 2833, 1060, 2215, 2283, 4334, 1865, 573, 1319, 220, 4362, 1878, 710, 961, 835, 242, 4141, 556, 1338, 1985, 2806, 1917, 1054, 4666, 3716, 2169, 4172, 2764, 3955, 1876, 4761, 4342, 925, 4124, 3398, 422, 4871, 2335, 2688, 2943, 4203, 3788, 4196, 4407, 2646, 4858, 2297, 1689, 74, 2319, 216, 539, 3561, 4423, 2367, 3600, 4164, 813, 3637, 2527, 2888, 268, 2822, 1065, 1536, 2794, 2336, 3907, 4107, 3198, 3448, 435, 2227, 3111, 3688, 1125, 2396, 2020, 594, 3113, 3508, 946, 1127, 2053, 3518, 3342, 1923, 4648, 3487, 4033, 2805, 3772, 2299, 1246, 2300, 4103, 1050, 39, 3786, 2931, 667, 1102, 2066, 456, 630, 1859, 1306, 669, 3356, 1801, 2443, 3419, 4341, 2086, 2440, 2985, 3542, 4730, 3820, 1794, 3977, 244, 2942, 2514, 3244, 952, 4570, 1166, 3104, 682, 3619, 1078, 1848, 3318, 4474, 4151, 3879, 1095, 1206, 1210, 1131, 950, 4650, 2629, 2854, 105, 2940, 350, 2518, 2558, 83, 2205, 728, 1468, 297, 4786, 32, 1645, 340, 2654, 1205, 226, 2057, 3888, 762, 2291, 3610, 3469, 227, 1792, 2395, 1117, 4112, 2481, 28, 3162, 3001, 4709, 3607, 753, 7, 3713, 2039, 2865, 944, 4000, 687, 4274, 1307, 2709, 4094, 480, 4894, 2021, 82, 1176, 4804, 3384, 1558, 2072, 189, 2245, 4646, 3516, 3355, 3948, 4788, 2449, 3752, 1639, 61, 2370, 277, 3538, 3043, 210, 3890, 3577, 2620, 2030, 473, 4548, 3285, 4303, 694, 1262, 1974, 1598, 485, 2779, 3522, 1072, 3854, 4835, 3124, 1648, 1737, 4429, 2480, 4426, 945, 696, 3802, 3507, 4582, 26, 3598, 3686, 4529, 4675, 2176, 3143, 2923, 3206, 963, 3817, 3943, 1700, 4774, 416, 1906, 3658, 3115, 4258, 4565, 972, 3850, 424, 3098, 3815, 1492, 4402, 1409, 2612, 2502, 2844, 2622, 1412, 4522, 1870, 1312, 1039, 1113, 2653, 2007, 4054, 73, 4553, 4433, 3589, 1420, 4261, 1462, 1791, 2135, 4385, 635, 1739, 577, 2694, 4436, 3986, 1527, 3410, 4449, 2341, 1675, 4440, 2886, 4242, 2564, 4237, 2693, 3914, 3005, 3553, 1517, 1357, 331, 2196, 2986, 525, 2322, 2017, 554, 2645, 2920, 1190, 4435, 3861, 837, 1614, 4234, 3729, 2988, 2520, 4268, 3083, 2068, 2967, 3432, 385, 1586, 50, 847, 95, 1398, 4821, 2591, 4053, 589, 4344, 4023, 898, 4876, 992, 2981, 391, 90, 4651, 1798, 4875, 844, 2934, 1851, 3189, 3587, 2772, 1672, 3172, 2561, 366, 3602, 1346, 3609, 3683, 3966, 4031, 3983, 791, 1493, 1337, 151, 3734, 3715, 3613, 3454, 403, 4510, 3892, 1256, 316, 2384, 904, 4217, 172, 3349, 1252, 1664, 2729, 1484, 4837, 2023, 2487, 984, 4665, 1331, 3361, 2429, 2976, 3523, 187, 3816, 1987, 2046, 3886, 1657, 4314, 2798, 4513, 3529, 1105, 1376, 1764, 4794, 2372, 1234, 4213, 4468, 4260, 183, 2024, 3142, 3765, 3032, 3597, 4914, 351, 3780, 2074, 917, 232, 2584, 2060, 4271, 3269, 514, 3928, 937, 744, 4734, 3347, 4540, 389, 755, 430, 1147, 4024, 4595, 864, 4891, 4043, 4647, 1304, 845, 3286, 2498, 3645, 1384, 2715, 1653, 4640, 2124, 3935, 4838, 2494, 3667, 1540, 2211, 4175, 2313, 3572, 3737, 2573, 1815, 3595, 3591, 671, 3219, 2012, 1948, 3224, 239, 838, 3826, 4304, 2249, 418, 3225, 174, 221, 2262, 4712, 3021, 2531, 2279, 2238, 1136, 3242, 2841, 742, 3521, 776, 654, 2759, 4633, 2465, 4879, 2734, 4015, 3201, 1807, 2402, 2310, 3161, 176, 870, 4694, 3789, 2845, 3751, 565, 2856, 597, 1172, 4378, 4122, 586, 296, 4020, 4247, 3809, 2301, 4811, 3599, 3993, 3693, 4823, 431, 1347, 4230, 1130, 3354, 3430, 2546, 4424, 1374, 3528, 4557, 4119, 3500, 1336, 2304, 3260, 3766, 3002, 820, 893, 1994, 4452, 889, 4467, 822, 3736, 2736, 4840, 4568, 1939, 1473, 4384, 2143, 475, 4877, 3781, 2924, 4199, 1996, 4505, 3451, 3505, 2246, 3691, 314, 4019, 1149, 2708, 3969, 2789, 1521, 2998, 1177, 4313, 4613, 2401, 2566, 3583, 2782, 4051, 3625, 2187, 4546, 1535, 1594, 3199, 322, 4627, 1446, 2807, 1886, 2123, 2760, 1464, 1827, 2470, 1068, 1559, 614, 3835, 1677, 377, 3377, 4428, 2650, 4844, 1514, 1391, 4559, 3114, 4353, 1305, 697, 689, 4301, 4545, 4137, 4461, 2225, 1921, 1526, 1988, 387, 3304, 2800, 3915, 936, 3801, 2409, 954, 4183, 2188, 4034, 712, 2028, 3396, 1400, 1606, 3843, 235, 20, 840, 1904, 4800, 2717, 3676, 706, 4275, 199, 1520, 3790, 31, 2356, 2439, 1722, 274, 1197, 2607, 215, 262, 4629, 346, 3270, 854, 4677, 1208, 4758, 2368, 1633, 3252, 2503, 4401, 1395, 4372, 2111, 3121, 4735, 894, 759, 1855, 53, 816, 3696, 1702, 3344, 4523, 85, 2306, 2788, 4851, 4561, 1532, 3135, 177, 358, 4803, 3035, 372, 457, 3880, 2974, 2724, 4796, 2703, 72, 924, 4295, 603, 4113, 3033, 1613, 1403, 1724, 44, 2247, 1557, 3037, 2275, 953, 4088, 3612, 4617, 899, 404, 4153, 1407, 1907, 2769, 3363, 4326, 523, 4861, 1146, 453, 1544, 1152, 3205, 3828, 4297, 4698, 4177, 4701, 4770, 4490, 451, 787, 3938, 1692, 4663, 3147, 2658, 1207, 2506, 2209, 3283, 3898, 4090, 184, 4859, 4188, 3741, 4100, 2855, 2685, 3399, 4097, 3868, 4393, 1977, 2234, 3480, 3038, 1423, 1259, 2056, 3383, 1223, 2073, 461, 2149, 2725, 301, 3975, 4524, 927, 1553, 4361, 3838, 1422, 1505, 3695, 1879, 4723, 1242, 4642, 3546, 2604, 886, 155, 3072, 2770, 2533, 1768, 4193, 4802, 2228, 4451, 1463, 1820, 797, 338, 3581, 734, 1844, 429, 335, 4328, 519, 2200, 2224, 4412, 4413, 2551, 2244, 740, 4335, 3096, 1445, 1983, 2517, 863, 1828, 746, 4658, 4612, 4518, 919, 1612, 498, 4245, 4184, 304, 3541, 2935, 3947, 3758, 607, 2418, 1355, 2665, 2441, 3611, 4161, 2160, 4450, 748, 4305, 2165, 2955, 3978, 3580, 3050, 1157, 4700, 3309, 4246, 1459, 896, 3011, 3034, 3057, 1396, 2285, 921, 716, 3631, 1471, 1380, 2069, 2126, 3750, 550, 4809, 2204, 1787, 65, 1698, 1570, 1232, 3768, 2447, 1688, 3848, 1903, 3726, 1835, 2662, 1140, 2276, 3548, 1316, 601, 2617, 411, 644, 4296, 1202, 2250, 3039, 2699, 2540, 2410, 2455, 2992, 4558, 1469, 1230, 2113, 280, 1716, 2757, 4064, 4158, 2255, 1349, 733, 1478, 2022, 1059, 3101, 2071, 1161, 2883, 341, 3628, 4688, 2576, 4779, 600, 4038, 4599, 214, 4200, 3494, 4397, 3230, 2750, 2446, 855, 4382, 4205, 3261, 2538, 1047, 2233, 2926, 3302, 2391, 981, 315, 3281, 3536, 4082, 2836, 3030, 2100, 559, 4740, 2744, 704, 2164, 2383, 2842, 2795, 884, 3951, 1135, 19, 3514, 1083, 708, 2179, 3733, 729, 3415, 1164, 4121, 3913, 233, 4414, 1150, 4537, 3953, 2687, 3074, 2889, 2746, 1892, 1333, 3503, 168, 1162, 1424, 1806, 370, 2307, 872, 2468, 2742, 707, 920, 3769, 4560, 300, 9, 4073, 1026, 1830, 672, 2374, 2147, 2871, 1510, 3493, 59, 2189, 3045, 4165, 510, 2727, 3013, 4686, 4619, 4228, 3358, 2156, 743, 564, 557, 4593, 2432, 3954, 3837, 479, 3138, 781, 2752, 2523, 2203, 4381, 502, 192, 2119, 910, 1142, 1950, 1562, 4225, 448, 3987, 3052, 4332, 4479, 3646, 1821, 3272, 1498, 860, 3506, 905, 2711, 2183, 2067, 2721, 3651, 853, 3952, 1549, 2977, 2499, 1968, 2763, 2337, 2879, 4579, 3010, 726, 17, 1056, 4854, 1877, 1588, 1160, 4395, 4669, 4375, 1000, 3567, 4285, 650, 4370, 3385, 1448, 383, 3028, 1690, 859, 3446, 4069, 2728, 1744, 3867, 29, 980, 2044, 4904, 642, 2624, 1701, 3942, 592, 913, 1286, 4350, 425, 3979, 4787, 382, 1052, 858, 4224, 3131, 3061, 2719, 21, 4338, 3586, 2917, 1481, 4813, 3456, 1942, 4805, 2208, 1669, 4318, 2377, 1922, 312, 4836, 3156, 1976, 1897, 2128, 231, 2400, 2966, 2644, 2552, 2945, 1168, 2109, 3475, 916, 1030, 259, 2036, 2452, 2880, 2420, 4006, 478, 2453, 2575, 365, 4489, 3240, 1350, 767, 1439, 3239, 1817, 1264, 4817, 1503, 825, 1893, 1279, 1576, 4249, 4060, 1871, 1255, 1324, 1960, 4169, 2792, 2403, 4415, 3593, 2818, 674, 4422, 2133, 402, 3332, 2669, 4757, 760, 2906, 4320, 4581, 246, 3100, 1063, 4093, 2144, 926, 3393, 1671, 1641, 1506, 1454, 2084, 3438, 1482, 1041, 2078, 1181, 4819, 2946, 2476, 378, 251, 2827, 3517, 384, 1100, 1670, 4026, 2472, 4574, 1662, 1776, 4764, 4555, 3029, 4814, 4673, 3771, 2991, 897, 127, 2154, 4662, 3971, 765, 1920, 2445, 2978, 4062, 4218, 2003, 2148, 790, 4674, 2869, 4116, 2158, 1918, 974, 1750, 1143, 1495, 3700, 4182, 2116, 120, 4322, 409, 1884, 4654, 4807, 2730, 3846, 1568, 4056, 452, 572, 2361, 819, 4756, 4111, 1620, 2382, 3024, 930, 3636, 2293, 80, 3267, 2013, 2778, 3053, 4586, 2129, 1499, 2683, 3025, 1245, 2239, 4659, 938, 2898, 3125, 3054, 546, 4884, 4639, 3632, 4002, 1908, 4309, 907, 3257, 1453, 1273, 2965, 4387, 2489, 1589, 3814, 2469, 3194, 4592, 4133, 3712, 4108, 1203, 3190, 2692, 867, 1320, 4241, 135, 1699, 3855, 2263, 4780, 1410, 2117, 1894, 2050, 4722, 2365, 4768, 1956, 2579, 4380, 2191, 1898, 3701, 3056, 3655, 237, 406, 1119, 3489, 4233, 254, 276, 1913, 1411, 2766, 4736, 4792, 400, 1911, 3117, 1118, 2911, 1035, 3478, 4471, 4533, 3251, 2754, 3887, 2037, 3320, 2614, 1523, 1765, 3264, 1970, 2606, 3297, 3019, 2218, 2915, 3615, 3108, 3276, 257, 2178, 1393, 1456, 4596, 38, 2627, 1243, 4129, 4702, 906, 4469, 666, 4011, 489, 439, 3962, 3459, 1371, 3343, 807, 3653, 356, 1170, 4889, 3291, 679, 4079, 975, 3575, 1018, 3188, 2388, 4727, 3250, 2961, 3223, 1094, 4829, 509, 364, 1427, 1394, 1, 1327, 2076, 1546, 1049, 933, 2785, 2029, 2596, 3910, 643, 196, 1914, 4003, 156, 3937, 1253, 36, 828, 3442, 4716, 4447, 2018, 909, 2323, 2025, 2963, 2448, 610, 1899, 3635, 3504, 731, 3582, 4017, 2809, 2491, 4767, 2034, 4556, 2157, 1352, 4430, 815, 4210, 3236, 4154, 1715, 1228, 2994, 40, 1760, 3228, 3531, 2919, 173, 3014, 3395, 1788, 437, 3732, 2422, 2632, 1022, 551, 3414, 1574, 209, 86, 2511, 1837, 3183, 617, 2474, 3812, 4845, 902, 4542, 2292, 2151, 721, 1916, 3739, 3217, 1843, 1048, 3805, 2427, 1288, 3669, 2938, 520, 4294, 1966, 4057, 3900, 2033, 3532, 201, 4822, 3327, 3334, 3982, 3782, 1531, 2560, 3842, 2327, 1089, 2271, 4656, 861, 4035, 3995, 70, 238, 415, 939, 2115, 1470, 3831, 3258, 1940, 2456, 33, 1283, 136, 2392, 2585, 43, 4464, 1428, 265, 1204, 3674, 1239, 3346, 1188, 2290, 2525, 2574, 361, 2414, 751, 2587, 3008, 3760, 4340, 2984, 2864, 3006, 313, 4408, 1666, 4226, 1632, 2222, 2121, 4906, 4849, 4411, 4379, 2783, 2041, 4454, 2236, 2142, 677, 3202, 3200, 2343, 3418, 4216, 724, 871, 1704, 302, 3330, 3912, 4576, 638, 3367, 4827, 842, 2202, 2507, 3832, 1793, 631, 3338, 3702, 4573, 4018, 3408, 4048, 4691, 4120, 3554, 1079, 2563, 4747, 2953, 1075, 2266, 3300, 2811, 2118, 1861, 2895, 552, 941, 527, 4087, 4495, 4580, 3441, 144, 2633, 989, 3093, 2873, 2539, 4775, 2868, 14, 4236, 230, 543, 2512, 4526, 3237, 990, 3129, 4475, 2739, 2173, 69, 3939, 1719, 4212, 619, 3859, 4901, 3638, 2102, 4604, 657, 1017, 1954, 3404, 286, 3874, 4485, 3069, 890, 1480, 3650, 1334, 349, 2567, 1554, 1592, 4142, 4311, 722, 1270, 4030, 2950, 3926, 107, 1774, 1189, 4874, 111, 1402, 1931, 3333, 472, 2861, 1707, 4127, 4369, 427, 3678, 4660, 3844, 994, 1005, 2127, 1681, 522, 3106, 735, 2139, 2549, 2315, 1455, 1773, 2548, 532, 423, 4488, 354, 1659, 1616, 1563, 4457, 2706, 4487, 1953, 3289, 3370, 3791, 584, 2257, 4605, 4624, 1706, 1282, 2043, 3036, 4781, 888, 4641, 3992, 2, 649, 4566, 4830, 1767, 3795, 3060, 3266, 4917, 1013, 2902, 808, 1461, 2903, 287, 3644, 3476, 2360, 3959, 4092, 647, 307, 4198, 1622, 1753, 18, 1998, 1990, 4503, 2663, 2214, 1053, 4484, 4644, 4551, 2493, 110, 2289, 3004, 4206, 3137, 4684, 1019, 2240, 2635, 3773, 3562, 420, 125, 2055, 3991, 3783, 4887, 1122, 3633, 1237, 4336, 3273, 4391, 3303, 2776, 1981, 3659, 4347, 2186, 3280, 2816, 3486, 442, 3023, 3180, 2220, 931, 3834, 664, 2436, 948, 4865, 1321, 3684, 3275, 3746, 505, 4661, 4569, 4371, 115, 414, 3708, 2394, 3041, 4572, 3785, 3852, 4550, 4159, 763, 4075, 4507, 3823, 2373, 91, 2820, 4869, 3444, 3187, 4399, 4099, 1522, 799, 4771, 2097, 236, 663, 1432, 1452, 587, 3450, 339, 1153, 2583, 1652, 3457, 2101, 3109, 4882, 2089, 4541, 211, 4693, 1261, 4264, 3742, 344, 64, 3643, 289, 1093, 1134, 4441, 4045, 1381, 555, 2177, 4208, 2675, 4498, 4269, 2771, 373, 628, 1158, 4021, 2762, 1519, 319, 1500, 46, 4288, 1323, 569, 0, 1051, 459, 3510, 4728, 3353, 1749, 1509, 3084, 2416, 1941, 1945, 2254, 526, 333, 1573, 3699, 4713, 295, 3422, 2870, 1126, 1031, 131, 1069, 278, 4584, 200, 996, 458, 3298, 4431, 770, 138, 3682, 1978, 54, 2404, 2999, 4307, 1581, 2726, 3401, 1390, 3229, 1629, 549, 695, 2823, 4585, 77, 4128, 1408, 4667, 2534, 1832, 3574, 441, 175, 2253, 4532, 651, 3920, 2197, 2908, 4594, 3120, 1474, 3018, 2210, 1236, 3218, 4409, 1085, 789, 42, 2598, 4606, 4349, 2288, 3440, 4253, 101, 2885, 493, 1834, 877, 773, 3543, 2555, 1979, 2170, 4014, 1891, 2486, 3464, 2026, 632, 1129, 2773, 2378, 1002, 4517, 3934, 536, 1530, 4312, 4178, 971, 1116, 1198, 4848, 4900, 4211, 281, 4355, 839, 2206, 413, 2700, 3851, 2618, 4462, 3058, 2159, 3869, 2740, 2065, 1853, 1009, 4047, 1808, 3326, 1501, 3893, 3673, 4473, 336, 3294, 3872, 1548, 317, 4685, 4815, 2944, 2242, 1104, 962, 3292, 3551, 4630, 283, 3235, 1746, 1668, 3350, 1919, 2768, 3308, 914, 292, 1062, 1074, 3152, 678, 1656, 3573, 2054, 63, 1154, 2817, 2252, 3175, 2248, 4445, 1067, 3313, 4055, 3168, 4818, 3062, 3323, 3181, 4745, 4755, 534, 3727, 4699, 3681, 3902, 1417, 3919, 2876, 466, 2535, 3545, 2580, 1431, 719, 1635, 2105, 465, 476, 4444, 732, 3048, 1550, 2804, 4578, 3079, 2529, 2790, 4013, 1685, 3744, 4590, 4134, 4455, 2167, 2968, 604, 4703, 2362, 4465, 1034, 2930, 4591, 3171, 4131, 545, 2092, 2393, 1944, 4135, 37, 1529, 1343, 1397, 1108, 2832, 4346, 269, 153, 4797, 4115, 2317, 1241, 2562, 2537, 3016, 1952, 1621, 1248, 2831, 4547, 1538, 2344, 1015, 2892, 2913, 3329, 1937, 1139, 2748, 1583, 193, 1732, 347, 4492, 1415, 4351, 1579, 2780, 2543, 4096, 2329, 851, 4718, 2510, 3961, 4220, 830, 1451, 2737, 497, 1938, 4508, 1660, 3345, 2921, 1854, 2743, 4398, 3970, 3558, 1866, 818, 146, 4515, 308, 3761, 1889, 2631, 1437, 1217, 58, 4065, 4400, 4742, 3372, 4571, 705, 1991, 3204, 2791, 2408, 2664, 2838, 22, 4308, 1267, 3723, 1551, 4009, 2232, 1961, 1822, 4631, 524, 3268, 881, 1528, 4333, 3122, 1339, 3253, 1186, 553, 3717, 3656, 2079, 1080, 3474, 2671, 3555, 1359, 2753, 3290, 1560, 1695, 3882, 2802, 4812, 3759, 1066, 3381, 4084, 3941, 1790, 1802, 918, 2219, 2005, 1829, 3, 571, 3685, 2578, 4589, 1587, 2973, 3899, 388, 3075, 2330, 469, 1781, 190, 4262, 1805, 1450, 3496, 4095, 1281, 2195, 3724, 2434, 2936, 4316, 4, 179, 766, 605, 4360, 4918, 96, 252, 3443, 1631, 4888, 515, 606, 369, 1928, 1301, 1001, 2386, 2830, 2801, 2161, 1332, 4232, 2874, 2625, 470, 311, 1507, 3388, 684, 4482, 2605, 3116, 1318, 2781, 2857, 629, 4041, 2475, 717, 2933, 2684, 3894, 4190, 1824, 780, 4098, 528, 4913, 4389, 4608, 1663, 329, 3473, 3243, 866, 2586, 3003, 608, 1378, 3314, 2582, 1710, 3413, 3787, 24, 2273, 1826, 225, 3337, 3755, 1238, 1863, 1373, 4549, 2380, 1254, 2366, 4254, 3149, 3511, 1755, 3626, 3380, 3911, 162, 615, 3233, 4194, 2342, 482, 2741, 3078, 2686, 3764, 4808, 3365, 4853, 2040, 4839, 4600, 11, 3425, 4609, 3568, 995, 869, 222, 3065, 181, 2270, 1096, 752, 1444, 1088, 2303, 4363, 4439, 3193, 4726, 4166, 1366, 328, 3703, 449, 1665, 3293, 1556, 3945, 3652, 1313, 398, 1963, 2850, 4207, 3743, 149, 1673, 4221, 2059, 3877, 4434, 2695, 1959, 2258, 1436, 1156, 362, 2732, 3311, 3533, 2463, 3957, 4902, 4239, 3182, 3705, 1363, 2918, 4893, 2680, 1969, 3099, 306, 1694, 4554, 4201, 2600, 1515, 270, 2369, 1293, 1757, 2808, 2120, 3371, 1857, 2969, 2828, 3873, 878, 4140, 2866, 241, 4179, 624, 3756, 4416, 3357, 186, 3389, 3692, 4167, 4036, 2837, 1111, 399, 3352, 977, 2536, 2399, 4477, 2110, 4244, 1537, 3584, 3813, 1813, 4147, 1818, 3596, 1340, 99, 616, 4733, 1290, 1364, 2765, 3614, 1326, 533, 4765, 3468, 446, 1133, 900, 4602, 2872, 1457, 4039, 3427, 1814, 2733, 711, 1912, 2553, 109, 407, 4625, 3165, 3234, 3906, 94, 4739, 1785, 1655, 487, 45, 4724, 4603, 3657, 3241, 75, 2201, 1103, 2878, 2181, 2840, 3146, 2814, 3477, 3818, 2153, 2339, 1992, 3027, 4621, 2851, 3186, 4306, 4390, 2925, 1566, 2316, 3214, 1265, 3049, 1862, 4392, 1297, 4215, 3811, 4327, 1025, 3017, 2704, 3026, 2162, 4083, 1379, 1191, 827, 1046, 2909, 1377, 3211, 599, 150, 3463, 4743, 2385, 792, 4828, 4588, 2286, 1627, 2621, 284, 3770, 4290, 2541, 2098, 25, 4880, 1935, 4292, 1335, 4732, 2515, 1196, 4626, 3557, 92, 4195, 4044, 581, 3259, 261, 2682, 393, 3160, 3439, 3042, 2712, 2182, 4104, 2877, 1101, 4368, 76, 2390, 2528, 4337, 2616, 2070, 709, 428, 1772, 477, 785, 2793, 4148, 4005, 1957, 4611, 3719, 810, 4052, 1466, 1216, 2438, 363, 1033, 2479, 2031, 4061, 512, 412, 754, 191, 2010, 3876, 2509, 1778, 3535, 641, 3544, 934, 1442, 4374, 4791, 1836, 3579, 3735, 1679, 4741, 3163, 492, 2320, 2661, 618, 310, 1825, 4908, 1077, 4528, 1524, 3985, 3903, 1348, 1646, 795, 2597, 1905, 4916, 2460, 2194, 3231, 3563, 1351, 585, 4750, 1582, 1756, 484, 132, 3796, 2628, 2749, 1766, 3426, 1024, 264, 3622, 1159, 2325, 775, 979, 2647, 1934, 2473, 2651, 3435, 3824, 3429, 2673, 4717, 3210, 2174, 30, 2049, 2107, 964, 1271, 826, 1091, 3277, 1285, 27, 1502, 4138, 4534, 488, 2140, 3044, 622, 1386, 4406, 3884, 788, 2405, 2035, 4214, 2696, 1762, 4396, 1909, 1429, 1345, 3940, 1358, 538, 2088, 2442, 2747, 122, 1404, 2758, 1121, 3197, 2047, 145, 1155, 2458, 1061, 1982, 1680, 4089, 3862, 841, 1233, 4655, 1511, 499, 3196, 1975, 580, 2114, 2163, 730, 134, 852, 4383, 2355, 1250, 4789, 2860, 915, 2444, 2565, 103, 3081, 3690, 245, 922, 723, 3776, 986, 4784, 1138, 4284, 1777, 1028, 590, 171, 4042, 436, 836, 4903, 4330, 3247, 318, 814, 3630, 4678, 4386, 1718, 3936, 1782, 4282, 4446, 778, 1584, 3989, 3709, 3623, 1266, 3694, 901, 621, 3271, 802, 750, 41, 1220, 3262, 4738, 1964, 1686, 4257, 4366, 1272, 4681, 4348, 1137, 1291, 3839, 2799, 2243, 4256, 2294, 4512, 2784, 987, 3821, 1385, 3158, 3007, 249, 2745, 2668, 1185, 3806, 1779, 2027, 3524, 2061, 843, 2813, 2338, 1490, 1414, 868, 1224, 1577, 3089, 2375, 2505, 591, 544, 1714, 444, 2352, 3341, 4715, 124, 195, 727, 3227, 1799, 1416, 598, 3547, 208, 2550, 1044, 3366, 142, 2048, 462, 1212, 197, 2916, 3403, 4801]
    
    # Recover the original message
    recovered_message = unscramble_message(scrambled_message, e, n)
    key = sha256(str(recovered_message).encode()).digest()
    flag='ca9d6ab65e39b17004d1d4cc49c8d6e82f9fa7419824d07096d41ee41f0578fe6835da78bc31dd46587a86377883e0b7'
    print(AES.new(key, AES.MODE_ECB).decrypt(bytes.fromhex(flag)))
    # Verify our solution
    test_scrambled = super_scramble(recovered_message, e)
    correct = all(test_scrambled[i] == scrambled_message[i] for i in range(n))
    
    print(f"Recovery successful: {correct}")
    
    return recovered_message

if __name__ == "__main__":
    main()
#b'HTB{t4l3s_fr0m___RS4_1n_symm3tr1c_gr0ups!}\x06\x06\x06\x06\x06\x06'
```
# gateway  
lấy flag đã bị encode:  
```python=
#!/usr/bin/env python3

import pwn

pwn.context.log_level = "CRITICAL"  


def get_updated_value(flag_input) :
    PROMPT = b"(gdb)"
    io: pwn.tube
    with pwn.process(["gdb", "-q", "--nx", "./gateway2"]) as io:
        io.sendlineafter(PROMPT, b"b *0x08049ee0")
        io.sendlineafter(PROMPT, b"run")
        io.sendline(flag_input.encode())
        for j in range(32):
            #io.sendlineafter(PROMPT, b"continue")
            io.sendlineafter(PROMPT, b"p/x $eax")
            n=(io.recvline())
            io.sendlineafter(PROMPT, b"continue")#x/_ ___
            #n=(io.recvline())
            
            print(n[6:-1].decode(),end=',')
        io.close()
    exit()

    return n
        

#flag = ""
for s in range(33,127):
    u = get_updated_value(chr(s)*32)
    print(u)
#print(flag)

```
mapping:  
```python=
#!/usr/bin/env python3

import pwn

pwn.context.log_level = "CRITICAL"  


def get_updated_value(flag_input,i) :
    PROMPT = b"(gdb)"
    io: pwn.tube
    with pwn.process(["gdb", "-q", "--nx", "./gateway2"]) as io:
        io.sendlineafter(PROMPT, b"b *0x08049ee0")
        io.sendlineafter(PROMPT, b"run")
        io.sendline(flag_input.encode())
        for j in range(i):
            io.sendlineafter(PROMPT, b"continue")
        io.sendlineafter(PROMPT, b"p/x $edx") #x/_ ___
        n=(io.recvline())
        io.close()

    return n[6:-1].decode()
        

flag = ""
print("[",end=' ')
for i in range(1):
    for s in range(33,127):
        print('"'+chr(s),end='":')
        u = get_updated_value(chr(s)*32,i)
        print(u,end=", ")
print(' ]')


```
shuffle:  
```python=
#!/usr/bin/env python3

import pwn

pwn.context.log_level = "CRITICAL"  
mapping = {
    "!": 0x9d14f94b, '"': 0x36f3067f, "#": 0x9eb3a624, "$": 0xca4ae576, "%": 0x620a452d, "&": 0xc9edba19, 
    "'": 0x61ad1a42, "(": 0xcadb0723, ")": 0x629ba778, "*": 0xc97c584c, "+": 0x613cf817, ",": 0x35c5bb45, 
    "-": 0x9d851b1e, ".": 0x3662e42a, "/": 0x9e224471, "0": 0x97329582, "1": 0x3f7235d9, "2": 0x9495caed, 
    "3": 0x3cd56ab6, "4": 0x682c29e4, "5": 0xc06c89bf, "6": 0x6b8b768b, "7": 0xc3cbd6d0, "8": 0x68bdcbb1, 
    "9": 0xc0fd6bea, ":": 0x6b1a94de, ";": 0xc35a3485, "<": 0x97a377d7, "=": 0x3fe3d78c, ">": 0x940428b8, 
    "?": 0x3c4488e3, "@": 0xb3e0301b, "A": 0x1ba09040, "B": 0xb0476f74, "C": 0x1807cf2f, "D": 0x4cfe8c7d, 
    "E": 0xe4be2c26, "F": 0x4f59d312, "G": 0xe7197349, "H": 0x4c6f6e28, "I": 0xe42fce73, "J": 0x4fc83147, 
    "K": 0xe788911c, "L": 0xb371d24e, "M": 0x1b317215, "N": 0xb0d68d21, "O": 0x18962d7a, "P": 0x1186fc89, 
    "Q": 0xb9c65cd2, "R": 0x1221a3e6, "S": 0xba6103bd, "T": 0xee9840ef, "U": 0x46d8e0b4, "V": 0xed3f1f80, 
    "W": 0x457fbfdb, "X": 0xee09a2ba, "Y": 0x464902e1, "Z": 0xedaefdd5, "[": 0x45ee5d8e, "\\": 0x11171edc, 
    "]": 0xb957be87, "^": 0x12b041b3, "_": 0xbaf0e1e8, "`": 0xe2d35652, "a": 0x4a93f609, "b": 0xe174093d, 
    "c": 0x4934a966, "d": 0x1dcdea34, "e": 0xb58d4a6f, "f": 0x1e6ab55b, "g": 0xb62a1500, "h": 0x1d5c0861, 
    "i": 0xb51ca83a, "j": 0x1efb570e, "k": 0xb6bbf755, "l": 0xe242b407, "m": 0x4a02145c, "n": 0xe1e5eb68, 
    "o": 0x49a54b33, "p": 0x40b59ac0, "q": 0xe8f53a9b, "r": 0x4312c5af, "s": 0xeb5265f4, "t": 0xbfab26a6, 
    "u": 0x17eb86fd, "v": 0xbc0c79c9, "w": 0x144cd992, "x": 0xbf3ac4f3, "y": 0x177a64a8, "z": 0xbc9d9b9c, 
    "{": 0x14dd3bc7, "|": 0x40247895, "}": 0xe864d8ce, "~": 0x438327fa  
}
enc = [
    0xb62a1500, 0x1d5c0861, 0x4c6f6e28, 0x4312c5af, 0x3cd56ab6, 0x1e6ab55b, 0x3cd56ab6, 0xc06c89bf,
    0xed3f1f80, 0xbaf0e1e8, 0xbfab26a6, 0x3cd56ab6, 0xb3e0301b, 0xbaf0e1e8, 0xe1e5eb68, 0xb0476f74, 
    0xb3e0301b, 0x3cd56ab6, 0xbfab26a6, 0xe864d8ce, 0x4c6f6e28, 0x4312c5af, 0xb3e0301b, 0x9d14f94b, 
    0xee9840ef, 0x3cd56ab6, 0xbfab26a6, 0xbfab26a6, 0x9d14f94b, 0xbaf0e1e8, 0x14dd3bc7, 0x97329582
]
reverse_dict = {v: k for k, v in mapping.items()}

def get_updated_value(flag_input) :
    p=[]
    PROMPT = b"(gdb)"
    io: pwn.tube
    with pwn.process(["gdb", "-q", "--nx", "./gateway2"]) as io:
        io.sendlineafter(PROMPT, b"b *0x08049ee0")
        io.sendlineafter(PROMPT, b"run")
        io.sendline(flag_input.encode())
        for j in range(32):
            #io.sendlineafter(PROMPT, b"continue")
            io.sendlineafter(PROMPT, b"p/x $edx")
            n=(io.recvline())
            io.sendlineafter(PROMPT, b"continue")#x/_ ___
            #n=(io.recvline())
            
            p.append(int(n[6:-1].decode(),16))
        io.close()
    #exit()

    return p
        

decoded_str = "".join(reverse_dict[val] for val in enc)
print(decoded_str)
while True:
        enc = get_updated_value(decoded_str)
        decoded_str = "".join(reverse_dict[val] for val in enc)
        print(decoded_str)
        if 'HTB{' in decoded_str:
            break
#HTB{r3tf@r_t0_tH3_h3@V3n5g@t3!!}        
```