This file contains 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/env bash | |
# first, we need to determine type of disk | |
# this can be achieved by trying first mount_cd9660 and checking error | |
# if it returns "Device not configured" - we need to wait, | |
# otherwise its not CD9660 fs and we can move to next | |
# | |
# try mounting UDF, if it returns "Invalid argument" - it's not an UDF | |
# | |
# the last remaining disc type is CD audio disc, that we must |
This file contains 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
#!/bin/sh | |
dns="1.1.1.1 8.8.8.8 8.8.4.4" | |
active_network=$(nmcli con show --active | awk 'NR==2 {print $2}') | |
nmcli connection modify uuid $active_network ipv4.ignore-auto-dns yes | |
nmcli connection modify uuid $active_network ipv4.dns "$dns" | |
echo "DNS fixed for ${active_network}" |
This file contains 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 <sys/un.h> | |
#include <sys/unistd.h> | |
#include <sys/socket.h> | |
#include <stdio.h> | |
int main() { | |
int sockfd = socket(PF_UNIX, SOCK_STREAM, 0); | |
struct sockaddr_un addr = {0}; | |
if (sockfd < 0) { |
This file contains 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
int htoi(char h) | |
{ | |
return h < 0x3A ? h - 0x30 : h - 0x57; | |
} | |
void strhex(const char* str, uint8_t* out) | |
{ | |
for (unsigned i = 0; i < strlen(str) >> 1; i++) | |
out[i] = htoi(str[i<<1]) << 4 | htoi(str[i<<1|1]); | |
} |
This file contains 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 "chook.h" | |
CHook::CHook(DWORD Func,SIZE_T Size) | |
{ | |
pFunc = Func; | |
DetourSize = Size; | |
OrigBytes = (PBYTE)malloc(Size); | |
} |
This file contains 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 "disas.h" | |
opcode_t arch[] = { | |
{'\x90',1},{'\x81',6},{'\xC7',6},{'\xA1',5}, | |
{'\x74',2},{'\x33',2},{'\x89',7},{'\x6A',2}, | |
{'\xE8',5},{'\xE9',5},{'\x50',1},{'\x51',1}, | |
{'\x52',1},{'\x53',1},{'\x54',1},{'\x55',1}, | |
{'\x56',1},{'\x57',1},{'\x0E',1},{'\x1E',1}, | |
{'\x16',1},{'\x06',1},{'\x75',2},{'\xCC',1}, | |
{'\xC2',3},{'\xC3',1},{'\xCD',2},{'\x58',1}, |
This file contains 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
void dump_buffer(API::Buffer& buf, unsigned codepage = 0) | |
{ | |
const char ascii_lup = 201, ascii_rup = 187, | |
ascii_lsp = 199, ascii_rsp = 182, | |
ascii_lbt = 200, ascii_rbt = 188, | |
ascii_up_cross = 209, ascii_bt_cross = 207, | |
ascii_cross = 197, | |
ascii_v_sp = 179, ascii_h_sp = 196, | |
ascii_v_border = 186, ascii_h_border = 205; |