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

Command-line interface for program operation. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "const_code.h"
#include "utils.h"
#include "code.h"
#include "keygen.h"
#include "attack.h"
#include "matrices_generation.h"
#include "keysetup_reverse.h"

Defines

#define _UNIQUE_OPERATION_TEST(opcode)
#define _LOAD_SOURCE
#define _LOAD_DEST

Enumerations

enum  OperationParam {
  OP_NONE, OP_ENCODE, OP_DECODE, OP_ENCRYPT,
  OP_ATTACK, OP_PRECOMPUTE, OP_AUTOTEST
}
 CLI Operation. More...

Functions

void displayHelp ()
 Displays the program banner and help about possible CLI commands.
int main (int argc, char *argv[])
 Program entry point.

Detailed Description

Command-line interface for program operation.

Author:
Nicolas Paglieri & Olivier Benjamin
Version:
File Revision #21
Date:
01/12/2011

Define Documentation

#define _LOAD_DEST
Value:
destfile = fopen(param_destfile, "wb");                                                        \
        if (!destfile) {                                                                               \
            printf("Unable to open file [wb] '%s'\n", param_destfile);                                 \
            return 1;                                                                                  \
        }
#define _LOAD_SOURCE
Value:
sourcefile = fopen(param_sourcefile, "rb");                                                    \
        if (!sourcefile) {                                                                             \
            printf("Unable to open file [rb] '%s'\n", param_sourcefile);                               \
            return 1;                                                                                  \
        }                                                                                              \
        fseek(sourcefile, 0, SEEK_END); filesize = ftell(sourcefile); fseek(sourcefile, 0, SEEK_SET);
#define _UNIQUE_OPERATION_TEST (   opcode)
Value:
if (param_operation != OP_NONE) {                                                          \
            printf("Error: operation field must be unique\n"); return 1;                           \
        }                                                                                          \
        param_operation = (opcode)

Enumeration Type Documentation

CLI Operation.

Gathers all possible CLI operation parameters.

Enumerator:
OP_NONE 

No Operation.

OP_ENCODE 

Perform Encoding.

OP_DECODE 

Perform Decoding.

OP_ENCRYPT 

Perform Encryption.

OP_ATTACK 

Perform Attack.

OP_PRECOMPUTE 

Generate Resolution Matrices.

OP_AUTOTEST 

Launch Autotest.


Function Documentation

int main ( int  argc,
char *  argv[] 
)