Skip to content

Instantly share code, notes, and snippets.

View ker2x's full-sized avatar

Laurent Laborde ker2x

  • Toulouse, France
  • 16:57 (UTC +02:00)
View GitHub Profile
@ker2x
ker2x / openframworks.cpp
Last active October 5, 2023 19:45
voronoi ?
// create cells with random positions and colors
for (auto i = 0; i < 2000; i++) {
Cell cell;
cell.position.x = ofRandom(0, ofGetWidth());
cell.position.y = ofRandom(0, ofGetHeight());
cell.color = ofColor(ofRandom(0, 255), ofRandom(0, 255), ofRandom(0, 255));
cells.push_back(cell);
}
#pragma omp parallel default(none)
{
srand(chrono::high_resolution_clock::now().time_since_epoch().count() ^ static_cast<long long>(omp_get_thread_num()));
#pragma omp for
for (auto i = 0; i < group1size; i++)
{
package kleolife.gl
import kleolife.data.GraphicData
import org.khronos.webgl.WebGLProgram
import org.khronos.webgl.WebGLRenderingContext
import org.khronos.webgl.WebGLShader
class GLUtils {
companion object {
fun clearScreen(gfx: GraphicData) {
#%%
import tensorflow as tf
import pathlib
import os
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
physical_devices = tf.config.list_physical_devices('GPU')
#%%
import tensorflow as tf
import pathlib
import os
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
physical_devices = tf.config.list_physical_devices('GPU')
#%%
import tensorflow as tf
import pathlib
import os
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Optionally set memory groth to True
@ker2x
ker2x / tensorbrot.ipynb
Created December 5, 2021 11:27
Tensorbrot.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ker2x
ker2x / emotet.md
Last active January 29, 2022 14:03
Reverse engineering emotet, bit by bit

(extracted from main diary)

2021/11/10 : Exploring emotet

  • SHA256 : 878d5137e0c9a072c83c596b4e80f2aa52a8580ef214e5ba0d59daa5036a92f8
  • Probably the scariest trojan of the current days. Let's explore it. I using ghidra again.
  • According to ghidra, the only import is KERNEL32.DLL::WTSGetActiveConsoleSessionId
  • I wonder what it can possibly be with so little and i'll have to find out.
  • The obvious step for now is to find out how it load other functions to be able to do anything.
@ker2x
ker2x / pma.md
Created November 11, 2021 10:43
playing with PMA labs

(extracted from the main diary)

Playing with PMA Labs

  • Let's start with Lab01-01.exe.
  • i'm even using IDE Free 70 instead of my licensed version.
  • According to "detect it easy" it's a 32bits PE executable, unpacked, compiled with MSVC 6.0
  • Opening it in IDA with default option
  • Only the EntryPoint is exported, it import kernel32 and msvcrt
  • Some usefull strings
@ker2x
ker2x / sudo.md
Created November 11, 2021 10:41
how i found a (harmless) bug in sudo

(Extracted from my main diary)

Exploring CVE-2021-3156 @ home

This is what i understood :

  • You can use multiple line in argument by escaping with \
  • Sudo ignore the character following \
  • what if \ is the last character ? it ignores \0 (NULL) and read stuff it shouldn't read because the null terminator is ignored.