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
from collections import namedtuple, OrderedDict | |
import numpy as np | |
import tensorrt as trt | |
import pycuda.driver as cuda | |
assert trt.__version__.split('.')[0] >= '10', 'TensorRT version >= 10 is required.' | |
class TRTInference: |
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
import torch | |
print(torch.cuda.is_available()) | |
print(torch.cuda.get_device_name(0)) | |
t = torch.randn(1,2).to('cuda') | |
print(t) |
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
import tensorflow as tf | |
print(tf.config.list_physical_devices('GPU')) | |
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') | |
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b') | |
c = tf.matmul(a, b) | |
print(c) |
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
import json | |
import hashlib | |
import requests | |
API_URL = 'https://libc.rip/api/find' | |
def search(known_symbols: dict[str, str]) -> dict[str, str]: | |
""" | |
Search for the libc version using the known symbols and their offsets. |
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
import time | |
import subprocess | |
possible_chars = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'] # possible characters in the password | |
length_of_password = 8 | |
max_or_min = max # choose if guessing the 'correct' answer result in longest (use max) or shortest (use min) execution time | |
path_to_executable = 'path to password checking executable' | |
error_msg = 'Last row of output you get for entering a wrong password' # the last row of output you get for a wrong password | |
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
import os, sys | |
import re | |
import time | |
import datetime | |
import atexit | |
import random | |
from typing import Dict, List, Any | |
import logging | |
import asyncio | |
import requests |