A52HackTool 1.3.0
Turnkey & easy to use tool for cracking the GSM A5/2 cipher
Functions
utils.c File Reference

Utilitary tools. More...

#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include "utils.h"

Functions

int stringToByteArray (char *s, byte a[], unsigned int len)
 Translates a string composed of "0"s or "1"s into a byte array.
int fileExists (const char *filename)
 Checks the accessibility of a file for reading.
long long timeval_diff (struct timeval *difference, struct timeval *end_time, struct timeval *start_time)
 Computes the difference between two time values.

Detailed Description

Utilitary tools.

Author:
Nicolas Paglieri & Olivier Benjamin
Version:
File Revision #6
Date:
24/06/2011

Function Documentation

int fileExists ( const char *  filename)

Checks the accessibility of a file for reading.

Parameters:
[in]filenamePath of the file to test
Returns:
non-zero if the file is accessible, 0 otherwise

Referenced by main().

int stringToByteArray ( char *  s,
byte  a[],
unsigned int  len 
)

Translates a string composed of "0"s or "1"s into a byte array.

Parameters:
[in]sInput string
[out]aArray to construct
[in]lenLength of the string
Returns:
0 if the translation has been successful, non-zero otherwise

Referenced by main().

long long timeval_diff ( struct timeval *  difference,
struct timeval *  end_time,
struct timeval *  start_time 
)

Computes the difference between two time values.

Parameters:
[out]differenceProcessed difference
[in]end_timeEnd time
[in]start_timeStart time
Returns:
time difference in microseconds