• Stars
    star
    371
  • Rank 115,103 (Top 3 %)
  • Language PLpgSQL
  • License
    GNU General Publi...
  • Created over 9 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

We're insanely passionate about command line asm documentation in the cloud, and we're crushing it!

cgasm

About

cgasm is a standalone, offline terminal-based tool with no dependencies that gives me x86 assembly documentation. It is pronounced "SeekAzzem".

https://storify.com/thegrugq/once-upon-a-time-in-the-valley

Installation

You should follow the instructions to install Go, if you haven't already done so. Then:

$ go get github.com/bnagy/cgasm

The binary is standalone - it's statically linked and the data is compiled in. You can cross compile this to any architecture that go supports.

Acknowledgements

  • nologic for doing the hard work on idaref
  • @brnocrist for being the first to point me at it

Usage

What was that AES thing...?

velleity:~ ben$ cgasm -f aes
Fuzzy matches for "aes" (12):
AESENC - Perform One Round of an AES Encryption Flow
VAESIMC -> AESIMC - Perform the AES InvMixColumn Transformation
AESKEYGENASSIST - AES Round Key Generation Assist
AESIMC - Perform the AES InvMixColumn Transformation
VAESDECLAST -> AESDECLAST - Perform Last Round of an AES Decryption Flow
AESDEC - Perform One Round of an AES Decryption Flow
VAESENC -> AESENC - Perform One Round of an AES Encryption Flow
VAESDEC -> AESDEC - Perform One Round of an AES Decryption Flow
VAESENCLAST -> AESENCLAST - Perform Last Round of an AES Encryption Flow
AESENCLAST - Perform Last Round of an AES Encryption Flow
VAESKEYGENASSIST -> AESKEYGENASSIST - AES Round Key Generation Assist
AESDECLAST - Perform Last Round of an AES Decryption Flow

Default output is a summary

velleity:~ ben$ cgasm aesenc
AESENC - Perform One Round of an AES Encryption Flow

Description:
This instruction performs a single round of an AES encryption flow using a round
key from the second source operand, operating on 128-bit data (state) from the
first source operand, and store the result in the destination operand. Use the
AESENC instruction for all but the last encryption rounds. For the last encryption
round, use the AESENCCLAST instruction. 128-bit Legacy SSE version: The first
source operand and the destination operand are the same and must be an XMM register.
The second source operand can be an XMM register or a 128-bit memory location.
Bits (VLMAX1:128) of the corresponding YMM destination register remain unchanged.
VEX.128 encoded version: The first source operand and the destination operand
are XMM registers. The second source operand can be an XMM register or a 128-bit
memory location. Bits (VLMAX-1:128) of the destination YMM register are zeroed.

Or go full nerd

velleity:~ ben$ cgasm -v aesenc

AESENC - Perform One Round of an AES Encryption Flow:
| Opcode/Instruction                   | Op/En| 64/32-bit Mode| CPUID Feature Flag    | Description
| 66 0F 38 DC /r AESENC xmm1, xmm2/m128| RM   | V/V           | AES                   | Perform one round of an AES encryption
|                                      |      |               |                       | flow, operating on a 128-bit data (state)
|                                      |      |               |                       | from xmm1 with a 128-bit round key from
|                                      |      |               |                       | xmm2/m128.
| VEX.NDS.128.66.0F38.WIG DC /r VAESENC| RVM  | V/V           | Both AES and AVX flags| Perform one round of an AES encryption
| xmm1, xmm2, xmm3/m128                |      |               |                       | flow, operating on a 128-bit data (state)
|                                      |      |               |                       | from xmm2 with a 128-bit round key from
|                                      |      |               |                       | the xmm3/m128; store the result in xmm1.

Instruction Operand Encoding:
| Op/En| Operand 1       | Operand2     | Operand3     | Operand4
| RM   | ModRM:reg (r, w)| ModRM:r/m (r)| NA           | NA
| RVM  | ModRM:reg (w)   | VEX.vvvv (r) | ModRM:r/m (r)| NA

Description:
This instruction performs a single round of an AES encryption flow using a round
key from the second source operand, operating on 128-bit data (state) from the
first source operand, and store the result in the destination operand. Use the
AESENC instruction for all but the last encryption rounds. For the last encryption
round, use the AESENCCLAST instruction. 128-bit Legacy SSE version: The first
source operand and the destination operand are the same and must be an XMM register.
The second source operand can be an XMM register or a 128-bit memory location.
Bits (VLMAX1:128) of the corresponding YMM destination register remain unchanged.
VEX.128 encoded version: The first source operand and the destination operand
are XMM registers. The second source operand can be an XMM register or a 128-bit
memory location. Bits (VLMAX-1:128) of the destination YMM register are zeroed.

Operation:

AESENC
STATE <- SRC1;
RoundKey <- SRC2;
STATE <- ShiftRows( STATE );
STATE <- SubBytes( STATE );
STATE <- MixColumns( STATE );
DEST[127:0] <- STATE XOR RoundKey;
DEST[VLMAX-1:128] (Unmodified)
VAESENC
STATE <- SRC1;
RoundKey <- SRC2;
STATE <- ShiftRows( STATE );
STATE <- SubBytes( STATE );
STATE <- MixColumns( STATE );
DEST[127:0] <- STATE XOR RoundKey;
DEST[VLMAX-1:128] <- 0

Intel C/C++ Compiler Intrinsic Equivalent:
| (V)AESENC:| __m128i _mm_aesenc (__m128i, __m128i)

SIMD Floating-Point Exceptions:
None

Other Exceptions:
See Exceptions Type 4.

License

GPLv2, see LICENSE.md for details

TODO

Nothing. No other features. Ever.

Contributing

I. Will. Cut. You.

More Repositories

1

crashwalk

Bucket and triage on-disk crashes. OSX and Linux.
Go
349
star
2

gapstone

gapstone is a Go binding for the capstone disassembly library
Go
151
star
3

afl-trivia

Short, unrelated helper scripts for users of AFL (the fuzzer)
Shell
110
star
4

afl-launch

Boring tool to launch multiple afl-fuzz instances
Go
49
star
5

crabstone

crabstone is a Ruby binding to the capstone disassembly library by Nguyen Anh Quynh
C#
40
star
6

francis

LLDB engine based tool to instrument OSX apps and triage crashes
Python
26
star
7

slides

Some slides from some presentations I have given
25
star
8

raf

Ruby ALPC Fuzzer ( joke )
Ruby
24
star
9

osx-afl-llvm

Barely working LLVM mode for AFL on OSX
C
20
star
10

rBuggery

Ruby wrapper for dbgeng.dll
C
17
star
11

terry

Wrap radamsa on OSX, add instrumentation / triage.
Go
15
star
12

enough

Just enough TLS sugar
Go
14
star
13

babysit

Run a windows process with many inputs and catch exit codes
Go
14
star
14

gootool

Silly PoC of a limited otool clone based on the capstone disassembly lib
Go
12
star
15

alpcgo

Go tools for basic ALPC hacking
Go
11
star
16

aflfix

Use any program to perform fixups for afl via AFL_POST_LIBRARY
Go
11
star
17

pdflex

Minimal and hacky PDF lexer
Go
10
star
18

alpcmap

Connect to a JSON rBuggery stub to map Windows ALPC information
Go
8
star
19

ruby-kernel

Assorted cut and paste fodder for messing with some syscall / USER / GDI stuff from Ruby.
Ruby
7
star
20

pdftok

Minimal and hacky PDF lexer
Go
6
star
21

bm2-server

Server components for Bugmine 2.0
Ruby
4
star
22

bm2-client

Client code for Bugmine 2.0 (only win32 so far)
Ruby
4
star
23

mqdq-parser

Utility scripts in python for working with XML poems from MQDQ
Python
4
star
24

bm2-core

Shared components for Bugmine 2.0
Ruby
4
star
25

nux-paper

Anxiety and Walnuts
Jupyter Notebook
4
star
26

fail-paper

Jupyter Notebook
3
star
27

rhyme-paper

Preprint: Rhyme in Latin poetry: Stylistic or Stochastic?
Jupyter Notebook
3
star
28

alpcbuggery

Wrapper for the ALPC interaction methods used by github.com/bnagy/alpcmap
Go
3
star
29

metronome

tracing variation in poetic metres via local sequence alignment
Jupyter Notebook
3
star
30

sfst-python

Minimal Python wrapper for the SFST morphological analysis tools
C++
2
star
31

hexml-paper

Preprint: Metre as a stylometric feature in Latin hexameter poetry
Jupyter Notebook
2
star
32

codeloops

Loops created from doubly even binary codes
TeX
2
star
33

ovvo

A project to investigate verb order change in Latin
Python
2
star
34

itunes-dedup

How I dedup my iTunes. Almost certainly dangerously broken.
Ruby
1
star
35

gobuggery

Lower level wrapper for the basic remote debugger connection to github.com/bnagy/rBuggery
Go
1
star