SourceFormatX

CodeMorph

Overview

Features

CodeMorph C++

CodeMorph Delphi

Code Obfuscation

Screenshots

Documentation

FAQs & Tips

Update History

License Policy

CodeToHtml

CodeMorph C/C++ Code Obfuscator


C/C++ Junk Code Generator of CodeMorph randomly generate junk code and insert into your C and C++ source code with predefined customization options.

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  //      Before Junk Code Obfuscating - C/C++ Example Source Code       //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  void read_data(void *data, int bits_of_data, unsigned char *bit_stream,
    unsigned long &bit_offset)
  {
    int i;
    int n;
    while (bits_of_data > 0)
    {
      n = bits_of_data > 8 ? 8 : bits_of_data;
      *(unsigned char*)data = 0;
      for (i = 0; i < n; i++)
      {
        if (read_bit(bit_stream, bit_offset))
        {
          (*(unsigned char*)data) |= (1 << i);
        }
        bit_offset++;
      }
      data = ((unsigned char*)data) + 1;
      bits_of_data -= n;
    }
  }
  

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  //      After Junk Code Obfuscating - C/C++ Example Source Code        //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  void read_data(void *data, int bits_of_data, unsigned char *bit_stream,
    unsigned long &bit_offset)
  {
    // junk instruction begin
    __asm
    {
            jz    _P01
            jnz   _P01
            _emit 0e8h
      _P01:
    }
    // junk instruction end

    int i;
  
    // junk instruction begin
    __asm
    {
            jz    _P01
            jnz   _P01
            _emit 0e9h
      _P01:
    }
    // junk instruction end

    int n;
  
    // junk instruction begin
    __asm
    {
            clc
            jnb   _P01
            _emit 0e8h
            _emit 0e8h
      _P01:
    }
    // junk instruction end

    while (bits_of_data > 0)
    {
      // junk instruction begin
      __asm
      {
              jz    _P01
              jnz   _P01
              _emit 09ah
              _emit 0e8h
        _P01:
      }
      // junk instruction end

      n = bits_of_data > 8 ? 8 : bits_of_data;
  
      // junk instruction begin
      __asm
      {
              clc
              jnb   _P01
              _emit 0e8h
              _emit $e8h
        _P01:
      }
      // junk instruction end

      *(unsigned char*)data = 0;

      // junk instruction begin
      __asm
      {
              jl    _P01
        _P02: jmp	  _P03
              _emit 0e8h
        _P01: jz    _P02
        _P03:
      }
      // junk instruction end

      for (i = 0; i < n; i++)
      {
        if (read_bit(bit_stream, bit_offset))
        {
          (*(unsigned char*)data) |= (1 << i);
        }

        // junk instruction begin
        __asm
        {
                jle   _P01
                jg	  _P01
                _emit 0e8h
          _P01:
        }
        // junk instruction end
  
        bit_offset++;
      }
  
      // junk instruction begin
      __asm
      {
              clc
              jnb   _P01
              _emit 0e8h
              _emit 0e8h
        _P01:
      }
      // junk instruction end

      data = ((unsigned char*)data) + 1;
  
      // junk instruction begin
      __asm
      {
              jc    _P01
              jnc   _P01
              _emit 0e8h
        _P01:
      }
      // junk instruction end
  
      bits_of_data -= n;
  
      // junk instruction begin
      __asm
      {
              jz    _P01
              jnz   _P01
              _emit 0e8h
        _P01:
      }
      // junk instruction end
    }
  }

  Know more about CodeMorph Source Code Obfuscator

  Know more about SourceFormatX C/C++ Code Obfuscator