uasm

package
v0.0.0-...-6437eea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

package uasm implements a boneless pseudo assembler and linker for ARMv6. It's used to generate payloads for wInd3x without relying on a third-party assembler at runtime, or precompiling payloads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Add

type Add struct {
	Dest  Register
	Src   Register
	Compl DataSource
	// contains filtered or unexported fields
}

type And

type And struct {
	Dest  Register
	Src   Register
	Compl DataSource
	// contains filtered or unexported fields
}

type B

type B struct {
	Cond Condition
	Dest BranchTarget
	// contains filtered or unexported fields
}

type Blx

type Blx struct {
	Dest Register
	// contains filtered or unexported fields
}

type BranchTarget

type BranchTarget interface {
	// contains filtered or unexported methods
}

Branch target is an operand that can be interpreted as a program address.

type Bx

type Bx struct {
	Dest Register
	// contains filtered or unexported fields
}

type Cmp

type Cmp struct {
	A Register
	B DataSource
	// contains filtered or unexported fields
}

type Condition

type Condition string
const (
	AL Condition = ""
	NE Condition = "NE"
)

func (Condition) Encode

func (c Condition) Encode() uint32

type Constant

type Constant uint32

Constant is a 32-bit number that will end up in a constant pool.

type DataSource

type DataSource interface {
	// contains filtered or unexported methods
}

DataSource is an operand which can be a source of data to a non-memory operation.

type Embed

type Embed []byte

type Immediate

type Immediate uint32

Immediate is a data source (for operations like mov, add, etc).

type Label

type Label string

type LabelRef

type LabelRef string

type Ldr

type Ldr struct {
	Dest Register
	Src  LoadSource
	// contains filtered or unexported fields
}

type Ldrb

type Ldrb struct {
	Dest Register
	Src  LoadSource
	// contains filtered or unexported fields
}

type LoadSource

type LoadSource interface {
	// contains filtered or unexported methods
}

LoadSource is an operand which can be a source of data to a memory operation.

type Mcr

type Mcr struct {
	Opc  uint8
	CRn  uint8
	Src  Register
	CPn  uint8
	Opc2 uint8
	CRm  uint8
	// contains filtered or unexported fields
}

type MemoryDeref

type MemoryDeref struct {
	Reg    Register
	Offset uint16
}

func Deref

func Deref(r Register, offset uint16) MemoryDeref

type Mov

type Mov struct {
	Dest Register
	Src  DataSource
	// contains filtered or unexported fields
}

type Mrc

type Mrc struct {
	Opc uint8
	// CRn is the coprocessor register number.
	CRn  uint8
	Dest Register
	// CPn is the coprocessor number (eg. CP15).
	CPn  uint8
	Opc2 uint8
	// CRm is the additional coprocessor register number.
	CRm uint8
	// contains filtered or unexported fields
}

type Or

type Or struct {
	Dest  Register
	Src   Register
	Compl DataSource
	// contains filtered or unexported fields
}

type Program

type Program struct {
	Address uint32
	Listing []Statement
}

Program is a snippet of ARM code to be run at a given address.

func (*Program) Assemble

func (p *Program) Assemble() []byte

type Register

type Register int
const (
	R0 Register = 0
	R1 Register = 1
	R2 Register = 2
	R3 Register = 3
	R4 Register = 4
	SP Register = 13
	LR Register = 14
	PC Register = 15
)

func (Register) Encode

func (r Register) Encode() uint32

type Statement

type Statement interface {
	// contains filtered or unexported methods
}

Statement is a listing line, eg. instruction or label.

type StoreDest

type StoreDest interface {
	// contains filtered or unexported methods
}

StoreDest is an operand which can be a destination for a memory operation.

type Str

type Str struct {
	Src  Register
	Dest StoreDest
	// contains filtered or unexported fields
}

type Strb

type Strb struct {
	Src  Register
	Dest StoreDest
	// contains filtered or unexported fields
}

type Sub

type Sub struct {
	Dest  Register
	Src   Register
	Compl DataSource
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL