Skip to content

Instantly share code, notes, and snippets.

View Demon000's full-sized avatar
😴
nothin

Cosmin Tanislav Demon000

😴
nothin
  • Cluj-Napoca, România
  • 05:33 (UTC +03:00)
View GitHub Profile
#!/usr/bin/env python3
import io
import sys
txt_conf = sys.argv[1]
bin_conf = sys.argv[2]
with open(txt_conf, 'r', encoding='utf-8') as f:
data = f.read()
@Demon000
Demon000 / ar.c
Last active April 29, 2025 21:02
/* aw882xx_ar_get_ctl_by_pcm_info(mixer*, char*, char const*, mixer_ctl**) */
undefined8
aw882xx_ar_get_ctl_by_pcm_info(mixer *param_1,char *param_2,char *param_3,mixer_ctl **param_4)
{
size_t sVar1;
size_t sVar2;
char *pcVar3;
# Define the clock frequencies
# From printing the tbl variable inside geni_se_clk_freq_match
clock_frequencies = [
19200000,
32000000,
48000000,
64000000,
96000000,
100000000,
120000000,
#!/usr/bin/env python3
from ctypes import Structure, c_char, c_double, c_uint32, sizeof
import hashlib
from io import BufferedReader
from itertools import combinations
import struct
import sys
from typing import Dict, List, Optional, TextIO, Tuple
from enum import Enum
@Demon000
Demon000 / common_extract-files.py
Last active October 7, 2024 19:26
extract-files.py
#
# Copyright (C) 2024 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
from typing import List
from extract_utils.main import (
@Demon000
Demon000 / profile-script.sh
Created August 26, 2024 09:43
Bash script profiling line by line
#!/usr/bin/env python3
import os
import sys
def parse_line(line):
parts = line.split('␞')
script_path = os.path.normpath(parts[1])
line_no = int(parts[2])
@Demon000
Demon000 / gist:a0e7d007363d1ec035b3ec24b61ead54
Created December 13, 2023 16:21
JavaScript KeyboardEvent to Android KEYCODE
private browserKeyToKeycode(
data: BrowserKeyboardEvent,
): KeyCode | undefined {
switch (data.code) {
case 'ShiftLeft':
return KeyCode.KEYCODE_SHIFT_LEFT;
case 'ShiftRight':
return KeyCode.KEYCODE_SHIFT_RIGHT;
case 'MetaLeft':
@Demon000
Demon000 / log.txt
Last active September 21, 2023 17:13
tls
0 read chunk <Buffer 16 03 01 00 e1 01 00 00 dd 03 03 61 37 fb 11 ba 72 be 4e ac 79 4d d4 0b d4 a8 9a c4 3d b7 aa 9e ca 53 94 5a 1d 77 54 ee b7 79 5f 20 e8 b5 bf f8 93 8f ... 180 more bytes>
0 read immediately DataBuffer {
appendOffset: 230,
readOffset: 0,
data: <Buffer 16 03 01 00 e1 01 00 00 dd 03 03 61 37 fb 11 ba 72 be 4e ac 79 4d d4 0b d4 a8 9a c4 3d b7 aa 9e ca 53 94 5a 1d 77 54 ee b7 79 5f 20 e8 b5 bf f8 93 8f ... 180 more bytes>
}
0 read encrypted DataBuffer {
appendOffset: 230,
readOffset: 0,
data: <Buffer 16 03 01 00 e1 01 00 00 dd 03 03 61 37 fb 11 ba 72 be 4e ac 79 4d d4 0b d4 a8 9a c4 3d b7 aa 9e ca 53 94 5a 1d 77 54 ee b7 79 5f 20 e8 b5 bf f8 93 8f ... 180 more bytes>
@Demon000
Demon000 / NodeCryptor.ts
Last active September 21, 2023 17:11
tls
import { Cryptor, DataBuffer } from '@web-auto/android-auto';
import DuplexPair from 'native-duplexpair';
import { Duplex, Readable, Writable } from 'node:stream';
import { TLSSocket, connect } from 'node:tls';
export class NodeCryptor extends Cryptor {
private connected = false;
private securePair: {
cleartext: TLSSocket;
encrypted: Duplex;
01-17 12:15:48.636 1970 2055 E imsd : rcsMain.cpp | 76 | | 2055 |########### RCS SERVICE START ##################
01-17 12:15:48.636 1970 2055 E imsd : DaemonBaseImpl.cpp | 89 | | 2055 |addFdToListen[9a8063a8]: adding fd[24] status[0]
01-17 12:15:48.636 1970 2055 E imsd : handshakeHandler.cpp | 34 | | 2055 |handshakeHandler ctor
01-17 12:15:48.636 1970 2055 E imsd : ImsTimer.cpp | 19 | | 2055 |ImsTimer: ctor
01-17 12:15:48.636 1970 2055 E imsd : ImsTimer.cpp | 41 | | 2055 |ImsTimer: initialize
01-17 12:15:48.636 1970 2055 E imsd : ImsTimer.cpp | 49 | | 2055 |ImsTimer: initialize function returns true
01-17 12:15:48.636 1970 2055 E imsd : ImsTimer.cpp | 19 | | 2055 |ImsTimer: ctor
01-17 12:15:48.636 1970 2055 E imsd : ImsTimer.cpp | 19 | | 2055 |ImsTimer: ctor
01-17 12:15:48.636 1970 2055 E imsd : RcsProxy.cpp | 35 | | 2055 |RcsProxy::RcsProxy()
01-17 12:15:48.636 1970 2041 E imsd : RcsIpcReqHandler.cpp | 238 | | 2041 |MainThreadEvtHandler:: activatelinklocalRe