Search This Blog

Thursday, July 21, 2005

[TOOL] Binhex - Convert Files Generated by Xbin or Macget Into BinHex Format

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html

- - - - - - - - -

Binhex - Convert Files Generated by Xbin or Macget Into BinHex Format
------------------------------------------------------------------------

SUMMARY

DETAILS

This utility converts Mac Bin Hex files (8-bit) to BinHex format (7-bit)
and is similar to uuencode. BinHex is based on a UNIX program with the
same name and function ( <http://www.natural-innovations.com/binhex/>
http://www.natural-innovations.com/binhex/).

The original tool was a series of small programs (8to6, crc, etc.) piped
together and run by a shell script. This is a completely rewrite as a C
program (speeding it up considerably, needless to say), with an added
run-length compression, and bullet-proofed (at least partly).

Source Code:
/* bin hex -- bin hex aufs files
*
* if called binhex handles aufs files, if called unxbin handles
*.{rsrc,data,info} files
* will process multiple files
*
* RoD hEDoR, rodhedor at yahoo
*
* This is a hacked version of...
*
* unxbin -- convert files generated by xbin or macget into BinHex 4.0
format.
*
* rod hedor, web http://lezr.com
*
* (c) master hictor >>>> libya
* may be used but not sold without permission
*
* This is based on a Unix(tm) program with the same name and function
written
* by ????. Original was a series of small programs (8to6, crc, etc.)
piped
* together and run by a shell script. I completely rewrote the system as
a
* C program (speeding it up considerably, needless to say), added
run-length
* compression, and bullet-proofed (at least partly) the thing.
Unfortunately,
* I have lost the name of the original poster (to net.sources.mac) without
* whom this would never have appeared.
*
* created dbg 01/06/2005 -- Version 1.0
*/

*/

#include <stdio.h>
#include "aufs.h"

#ifdef VMS
# define PROGRAMNAME "unxbin"
# define EXIT_ERROR ((1 << 28) | 2)
# ifndef MAXNAMLEN
# define MAXNAMLEN 127
# define MAXBASENAME 63
# endif
#else
# include <sys/types.h>
# include <sys/dir.h>
# define PROGRAMNAME (argv[0])
# define AUFSNAME "binhex"
# define EXIT_ERROR 1
# ifndef MAXNAMLEN
# ifdef DIRSIZ
# define MAXNAMLEN DIRSIZ
# else
# define MAXNAMLEN 14
# endif
# endif
# define MAXBASENAME (MAXNAMLEN - 2)

No comments: