Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 933 Bytes

README.md

File metadata and controls

44 lines (36 loc) · 933 Bytes

hexcalc

Simple command line tool for hexadecimal (aslo hexadecimal and decimal mixed) calculations

Purpose

Tool is very usefull when you are working with terminal, Some times, it's necessary to calculate address and set a breakpoint, I got crazy openning hex calculator, converting decimals to hexadecimals, calculating, and going back to terminal. Thats why I wrote this small tool.

Compilation

gcc main.c -o bin/hexcalc

Instalation

sudo cp bin/hexcalc /usr/bin

or if you're running under osx, see already compiled file (bin/hexcalc)

Usage

Conversions

$>> hexcalc 12345
evaling: 12345
result : 0x3039

Hexadecimal calculations

>> hexcalc 0xffffaaaa - 0xaaaa + 0xbbbb 
evaling: 0xffffaaaa-0xaaaa+0xbbbb
result : 0xffffbbbb

Mixed calculations

>> hexcalc 0xffffaaaa + 1234 - 0xa - 234
evaling: 0xffffaaaa+1234-0xa-234
result : 0xffffae88