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> | |
#if defined(_MSC_VER) | |
# pragma section(".text", read, execute) | |
__declspec(allocate(".text")) | |
#elif defined(__GNUC__) | |
__attribute__((section(".text"))) | |
#endif | |
const char code[] = | |
// push %rbp |
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 <unistd.h> | |
#include <sys/mman.h> | |
static const unsigned char code[] = | |
// mov $0x01,%rax | |
"\x48\xc7\xc0\x01\x00\x00\x00" | |
// mov $0x0d,%edx | |
"\xba\x0d\x00\x00\x00" | |
// mov $0x01,%edi | |
"\xbf\x01\x00\x00\x00" |
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
/*! | |
* @file GeneratorElfX64.hpp | |
* @brief x64 ELF binary generator | |
* @author koturn | |
*/ | |
#ifndef GENERATOR_ELF_X64_HPP | |
#define GENERATOR_ELF_X64_HPP | |
#include <iostream> |
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
hello.out: ファイル形式 elf64-x86-64 | |
セクション .text の逆アセンブル: | |
00000000080480b0 <.text>: | |
80480b0: 48 bb 00 80 24 08 00 movabs $0x8248000,%rbx | |
80480b7: 00 00 00 | |
80480ba: 80 03 0a addb $0xa,(%rbx) |
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
nnoremap [a :<C-u>previous<CR> | |
nnoremap ]a :<C-u>next<CR> | |
nnoremap [A :<C-u>first<CR> | |
nnoremap ]A :<C-u>last<CR> | |
nnoremap [b :<C-u>bprevious<CR> | |
nnoremap ]b :<C-u>bnext<CR> | |
nnoremap [B :<C-u>bfirst<CR> | |
nnoremap ]B :<C-u>blast<CR> |
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
snippet main | |
func main() | |
${0:TARGET} | |
end func | |
snippet fn | |
alias def | |
func ${1:#:name}(${2:#:args...})${3:\: ${4:\#:type\}} | |
${0:TARGET} | |
end func |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
namespace ArgumentParser | |
{ | |
/// <summary> |
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
CXX := g++ -std=gnu++14 | |
CXXFLAGS := -Wall -Wextra -O3 -march=native -DNDEBUG | |
LDFLAGS := -s | |
TARGET := hoge | |
SRCS := $(wildcard *.cpp *.cxx *.cc) | |
OBJS := $(foreach PAT,%.cpp %.cxx %.cc,$(patsubst $(PAT),%.o,$(filter $(PAT),$(SRCS)))) | |
ifeq ($(OS),Windows_NT) | |
TARGET := $(addsuffix .exe, $(TARGET)) | |
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
func main() | |
var str: []char :: "abcdefgh" | |
var array: []char :: #[42]char | |
do cui@print((^array).toStr()) { => 8 になる} | |
do cui@print(array[0].toStr()) { => a になる} | |
end func |
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
func main() | |
var bfSource: []char :: "+++++++++[>++++++++>+++++++++++>+++++<<<-]>.>++.+++++++..+++.>-.------------.<++++++++.--------.+++.------.--------.>+." | |
var pc: int | |
var hp: int | |
var heap : []bit8 :: #[65536]bit8 | |
var reader: @InputReader :: #@InputReader | |
while(pc < ^bfSource) | |
switch(bfSource[pc]) | |
case '+' | |
do heap[hp] :+ 1b8 |