Sponsored Content
Full Discussion: Parsing Binary
Top Forums Shell Programming and Scripting Parsing Binary Post 302170689 by Raom on Tuesday 26th of February 2008 12:09:30 PM
Old 02-26-2008
length = *((long *)Len&0xffffffffffffffff) ,should give you correct length (on n/w endian machine)
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Where is M4 binary?

Hello, I am configurating Sendmail on Mac OS 10.x terminal. I tried to execute m4 to generate a new sendmail.cf. It complains "Command not found". Anybody knows where the m4 binary is? Is it something coming along with Unix or Sendmail? Appreciate any help. Thanks in advance. pw (2 Replies)
Discussion started by: hypamw
2 Replies

2. UNIX for Dummies Questions & Answers

binary file

please let me know how can i mail the binary files is it can be done thru pine? is there any other way to do it? wat are the changes in system i have to make and one more thing i am sending data to a message queue and then retriving the data from the queue but when i do the ipcs... (1 Reply)
Discussion started by: ramneek
1 Replies

3. UNIX for Dummies Questions & Answers

binary file

when using telnet localhost 25 I can cat ASCII files into the email body and an attachment, but how do i get a non-ASCII file into it, like a picture or a word document (.doc not rtf). uuencode, just stalls. Any ideas? :confused: (1 Reply)
Discussion started by: markms
1 Replies

4. Solaris

compiled binary file gives "cannot execute binary file"

Hi, I have two Solaris machines. 1. SunOS X 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Blade-1500 2. SunOS Y 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-60 I am trying to buiild a project on both these machines. The Binary output file compiled on machine 2 runs on both the machines. Where... (0 Replies)
Discussion started by: scgupta
0 Replies

5. Shell Programming and Scripting

Perl parsing compared to Ksh parsing

#! /usr/local/bin/perl -w $ip = "$ARGV"; $rw = "$ARGV"; $snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw"; $snmpw = "/usr/local/bin/snmpwalk -Os -c $rw"; $syst=`$snmpg $ip system sysName sysObjectID`; sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies

6. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

7. HP-UX

machinfo binary

Hello, 2 questions: 1. is the binary "machinfo" installed by default on HP-UX servers? 2. which is the packet that installs "machinfo" ? Thank you (1 Reply)
Discussion started by: asanchez
1 Replies

8. Shell Programming and Scripting

inverting a binary

Hi , I have a binary in a variable and i want to invert it and store in a new variable. i mean, replace 0 with 1 and vice versa. I tried reading character by character with the below script but it didnt provide me the proper result. #!/bin/bash count=1 var1="00100011" while ] do ... (4 Replies)
Discussion started by: srinivasayedla
4 Replies

9. Solaris

binary conversion

Why would a binary which was compiled on a Solaris-10 not be runnable in a SunOS 5.10? (they are supposed to be precisely equivalent). When I run the file command on it, it says: ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped, no debugging information available... (10 Replies)
Discussion started by: steve701
10 Replies

10. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies
BN_bn2bin(3)							      OpenSSL							      BN_bn2bin(3)

NAME
BN_bn2bin, BN_bin2bn, BN_bn2hex, BN_bn2dec, BN_hex2bn, BN_dec2bn, BN_print, BN_print_fp, BN_bn2mpi, BN_mpi2bn - format conversions SYNOPSIS
#include <openssl/bn.h> int BN_bn2bin(const BIGNUM *a, unsigned char *to); BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); char *BN_bn2hex(const BIGNUM *a); char *BN_bn2dec(const BIGNUM *a); int BN_hex2bn(BIGNUM **a, const char *str); int BN_dec2bn(BIGNUM **a, const char *str); int BN_print(BIO *fp, const BIGNUM *a); int BN_print_fp(FILE *fp, const BIGNUM *a); int BN_bn2mpi(const BIGNUM *a, unsigned char *to); BIGNUM *BN_mpi2bn(unsigned char *s, int len, BIGNUM *ret); DESCRIPTION
BN_bn2bin() converts the absolute value of a into big-endian form and stores it at to. to must point to BN_num_bytes(a) bytes of memory. BN_bin2bn() converts the positive integer in big-endian form of length len at s into a BIGNUM and places it in ret. If ret is NULL, a new BIGNUM is created. BN_bn2hex() and BN_bn2dec() return printable strings containing the hexadecimal and decimal encoding of a respectively. For negative num- bers, the string is prefaced with a leading '-'. The string must be freed later using OPENSSL_free(). BN_hex2bn() converts the string str containing a hexadecimal number to a BIGNUM and stores it in **bn. If *bn is NULL, a new BIGNUM is cre- ated. If bn is NULL, it only computes the number's length in hexadecimal digits. If the string starts with '-', the number is negative. BN_dec2bn() is the same using the decimal system. BN_print() and BN_print_fp() write the hexadecimal encoding of a, with a leading '-' for negative numbers, to the BIO or FILE fp. BN_bn2mpi() and BN_mpi2bn() convert BIGNUMs from and to a format that consists of the number's length in bytes represented as a 4-byte big- endian number, and the number itself in big-endian format, where the most significant bit signals a negative number (the representation of numbers with the MSB set is prefixed with null byte). BN_bn2mpi() stores the representation of a at to, where to must be large enough to hold the result. The size can be determined by calling BN_bn2mpi(a, NULL). BN_mpi2bn() converts the len bytes long representation at s to a BIGNUM and stores it at ret, or in a newly allocated BIGNUM if ret is NULL. RETURN VALUES
BN_bn2bin() returns the length of the big-endian number placed at to. BN_bin2bn() returns the BIGNUM, NULL on error. BN_bn2hex() and BN_bn2dec() return a null-terminated string, or NULL on error. BN_hex2bn() and BN_dec2bn() return the number's length in hexadecimal or decimal digits, and 0 on error. BN_print_fp() and BN_print() return 1 on success, 0 on write errors. BN_bn2mpi() returns the length of the representation. BN_mpi2bn() returns the BIGNUM, and NULL on error. The error codes can be obtained by ERR_get_error(3). SEE ALSO
bn(3), ERR_get_error(3), BN_zero(3), ASN1_INTEGER_to_BN(3), BN_num_bytes(3) HISTORY
BN_bn2bin(), BN_bin2bn(), BN_print_fp() and BN_print() are available in all versions of SSLeay and OpenSSL. BN_bn2hex(), BN_bn2dec(), BN_hex2bn(), BN_dec2bn(), BN_bn2mpi() and BN_mpi2bn() were added in SSLeay 0.9.0. 0.9.7d 2003-11-20 BN_bn2bin(3)
All times are GMT -4. The time now is 07:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy