I've been using Dtrace off-and-on to diagnose and debug problems on macOS for some years. Unfortunately, some of the scripts that are included with macOS itself have gone rather stale, or didn't survive the port from Solaris/BSD particularly well. This includes the all-important dtruss script for tracing processes' syscalls, which doesn't seem to have changed since Mac OS X 10.5, and where many of its options simply don't work as advertised. While I was doing some development under contract for Microsoft in their attempt at porting VFS for Git to macOS, we needed a passable option for tracing, so I was able to update Mac dtruss and fix many of its issues as part of that engagement. The patches were originally applied on that repo but it's not a good long-term home for them, especially as the Mac port for VFS for Git was stopped when Apple deprecated the APIs used in a subsequent macOS release, so that entire subtree has been removed from recent revisions of the repository. I'll keep up
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
| ;; Change the basic layout of the keyboard a little bit | |
| ; Use just the Home key for Win Tab | |
| Home::#Tab | |
| ; Use the End key to quit programs | |
| End::!F4 | |
| ; Switch between virtual desktops with Page Up and Page Down | |
| PgUp::#^Left |
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
| <!-- put this to IDEA keymaps config folder. For v13 it is <userdir>\.IntelliJIdea13\config\keymaps\ --> | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <keymap version="1" name="Mac OS X 10.5+ Windows Ctrl" parent="Mac OS X 10.5+"> | |
| <action id="$Copy"> | |
| <keyboard-shortcut first-keystroke="meta C" /> | |
| <keyboard-shortcut first-keystroke="meta INSERT" /> | |
| <keyboard-shortcut first-keystroke="control C" /> | |
| <keyboard-shortcut first-keystroke="control INSERT" /> | |
| </action> | |
| <action id="$Cut"> |
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
| ; | |
| ; AutoHotkey Version: 1.x | |
| ; | |
| ; | |
| ; -------------------------------------------------------------- | |
| ; Emulate OSX keymap layout | |
| ; on Windows | |
| ; -------------------------------------------------------------- | |
| #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. |
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
| #!/usr/bin/env python | |
| import r2pipe | |
| import sys | |
| r2 = r2pipe.open() | |
| # r2 base address | |
| delta = 0x400000 |
I started with a Windows 10 Enterprise Evaluation VM, version 1809, from here: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ Then I installed the needed tools:
- Install Visual Studio Community 2019 Edition from https://visualstudio.microsoft.com/downloads/, version 16.4.2. Make sure to install the Desktop development for C++ workload.
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 patmake.py | |
| @brief Creates a pattern file from a database | |
| @author neat | |
| """ | |
| import os | |
| import idautils | |
| import ida_bytes | |
| import ida_funcs |
This has been forked from https://gist.github.com/Alex4386/4cce275760367e9f5e90e2553d655309
For the latest discussion, see the comments there.
- Install dependencies: Xcode developer tools (Command Line); cmake; gcc or clang to compile C code; bison >= 3.0 (can be upgraded via homebrew); xquartz; flex; mingw-w64; pkgconfig; you might also need freetype with
brew install freetype - Make sure the right version of bison is in path:
brew upgrade bisonthen check version andcd /usr/local/Cellar/bison/<version>/binandexport PATH="$(pwd):$PATH"then check withwhich bison - Download source (CodeWeavers CrossOver FOSS version Source) and extract it (double click the file in Finder or untar it:
tar -xz source.tar.gz) - Add missing
wine/include/distversion.hfile with this content:
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
| ############################################################################## | |
| # | |
| # Name: hello_world_plugin.py | |
| # Auth: @cmatthewbrooks | |
| # Desc: A test plugin to learn how to make these work; Specifically, how to | |
| # have multiple actions within the same plugin. | |
| # | |
| # In plain English, IDA will look for the PLUGIN_ENTRY function which | |
| # should return a plugin object. This object can contain all the | |
| # functionality itself, or it can have multiple actions. |
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
| #!/usr/bin/env python | |
| # Script associated with the blog post: https://lief-project.github.io/blog/2022-05-08-macho/ | |
| # It demonstrates code injection with shell-factory and LIEF | |
| import lief | |
| import pathlib | |
| from pathlib import Path | |
| CWD = Path(__file__).parent |