View ID Mood Badge - Final!
// Conference Mood Badge - Mark Pentler 2020 | |
// Tested with: ATTiny85 and 13 | |
// Code rev: v0.3 07/08/2020 | |
// 0.01: initial Arduino test code, ATMega328p based | |
// 0.1: Changed to ATTiny85, compiles fine | |
// 0.15: Switched to ATTiny13 and Microcore, switched to direct I/O and removed Arduino-like helper functions | |
// 0.2: Global LEDpin variable replaced with spare register - now 0 bytes RAM used!, compiled size now reduced by a third since 0.1! | |
// 0.3: Power improvements: ADC disabled saved 200-300ish microamps | |
#include <avr/sleep.h> |
View ID Mood Badge v5 - setup changes
// Conference Mood Badge - Mark Pentler 2020 | |
// Tested with: ATTiny85 and 13 | |
// | |
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
#include <avr/io.h> | |
uint8_t LEDpin = PB0; // start on green LED | |
void setup() { |
View ID Mood Badge v4 - Loop change
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
#include <avr/io.h> | |
uint8_t LEDpin = PB0; // start on green LED | |
void setup() { | |
// Configure our input and output pins | |
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0) | |
PORTB |= (1 << PB3); // enable the pull-up resistor on PB3 |
View ID Mood Badge v3 - better datatypes
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
#include <avr/io.h> | |
uint8_t LEDpin = PB0; // start on green LED | |
void setup() { | |
// Configure our input and output pins | |
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0) | |
PORTB |= (1 << PB3); // enable the pull-up resistor on PB3 |
View ID Mood Badge v2 - better sleep
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
int LEDpin = PB0; // start on green LED | |
void setup() { | |
// Configure our input and output pins | |
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0) | |
PORTB |= (1<<PB3); // enable the pull-up resistor on PB3 |
View ID Mood Badge v1 - direct IO
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
const int redLED = PB2; // Define the LED pins | |
const int yellowLED = PB1; | |
const int greenLED = PB0; | |
int LEDpin = greenLED; // start on green LED | |
void setup() { |
View ID Mood Badge v0 - original Arduinoified code.ino
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
const int switchPin = 3; // Define our button pin | |
const int redLED = 2; // Now the LED pins | |
const int yellowLED = 1; | |
const int greenLED = 0; | |
int LEDpin = greenLED; // start on green LED |
View Best temperature
temperatures = get_input() | |
best_position = 0 | |
for i in range (0,len(temperatures-1)): | |
if temperatures[i] > temperatures[best_position]: | |
best_position = i | |
i++ | |
View RSAmultiprimesolver.py
c = 33313552017317510057480429807191513781560058913982045828821573360115041698572293368677814047055248844068758060891046601601923786757545000748868407887139102932189242384290168374262947094252294487798373472224578486694039636927104808579329053474121672431941292997540298195365595309282858493105333766871550453 | |
n = 112844860286954432023527367807878149508433045460166798540067347297771292932276845482784411114349669858383468974822784047292525847593138653258906565706208925369627344743018629414710772644379028885399261868138745339538284054287450499199325709844121836918861140479086394315063831615503697572215910036672241273 | |
e = 65537 | |
primes = (2267190209, # obtain from factordb.com | |
2397761813, | |
2536127557, | |
2634219361, | |
2652518087, | |
2677343507, | |
2678478181, |
View bases.py
import binascii | |
from pwn import * # pwntools | |
# connect | |
r = remote('2018shell.picoctf.com', 1225) | |
# binary | |
print r.readline() # get the first line over with | |
word1 = r.readline() # for some reason the word for part 1 is echoed, so read it in | |
print r.recvuntil("Input:") # skip to where we input word 1 |
NewerOlder