https://github.com/sh4dowb/eba-canli-ders-crossplatform
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 telethon.tl.types import ChannelParticipantCreator, ChannelParticipantAdmin | |
from telethon.tl.functions.channels import GetParticipantRequest | |
#.. | |
@client.on(events.NewMessage) | |
async def handler(event): | |
participant = await client(GetParticipantRequest(channel=event.original_update.message.to_id.channel_id,user_id=event.original_update.message.from_id)) | |
isadmin = (type(participant.participant) == ChannelParticipantAdmin) | |
iscreator = (type(participant.participant) == ChannelParticipantCreator) |
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
def press_or_text(user_id): | |
return events.Raw(func=lambda e: (type(e) == UpdateNewMessage and e.message.from_id == user_id) or (type(e) == UpdateBotCallbackQuery and e.user_id == user_id and e.data != b'cancel')) | |
whatever = await conv.wait_event(press_or_text(sender)) | |
if type(whatever) == UpdateBotCallbackQuery and whatever.data in [b'create', b'list']: | |
# button clicked | |
# not actual event like "CallbackQuery", you can't use .edit() etc. directly | |
print(whatever.data) | |
else: | |
# message sent |
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
# Netherlands account number algorithm uses this factor table: | |
# digit | factor | |
# 1st | 10 | |
# 2nd | 9 | |
# ... | |
# 10th | 1 | |
# | |
# After multiplying digits according to the table, sum of these results must be divisible with 11 | |
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 hashlib | |
import base64 | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
import rubymarshal.reader | |
from pbkdf2 import PBKDF2 | |
SECRET = "a3f58debfe0c5b71edaebea3a627f4f" | |
SALT = "12345" | |
ITERATIONS = 65536 |
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 hashlib | |
import base64 | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
import rubymarshal.reader | |
from pbkdf2 import PBKDF2 | |
SECRET = "asdasd" | |
ITERATIONS = 65536 | |
KEYLENGTH = 32 |
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
// fuck you atomic. why can't you just be fucking normal? | |
// east home innocent snake icon curtain series brave guard program history stand | |
// BIP39 seed: | |
var seed = new Uint8Array([70, 78, 5, 155, 232, 171, 38, 78, 191, 56, 142, 102, 122, 20, 65, 239, 127, 215, 39, 174, 28, 222, 17, 150, 102, 129, 182, 172, 246, 80, 15, 19, 79, 248, 113, 244, 95, 101, 33, 96, 203, 181, 243, 63, 23, 9, 71, 102, 37, 216, 196, 6, 77, 209, 18, 2, 107, 12, 239, 38, 249, 29, 107, 249]); | |
var s = require('ethereum-cryptography/pure/hdkey').HDKey; | |
var t = require('ethereumjs-wallet'); | |
var w = s.fromMasterSeed(seed); |
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 | |
from tronapi import Tron | |
full_node = 'https://api.trongrid.io' | |
solidity_node = 'https://api.trongrid.io' | |
event_server = 'https://api.trongrid.io' | |
pkey = "private_key_hex" | |
payments = [ |
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
# I absolutely hated crypto-js for this. non-standard configurations, weird algorithms, ... | |
# well obviously you can encrypt it with a better configuration which people will not | |
# go crazy figuring out its implementation, but in this case I wasn't encrypting the data. | |
import base64 | |
from Crypto.Hash import MD5 | |
from Crypto.Util.Padding import unpad | |
from Crypto.Cipher import AES | |
# generated using: CryptoJS.AES.encrypt('test 123456 plaintext', 'some password').toString() |
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 hmac | |
import hashlib | |
def getLimboOutcome(server, client, nonce): | |
server = server.encode() | |
client = client.encode() | |
nonce = str(nonce).encode() | |
round = 0 | |
hash = hmac.new(server, client+b':'+nonce+b':'+str(round).encode('utf-8'), hashlib.sha256).digest() | |
first4 = hash[:4] |