This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Licensed under the MIT License: | |
; Copyright (c) 2021 8051Enthusiast | |
; Permission is hereby granted, free of charge, to any person obtaining a copy | |
; of this software and associated documentation files (the "Software"), to deal | |
; in the Software without restriction, including without limitation the rights | |
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
; copies of the Software, and to permit persons to whom the Software is | |
; furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#ifdef A | |
R"(" | |
#else | |
#define A | |
const char *s = | |
#include __FILE__ | |
; | |
#undef A | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports the functions found by at51 into the program | |
import json | |
import subprocess | |
import sys.exit as exit | |
state = getState() | |
currentProgram = state.getCurrentProgram() | |
filepath = currentProgram.getExecutablePath() | |
# note: this won't work properly if the file is loaded at an offset | |
proc = subprocess.Popen(["at51", "libfind", "-j", filepath], | |
stdout = subprocess.PIPE, stderr = subprocess.PIPE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
state = getState() | |
currentProgram = state.getCurrentProgram() | |
def to_positive(b): | |
if b >= 0: | |
return b | |
return b + 256 | |
def maybe_get_gptr_ref(b): | |
if len(b) < 6: | |
return None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num = {'a': 0x4f04adb47ec5294440250a2aca3cc81cdc7adcc8fc8f4df95a2ca92c41cc8b221a5626e429f89a2e4d317eeea16b3475bb6878be9b5584be0d64e409c14a57fd7a2c876b2361854cb7f8e49a13e9f41e924b0a2bd093228e964a91dcc9ed7e76f093657e4fe3c3b75a6ad442ef0d0a40fb6294d556792753657d03add51daf355ea669cc5c195b9fe87fe45e3a85bba8674a07e081372ceda9495e741ac26385cf67b3448d983edefd666856446975e2aaf7e5aa23fc6629125cc3f6b970ade2c118796975f47939a5d5dfbae9d77c690d3de380519c0224ed924d3d0606fd849595d57e7bdae9770b1d07dcf6e1ad3d46faa75298aa115f6de06f733a18cd96e34a2cc8483cd40461cee9d77d7d5c12c86ff2742e3060b01e41511b58d5a5563bf2dc22b61a4c4a44dac8e7fcee04dd07a58ae22483dcb628a08803e196863822707d2e25754113d3bd2d07189da675ca2c0b4e8cfa14c6543d09d4d96932d385ee7e6f8a8ec733fc54ceb63070067e6d269f201149c4d60d642cffafe2a8baff351a7972df6c1961ab1eeb11b4623f545c40e760cdf6e449ffe96a5af0281dffcf8e10e4a41b4e5840835271566e13f69d1c0619f2f7df39d3bb5b68ca6396ce61090c4ed22af4628e9d1d636ace86a84df7503fd84df678129fa43fe2af0c967a9532d8c1cbf0711193b60401f9b147e95fa83ece05a019 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import re | |
import argparse | |
import math | |
from typing import Literal | |
import numpy as np | |
def get_string_addresses(b: bytes, n: int) -> set[int]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <gmp.h> | |
char * polynomial="-74101463560860539810482394216134472786413399/404009590666424903383979388988167534591844018460526499864038804741201731572423877094984692537474105135297393596654648304117684895744000000000000000000000*x^99 + 1786563401621773217421750502452955853226339781/1943688752347061390850759947022111850270039951356484879070977067483444756705819339975871373032521468004867185688372878439054154137600000000000000000000*x^98 - 27321291157050372775340569532625689973429185264741/12024094960310264981666053243695462339042976739896622019763059664916718201560234437350734896948634081407660523709959770955883479040000000000000000000000*x^97 + 4936870031754926645682423836151042176171669450909/1336493173680525187613977630110369004256312194947800263402124063124652591386915768177479078216982141485276408003996973457735680000000000000000000000*x^96 - 24473118674386691114350902920738421254018653211816783/55093218603941649400531744530105211175454647 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![recursion_limit = "1000000"] | |
trait N { | |
fn f<B: N, C: N, D: N, E: N, F: N, G: N, H: N, I: N>(fun: impl FnMut()); | |
} | |
impl N for i8 { | |
#[inline(never)] | |
fn f<B: N, C: N, D: N, E: N, F: N, G: N, H: N, I: N>(mut fun: impl FnMut()) { | |
fun(); | |
B::f::<Self, C, D, E, F, G, H, I>(fun) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# matrix from the `a^i` generator basis to the `a^(-2^i)` normal basis | |
to_normal = [0x7f50f7fd, 0x95ecaead, 0x495ffebe, 0x90618596, 0x6e0d0395, 0x527b6ec5, 0x563d1cac, 0x1ee02779, | |
0x287efd13, 0x5a66f53c, 0xdf3df773, 0xa0d25f82, 0x79357a5b, 0xe5c59050, 0x15508e51, 0x498da844, | |
0xcaf65756, 0x4830c2cb, 0xa93db762, 0x8f7013bc, 0x2d337a9e, 0x50692fc1, 0x72e2c828, 0x24c6d422, | |
0xa4186165, 0x47b809de, 0xa83497e0, 0x12636a11, 0x23dc04ef, 0x8931b508, 0x4498da84, 0xffffffff] | |
# inverse of to_normal | |
from_normal = [0xdb710641, 0x6d930ac3, 0x6d3d2d4d, 0x6567cb95, 0xd7125358, 0x5b358fd3, 0x2e9bb40b, 0x12a59a49, | |
0x8df9403d, 0x5139de12, 0xba340226, 0x29c45641, 0x12fbc105, 0xecd30c55, 0x3755ebd8, 0x24ee460c, | |
0x23783fcf, 0x479933fc, 0xa39442a5, 0x9ea0056d, 0xf42608f6, 0x20cacf04, 0x2a0cf83d, 0xeffd8645, | |
0x2a39a67d, 0x640ebd82, 0x9dfd8792, 0x277402ab, 0xad31bc4f, 0x31536354, 0x5ea35fca, 0x52b55e39] |