Skip to content

Instantly share code, notes, and snippets.

View uidops's full-sized avatar
☄️
_-_-_-_- ^ -_-_-_-_

joe uidops

☄️
_-_-_-_- ^ -_-_-_-_
View GitHub Profile
@uidops
uidops / fibonacci.c
Last active June 11, 2021 09:52
Fibonacci in c (recursive and with gmp)
#include <gmp.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
typedef unsigned int fib_int;
uint64_t fib_recursive(fib_int);
uint64_t fib__(fib_int, fib_int, fib_int);
uint64_t fib(fib_int);
@uidops
uidops / partitions.c
Created April 12, 2021 07:53
Show the partitions of a device block in c
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
@uidops
uidops / sin.c
Last active December 25, 2022 17:14
Simple sine function
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
@uidops
uidops / base64.c
Last active April 11, 2021 13:27
base64 encode and decode with openssl
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
@uidops
uidops / utmp.c
Last active April 13, 2021 06:36
Simple utmp reader writen in c language
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
#!/bin/sh
while [ 1 ]; do
#fortune=`echo $(fortune -s) | sed "s/'//g"`
weather=`curl -s "https://wttr.in/qazvin?format=%C,+%t"`
if [[ "$weather" == *"Unknown"* ]]; then
weather="Unknow"
fi
time=`date +"%H:%M"`
date=`jdate +"%D"`
@uidops
uidops / bri.py
Last active April 19, 2021 13:33
Simple brightness control
#!/usr/bin/env python3
# coded by uidops
import sys
SYS_CLASS = "/sys/class/backlight/intel_backlight/brightness"
MAX_BRIGHTNESS = "/sys/class/backlight/intel_backlight/max_brightness"
def banner():
@uidops
uidops / ntp.c
Last active March 18, 2021 06:49
Simple NTP Client with C
/*
* NTP Client.
* Copyright (c) 2021 uidops.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@uidops
uidops / whoami.c
Created March 11, 2021 11:52
Whoami (print effective userid) with C
/*
* Whoami - print effective userid
* Copyright (c) 2021 uidops.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@JamesHagerman
JamesHagerman / DisassembleARMBinaryInR2.md
Last active March 30, 2023 06:43
Some quick notes on disassembling 16bit ARM (STM32F4) code using radare2

Disassembling 1bitsy examples using radare2

Note that because radare2 uses Capstone to disassemble ARM code, there are issues with the disassembly. arm-none-eabi-objdump -d compiledbinary.elf actually does a better job in some cases. For example, msr isn't decompiled correctly...

First, you have to either strip the default ELF binaries the default Makefiles build when you run make OR you need to just compile .bin files using something like:

make binaryname.bin