Skip to content

Instantly share code, notes, and snippets.

View LivingInSyn's full-sized avatar

Jeremy Mill LivingInSyn

View GitHub Profile
@LivingInSyn
LivingInSyn / palindrome.py
Last active September 29, 2016 21:31
finding palindrome substrings with python
def palindrome(input):
length = len(input)
palindromes = []
for x in range(2,len(input)+1):
min = 0
while (min+x) < length+1:
if(input[min:(min+x)] == input[min:(min+x)][::-1]):
palindromes.append(testString)
min = min+1
return palindromes
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace rate_limited_threadpool
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.IO;
namespace TimingAttack
{
//define external crates
extern crate time;
//start main function
fn main() {
//define the full tokens, immutable str's
let valid_token = "qCXQ8v73jv8L2m/YXOfWB55mJzDubC0s51r3nHqLsBFTlaPTO8vBDcLJVs/Rt8j4VjiA3VDUMy8gK+eagU9JVw==";
let invalid_token = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZ123456789abcdefghijklmnopqrstuvwxy==";
//define the arrys which will hold the times for each trial
let mut correct_times: [u64;200] = [0;200];
extern crate time;
extern crate rand;
use time::PreciseTime;
use rand::Rng;
fn main() {
for n in 0..101{
let start_double_shift = PreciseTime::now();
for n in 0..101 {
let num = rand::thread_rng().gen_range(0, 255);
month30 = [4, 6, 9, 11]
month31 = [1, 3, 5, 7, 8, 10, 12]
for year in range(17,100):
for month in range(1,13):
if month in month30:
upper = 31
elif month in month31:
upper = 32
else:
<style>
.vAlign {
min-height: 100%;
display: inline-flex;
align-items: center;
width:100%;
}
.cAlign {
display:inline-flex;
flex-direction:column;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace rust_dll_poc
{
[StructLayout(LayoutKind.Sequential)]
@LivingInSyn
LivingInSyn / lib.rs
Last active December 11, 2020 03:17
//using statements
use std::os::raw::c_char;
use std::ffi::CString;
//static var
static mut STRING_POINTER: *mut c_char = 0 as *mut c_char;
///structs
#[repr(C)]
pub struct SampleStruct {
pub field_one: i16,
#include "stdafx.h"
#include "TranslateOutput.h"
typedef SomeStruct(CALLBACK* GetSomeStructType)();
int main()
{
HINSTANCE dllHandle = NULL;
dllHandle = LoadLibrary(L"translator_test.dll");