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
// مثال لخطف دالة عن طريق استبدال عنوانها في جدول عناوين الدوال المستوردة | |
// https://twitter.com/barakatsoror/status/1020710139475759105 | |
#include <Windows.h> | |
#include <winternl.h> | |
#include <cstdio> | |
#include <cassert> | |
#include <winnt.h> | |
#include <cstring> | |
#include <cwchar> |
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 <cassert> | |
int | |
main(int argc, char** argv) | |
{ | |
(void)argc; | |
(void)argv; |
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 <cassert> | |
int | |
main(int argc, char **argv) | |
{ | |
(void)argc; | |
(void)argv; | |
// التعليمات مولّدة من هذا الكود: |
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
ASCII_A_CODE = ord('A') | |
def ascii_upper_encode(data): | |
code = '' | |
for byte in data: | |
code += chr((byte >> 4) + ASCII_A_CODE) | |
code += chr((byte & 0xf) + ASCII_A_CODE) | |
return code | |
def ascii_upper_decode(code): |
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
# CMakeLists.txt | |
cmake_minimum_required(VERSION 3.0) | |
project(example) | |
set(CMAKE_CXX_STANDARD 11) | |
find_package(SDL2 REQUIRED) | |
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |
set(CMAKE_COMPILER_IS_CLANGCXX 1) | |
endif () |
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
import java.io.ByteArrayInputStream | |
import java.io.InputStream | |
import java.io.PrintStream | |
import java.util.* | |
import java.util.concurrent.Callable | |
enum class Token constructor(val symbol: String) { | |
IF("if"), | |
ELSE("else"), |
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
def compute_ean13_checksum(barcode): | |
assert len(barcode) == 12 and barcode.isdigit() | |
return (10 - sum(int(i) * j for i, j in zip(barcode, (1, 3) * 6)) % 10) % 10 |
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 <time.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <stdbool.h> | |
typedef struct { | |
size_t rows; | |
size_t columns; |
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 <gl/glew.h> | |
#include <string> | |
void GLAPIENTRY DebugMessageCallback(GLenum source, | |
GLenum type, | |
GLuint id, | |
GLenum severity, | |
GLsizei length, | |
const GLchar* message, | |
const void* userParam) |
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
def caesar_enc(plain, key): | |
plain = plain.encode('utf-8') | |
cipher = bytearray(plain) | |
for i, c in enumerate(plain): | |
cipher[i] = (c + key) & 0xff | |
return bytes(cipher) | |
def caesar_dec(cipher, key): | |
plain = bytearray(len(cipher)) # at most, len(plain) <= len(cipher) | |
for i, c in enumerate(cipher): |