Skip to content

Instantly share code, notes, and snippets.

View kohnakagawa's full-sized avatar
🌴
On vacation

tsunekoh kohnakagawa

🌴
On vacation
View GitHub Profile
@theevilbit
theevilbit / macos_sonoma_launch_constraints.txt
Last active April 13, 2024 20:25
macOS Sonoma (14) Launch Constraints
Original by LinuS Henze for iOS16: https://gist.github.com/LinusHenze/4cd5d7ef057a144cda7234e2c247c056
Following his format I updated it for macOS Sonoma (14) and I guess it's the same for iOS17, but didn't cross check.
Constraint Categories:
Category 0:
Self Constraint: N/A
Parent Constraint: N/A
Category 1:
@theevilbit
theevilbit / screenshot.m
Last active April 19, 2024 07:55
Make a screenshot on macOS using Objective-C
/*
Compile:
gcc -framework Foundation -framework AppKit screenshot.m -o screenshot
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
int main(void) {
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@uemuraj
uemuraj / symchk.md
Created July 28, 2019 05:56
Windows デバッグ用シンボルファイルのダウンロード

シンボルファイルのダウンロードはもう無くなったそうです。デバッガに付属の symchk.exe でダウンロードします。

以下は Visual Studio 2019 のデフォルトのキャッシュディレクトリにシンボルファイルをダウンロードする例:

symchk /r C:\Windows\SysWOW64 /s SRV*%TEMP%\SymbolCache*https://msdl.microsoft.com/download/symbols
symchk /r C:\Windows\System32 /s SRV*%TEMP%\SymbolCache*https://msdl.microsoft.com/download/symbols

ちょっと罠なのは:

  • Visual Studio の最新をインストールしていると SDK の最新が入った状態になるけれど symchk が無いみたい

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

非破壊 TypeSctript

mizchi / TypeScript Meetup 2


About

  • mizchi / 竹馬光太郎
  • フロントエンドと Node.js
@knightsc
knightsc / psx.c
Last active April 17, 2022 01:04
Loops through all running processes and prints out ones that have had threads injected or hijacked
#include <stdio.h>
#include <stdlib.h>
#include <libproc.h>
#include <mach/mach.h>
bool
has_modifications(struct task_extmod_info *info)
{
if ((info->extmod_statistics.thread_creation_count > 0) ||
(info->extmod_statistics.thread_set_state_count > 0)) {
@h4z31
h4z31 / syscall_number_mapper.py
Created October 17, 2018 14:30
[rough] mapping system call numbers of Zw APIs from local ntdll.dll on Windows 10 by binaryninja
from binaryninja import *
log_to_stderr(1)
def get_syscall_no(zwf):
for b in zwf.basic_blocks:
for i in b.get_disassembly_text():
if str(i).startswith("syscall"):
eax = zwf.get_reg_value_at(i.address, "eax")
if eax.type == RegisterValueType.ConstantValue:
@laanwj
laanwj / alphanumeric.md
Last active February 4, 2021 09:37
Alphanumeric instructions on RISC-V

Alphanumeric shellcode on RISC-V

Although common on x86, it was initially believed that it was not possible to make alphanumeric shellcode for ARM. Later it turned out it was.

Similar to that, I wondered if it was possible to make alphanumeric shell-code for RISC-V.

(Basic shellcode in RISC-V Linux provides a good introduction to shellcode for RISC-V, including how to avoid NUL bytes.)

First, I enumerated all the possible instructions that could be formed from these characters with a little Rust program and generated some statistics.

@kaityo256
kaityo256 / hpl.md
Last active November 18, 2020 09:34
HPLについて

HPLについて

これは以前Twitterに連投したものと、Qiitaに書いたものをまとめて加筆修正したものです。

はじめに

だいぶ前に一世を風靡し、今はもはや風化し始めている「2位じゃダメなんでしょうか?」という言葉がありました。ここで1位とか2位とか言っているのは、狭義にはスパコンのランキングTOP500の順位のことを指します。TOP500は、HPLというベンチマークによりスパコンの性能を測定し、そのランキングを決めるもので、年に2回ランキングが更新されます。以前、初代地球シミュレータが5期連続でトップを守りましたが、これは5年ではなく、2年半トップであった、というものです。

HPLとは、一言でいえば馬鹿でかい連立一次方程式を解くベンチマークです。問題サイズは自由に決められます。問題サイズが大きいほど性能を出しやすいですが、その分計算時間がかかるようになるため、実際には数時間〜数十時間程度で実行できる範囲のサイズが選ばれることが多いようです。問題が連立一次方程式なので、解いたあとに実際に代入して答えが合っているかどうかを確認します。実際には計算誤差などがあるため、その誤差が規定範囲内に収まっていれば合格となり、その時の演算性能がTOP500への報告値となります。