This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original: | |
# https://github.com/gynvael/zrozumiec-programowanie/blob/master/018-Czesc_IV-Rozdzial_12-Format_BMP_i_wstep_do_bitmap/show.cpp | |
# this was converted to JS by GPT4, and then to this PY by GPT3.5 | |
import pygame | |
# Initialize Pygame | |
pygame.init() | |
# Set up the canvas | |
W, H = 256, 256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original: | |
# https://github.com/gynvael/zrozumiec-programowanie/blob/master/018-Czesc_IV-Rozdzial_12-Format_BMP_i_wstep_do_bitmap/show.cpp | |
import tkinter as tk | |
from PIL import Image, ImageTk | |
def create_gradient(width, height): | |
gradient = Image.new('RGBA', (width, height)) | |
pixels = gradient.load() | |
for y in range(height): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from glob import glob | |
res = bytearray(1920 * 1080) | |
cnt = 0 | |
dmpcnt = 0 | |
for i in range(290, 4489): | |
fn = f"1/output_{i:05}.png" | |
cnt += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# BBCTF 2023 Visionary Cipher solver by Gynvael Coldwind | |
from string import ascii_lowercase, digits | |
from random import choices | |
from hashlib import md5 | |
import sys | |
alphabets = ascii_lowercase + digits + "_{}" | |
def pos(ch): | |
return alphabets.find(ch) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define ARR_SZ 1024 | |
#define _TOSTR(a) #a | |
#define TOSTR(a) _TOSTR(a) | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define ARR_SZ 1024 | |
#define _TOSTR(a) #a | |
#define TOSTR(a) _TOSTR(a) | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define ARR_SZ 1024 | |
int main() | |
{ | |
FILE *f = fopen("ctext.txt", "r"); | |
if (f == NULL) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <x86intrin.h> | |
int main() { | |
volatile uint8_t *arr1 = malloc(4096 * 16); | |
for (size_t i = 0; i < 4096 * 16; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Show a triangle at mouse position, always on top. | |
// Warning: This was coded in 40 minutes, so the quality isn't the greatest :shrug: | |
// Blame: Gynvael Coldwind (2021) | |
// Known issues: | |
// - The "cursor" doesn't change between a normal arrow / text arrow / etc. It's just a triangle. | |
// - There is a minor lag to the "cursor" changing position. | |
// - Size probably doesn't adjust to DPI. Didn't test. | |
// - The "cursor" is a pixel off - that's kinda a workaround to not block the actual cursor's hot point. | |
// How to compile: | |
// g++ cursor_on_top.cc -Wall -Wextra -lgdi32 -o cursor_on_top.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <stdio.h> | |
#include <string> | |
using std::string; | |
void testdev(string devname) { | |
string path = "\\\\?\\Global\\GLOBALROOT\\Device\\" + devname; | |
printf("----------------- %s\n", devname.c_str()); |