Skip to content

Instantly share code, notes, and snippets.

View canertol's full-sized avatar

Caner Tol canertol

View GitHub Profile
@canertol
canertol / bert_parameter_size_calculator.py
Last active December 19, 2022 23:22
This python scripts gets the configurations and calculates how many parameters exist in a BERT model. It is useful for trying out with different parameters.
# Adapted from https://stackoverflow.com/questions/64485777/how-is-the-number-of-parameters-be-calculated-in-bert-model#:~:text=Total%20parameters%20for%20one%20layer
# and https://github.com/google-research/bert/issues/656
# by Caner Tol.
# BERT Base
hidden_size = 768 # H
intermediate_size = 3072
Layers = 12 # L
vocabulary_size = 30522
Maximum_sequence_length = 512
@canertol
canertol / aes-ni.c
Created January 18, 2022 05:43 — forked from acapola/aes-ni.c
AES128 how-to using GCC and Intel AES-NI
#include <stdint.h> //for int8_t
#include <string.h> //for memcmp
#include <wmmintrin.h> //for intrinsics for AES-NI
//compile using gcc and following arguments: -g;-O0;-Wall;-msse2;-msse;-march=native;-maes
//internal stuff
//macros
#define DO_ENC_BLOCK(m,k) \
do{\
@canertol
canertol / myRules.yar
Created December 14, 2018 12:50
Custom YARA Rules published by Microsoft
rule Trojan_Win32_PlaSrv : Platinum
{
meta:
author = "Microsoft"
description = "Hotpatching Injector"
original_sample_sha1 = "ff7f949da665ba8ce9fb01da357b51415634eaad"
unpacked_sample_sha1 = "dff2fee984ba9f5a8f5d97582c83fca4fa1fe131"
activity_group = "Platinum"
version = "1.0"
last_modified = "2016-04-12"
@canertol
canertol / ioc_yara.py
Last active October 22, 2020 20:48
ioc_yara.py
import yara
import threading
import _thread
from etw import ETW, ProviderInfo
from etw.GUID import GUID
from etw import common
from etw import evntrace as et
# YARA function for YARA threads
def YARA(threadName, rules, data_file):