Skip to content

Instantly share code, notes, and snippets.

View agatti's full-sized avatar

Alessandro Gatti agatti

  • Montefalco, Italy
  • 03:39 (UTC +02:00)
View GitHub Profile
/*
A0: Source buffer (word-aligned)
A1: Target buffer (byte-aligned)
A2: Samples count (in bytes)
*/
a_law_encode_buffer:
li t0, 0b0100000000000000 /* Prepare source match mask */
// Use the selected value as an offset for a reference with an user-chosen base block.
// @author Alessandro Gatti
// @category References
// @keybinding
// @menupath
// @toolbar
import docking.DialogComponentProvider;
import docking.widgets.table.AbstractSortedTableModel;
import docking.widgets.table.GBooleanCellRenderer;
@agatti
agatti / gist:6c1341fb3107712825164e2f2cda1aed
Created October 25, 2023 19:01
RISC-V native_closure.py
0x00000000 ADDI SP, SP, -52 0xFCC10113
0x00000004 SW RA, 0(SP) 0x00112023
0x00000008 SW S0, 4(SP) 0x00812223
0x0000000C SW S1, 8(SP) 0x00912423
0x00000010 SW S2, 12(SP) 0x01212623
0x00000014 SW S3, 16(SP) 0x01312823
0x00000018 SW S4, 20(SP) 0x01412A23
0x0000001C SW S5, 24(SP) 0x01512C23
0x00000020 SW S6, 28(SP) 0x01612E23
0x00000024 SW S7, 32(SP) 0x03712023
@agatti
agatti / gist:fb66459edc00c52651c0a139983b5b2a
Last active October 25, 2023 13:07
RISC-V native_for.py
0x00000000 ADDI SP, SP, -140 0xFBA08097
0x00000004 SW RA, 0(SP) 0x0011101F
0x00000008 SW S0, 4(SP) 0x0081111F
0x0000000C SW S1, 8(SP) 0x0091121F
0x00000010 SW S2, 12(SP) 0x0121131F
0x00000014 SW S3, 16(SP) 0x0131141F
0x00000018 SW S4, 20(SP) 0x0141151F
0x0000001C SW S5, 24(SP) 0x0151161F
0x00000020 SW S6, 28(SP) 0x0161171F
0x00000024 SW S7, 32(SP) 0x0171101F
initial context bits: 00000000.00000000.00000000.00000000
resolving constructor for instruction bytes at: ram:0462
decide on instruction bits: byte-offset=0, bitrange=(7,7), value=0x0, bytes=0001010(0)
decendent constructors for decision node (complete tree dump ordered by line number):
: {line# 47} <instruction>
: {line# 49} <instruction>
: {line# 153} AND <A>, <ASMEMOP>
: {line# 209} DEC <BITOP>
: {line# 215} HALT
: {line# 220} INC <BITOP>
@agatti
agatti / SignedBiDecleDataType.java
Created May 13, 2020 08:29
CP1600 SBIDECLE data type Raw
package ghidra.program.model.data;
import java.math.BigInteger;
import ghidra.docking.settings.FormatSettingsDefinition;
import ghidra.docking.settings.Settings;
import ghidra.program.model.mem.MemBuffer;
import ghidra.program.model.scalar.Scalar;
public class SignedBiDecleDataType extends AbstractIntegerDataType {
@agatti
agatti / BiDecleDataType.java
Created May 13, 2020 08:28
CP1600 BIDECLE data type
package ghidra.program.model.data;
import java.math.BigInteger;
import ghidra.docking.settings.FormatSettingsDefinition;
import ghidra.docking.settings.Settings;
import ghidra.program.model.mem.MemBuffer;
import ghidra.program.model.scalar.Scalar;
public class BiDecleDataType extends AbstractIntegerDataType {
@agatti
agatti / keybase.md
Created September 11, 2017 15:54
keybase.md

Keybase proof

I hereby claim:

  • I am agatti on github.
  • I am agatti (https://keybase.io/agatti) on keybase.
  • I have a public key ASBnF6I13uZizE99bgbA4Z_53tMmvGmlP164RNEusqGC7wo

To claim this, I am signing this object:

@agatti
agatti / swd.c
Last active November 1, 2016 13:37
/*
* This file is part of the Bus Pirate project
* (http://code.google.com/p/the-bus-pirate/).
*
* Written and maintained by the Bus Pirate project.
*
* To the extent possible under law, the project has
* waived all copyright and related or neighboring rights to Bus Pirate. This
* work is published from United States.
*
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import java.io.IOException;
import java.net.*;
import java.util.ArrayList;
import java.util.List;
public class ProxyTest {