Skip to content

Instantly share code, notes, and snippets.

@NyaMisty
NyaMisty / jetsam.sh
Created November 21, 2022 16:33
Create Jetsam entry
JETSAM="/System/Library/LaunchDaemons/com.apple.jetsamproperties.D21.plist"
DAEMON="misty.qtierdaemon"
sudo plutil -Version4 -Daemon -Override -key "$DAEMON" -dict $JETSAM
sudo plutil -Version4 -Daemon -Override -key "$DAEMON" -key ActiveHardMemoryLimit -int 256 $JETSAM
sudo plutil -Version4 -Daemon -Override -key "$DAEMON" -key ActiveSoftMemoryLimit -int 256 $JETSAM
sudo plutil -Version4 -Daemon -Override -key "$DAEMON" -key InactiveHardMemoryLimit -int 256 $JETSAM
sudo plutil -Version4 -Daemon -Override -key "$DAEMON" -key InactiveSoftMemoryLimit -int 256 $JETSAM
sudo plutil -Version4 -Daemon -Override -key "$DAEMON" -key EnergyEfficiencyMode -string UserInterface $JETSAM
@NyaMisty
NyaMisty / outline_graph.py
Created September 1, 2022 01:02
IDA Graph view with outlined function included
"""
summary: drawing custom graphs
description:
Showing custom graphs, using `ida_graph.GraphViewer`. In addition,
show how to write actions that can be performed on those.
keywords: graph, actions
"""
from __future__ import print_function
# -----------------------------------------------------------------------
@NyaMisty
NyaMisty / jeb-shortcuts.cfg
Created May 15, 2022 15:20
Better JEB Shortcut
#*TEMPLATE*
#*TEMPLATE* Rename or copy this file without the .TEMPLATE extension
#*TEMPLATE*
#------------------------------------------------------------------------------
# JEB Custom Keyboard Shortcuts
#------------------------------------------------------------------------------
# Uncomment and add your own keyboard shortcuts for the actions for which you'd like to override the default shortcuts
# Example: by default, Jump is mapped to the 'G' key; the following line (minus the # character) can be used to remap the action to CTRL+J:
#jump=Ctrl+J
@NyaMisty
NyaMisty / README.md
Created May 4, 2022 22:21
WSL Systemd Configuration: in 2022
@NyaMisty
NyaMisty / mem_scan.c
Last active September 9, 2022 23:05
search for mem with hex pattern contains wildcards
#include <stdio.h>
#include <stdlib.h>
static void* mem_scan(const void* addr, size_t size, const char* hex_pattern) {
union pattern_holder {
struct {
unsigned char content : 8;
unsigned char mask : 8;
};
wchar_t pat_char;
@NyaMisty
NyaMisty / extract-installbuilder.tcl
Last active September 3, 2023 11:11 — forked from zhangyoufu/extract-installbuilder.tcl
extract password-protected InstallBuilder installer
#!./tclkit
## prepare runtime environment
proc init {} {
## mount optional.pak (for tcltwofish)
set optionalPak installbuilder/paks/optional.pak
vfs::mk4::Mount $optionalPak $optionalPak -readonly
## adjust library search path
set ::auto_path [list $tcl::kitpath/lib/tcl$::tcl_version $tcl::kitpath/lib $tcl::kitpath/libraries $optionalPak/linux-x64 $tcl::kitpath]
@NyaMisty
NyaMisty / README.md
Created December 28, 2021 22:37
Make HNS not consuming too much ports
@NyaMisty
NyaMisty / README.md
Last active January 1, 2024 15:15
Resync IDA Local Types

Resync Local Types in IDA

Sometimes there's some inconsistency between local types and structs view.

Typically, you can see the type in the "Structures" view are zero-lengthed, which should normally be the same size as local type's one.

When this happens, you'll not be able to rename the structure fields in HexRay Decompiler's view, and both hotkey N and right-clicking the item won't show the rename popup.

After reverse engineering the hexx64.dll, I found that IDA tries to do the following things:

@NyaMisty
NyaMisty / idapython_ctree.md
Created October 29, 2021 15:06 — forked from icecr4ck/idapython_ctree.md
Notes on CTREE usage with IDAPython

IDAPython CTREE

Important links

Description

The CTREE is built from the optimized microcode (maturity at CMAT_FINAL), it represents an AST-like tree with C statements and expressions. It can be printed as C code.

@NyaMisty
NyaMisty / XX_ida_with_struct_py3.py
Created September 18, 2021 21:01
Il2CppDumper Script Improved
# -*- coding: utf-8 -*-
import json
import idaapi
import idc
processFields = [
"ScriptMethod",
"ScriptString",
"ScriptMetadata",
"ScriptMetadataMethod",