Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.
| Command | Purpose |
|---|---|
fastboot devices |
Lists attached devices, along with their serial number |
fastboot oem unlock |
Unlocks bootloader on most phones |
fastboot oem unlock UNLOCK_CODE |
Use this if you have an unlock code |
fastboot flashing unlock |
May be needed on older devices and some weird mtk phones (Tecno ke5k needed this for some reason) |
fastboot flash PARTITION_NAME PATH_TO_IMAGE |
Flashes the partition with the image file |
--disable-verity --disable-verification |
Add to a vbmeta flash command to disable verified boot |
fastboot erase PARTITION NAME |
Erases the partition USE WITH CAUTION |
fastboot -w |
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
| cmake_minimum_required(VERSION 3.16.3) | |
| project(cppefi C CXX) | |
| if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) | |
| set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") | |
| endif() | |
| if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) | |
| set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") | |
| endif() |
Command:
$ fastboot helpOutput:
usage: fastboot [OPTION...] COMMAND...
flashing:
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
| // Add PNG Image Watermark on an Image using C# | |
| using (Watermarker watermarker = new Watermarker("filePath/image.png")) | |
| { | |
| using (ImageWatermark watermark = new ImageWatermark("filePath/watermarkLogo.png")) | |
| { | |
| // Set Watermark Properties | |
| watermark.X = 20; | |
| watermark.Y = 80; | |
| // Add watermark on image file and save the output | |
| watermarker.Add(watermark); |
In this gist I show how to disassemble and modify a Linux executable binary to change the body of a function. This will allow you to control how a binary behaves, even when you don't have access to the source code and you can't recompile it.
In my case, I was asked to try and bypass the protection mechanism implemented. The protection mechanism implemented was meant to only allow a binary to be run in presence of a valid license.
So basically my activity involved:
- Finding the function which performs the protection check
- Disassembling the binary
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.
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
| from idaapi import PluginForm | |
| from PyQt5 import QtCore, QtGui, QtWidgets | |
| import sip | |
| class MyPluginFormClass(PluginForm): | |
| def OnCreate(self, form): | |
| """ | |
| Called when the widget is created | |
| """ |
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
| pkg install golang | |
| pkg install neovim | |
| pkg install nodejs | |
| curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ | |
| https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |
