REMEBER! What I have shown you is for 8 bits...
IF you require 16 bits the subtract your number from 65535...
(Similarly for 32 bits, etc...)
Look at your problem logically...
"$1" is the first user argument of your shell script and it looks as though you will be entering your script as something like this:-
<CR> == carraiage return...
You have saved this argument inside your variable "i"
So "i" now contains a _string_ representation of your binary value...
Use something like:-
To change each bit...
This method keeps it all inside bash builtins...
I am at work ATM so replies will be sporadic from me so have a go yourself... ;o)
I have the following simple code to return a binary number in a array format given an interger and the number of the bits for specifying the interger as binary number.
#include <stdio.h>
#include <stdlib.h>
int main ()
{
// int* get_binary_number(int* bit_array, int num, int... (8 Replies)
Hi All,
Is there any command which can convert binary decimal coded values to ascii values...
i have bcd values like below
оооооооооооо0о-- -v -
Pls suggest a way to convert this.
Thanks,
Deepti.Gaur (3 Replies)
Hi, I've tried a lot of negate codes in this forum, but they do not perform what I intended. Please help.
inputfile:
Paragraph1 contents: die1, die2, die3, pr_name1, pr_name2
pr_name3, pr_name4
Paragraph2 more contents: die1, die2, die3, pr_name1, pr_name2
pr_name3, pr_name4
... (5 Replies)
Anybody please help me...
Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary Coded Decimal) representation. Also, draw its Flow Chart.
This is a unix qn...
plz post algorithm for that :confused: (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary... (2 Replies)
Hello,
I have script which work fine on particular data.file .
The next feature I want to achieve is to get the decimal equivalent of data to data.
The data looks like this :
data(01000000000000000000110000000000)
thank you..
#include <iostream>
#include <fstream>
#include... (4 Replies)
Hi ,
seq can be 0...128
int windex = seq / 8;
int bindex = seq % 8;
unsigned char bitvalue = '\x01' << (7-bindex) ;
bpv.bitmapvalue = bitvalue;
This is the part of a program to convert decimal to bitmap value of hexadecimal.
I want this to change to convert only to... (1 Reply)
Is there a fast way to convert a negative decimal value into a signed binary number in bash script ? I've looked a lot on internet but I saw nothing... (For exemple : -1 become 11111111.) (9 Replies)
Discussion started by: Zedki
9 Replies
LEARN ABOUT DEBIAN
ranal2
RANAL2(1) BSD General Commands Manual RANAL2(1)NAME
ranal2 -- radare2 code analysis commandline frontend
SYNOPSIS
ranal2 [-BhL] [-a arch] [-b bits] [-l inputlen] [-o offset] hexpairs|-
DESCRIPTION
ranal2 provides a commandline utility to test and perform some code analysis work on a provided hexpair as argument or from stdin if the
argument is '-'.
-a arch Set a different architecture (x86, ppc, arm, java)
-b bits Specify bit size of registers: 8, 16, 32, 64
-B Input is binary, -l is mandatory. Useful for stdin
-h Show help message
-l len Specify length of input data
-L List all supported code analysis plugins
-o offset Offset of the opcode to assemble
SEE ALSO radare2(1), rafind2(1), rahash2(1), rabin2(1), radiff2(1), ragg2(1), rarun2(1), rasm2(1), rax2(1),
AUTHORS
pancake <pancake@nopcode.org>, nibble <nibble@develsec.org>
BSD Oct 27, 2010 BSD