This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env python3 | |
| # Wordgame rewrite from perl. Coding exercise. | |
| # Wordgame from https://www.facebook.com/paz/photos/a.462264797743.253604.184431752743/10153126259942744/?type=1 | |
| word = "only" | |
| orig_sentence = ["She", "told", "him", "that", "she", "loved", "him"] | |
| sentence_beginning = orig_sentence | |
| sentence_end = [] | |
| for i in range(len(orig_sentence) + 1): | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* | |
| How to compile: | |
| gcc reverse.c -g -D WORLD=\"HelloWorld\" -o hello | |
| gcc reverse.c -g -D WORLD=\"GoodBye\" -o bye | |
| ./bye | |
| cat hello bye > reverse && rm hello bye | |
| chmod +x reverse | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ''' | |
| Example taken from Gray Hat Python (book) | |
| This script present a way to hook a DLL library in Firefox. For this example the script hook nspr4.dll which encrypt datas for SSL connection. | |
| So we will be able to get the text before it is encrypted. Moreover we catch a pattern "password" to get all login/password before they are ciphered. | |
| ''' | |
| from pydbg import * | |
| from pydbg.defines import * | |
| import utils | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <stdio.h> | |
| union s{ | |
| int n; | |
| char b; | |
| }x; | |
| void main(){ | |
| x.n = 0x4142; | |
| if(x.b == 0x42){ | |
| printf("Little Endian\n"); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void binDisplay(int program) { | |
| // A0, A1, A2, A3, A5 | |
| // Turn display off | |
| for (int i = 0; i < chipSet.pinsNumber; i++) { | |
| digitalWrite(chipSet.pinsSerial[i], LOW); | |
| } | |
| int res; | |
| int bitwise = 1; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use POSIX qw/strftime/; | |
| my $to_date = time(); | |
| my $from_date = time() - (60 * 60 * 6); | |
| print "Local:", strftime("%Y-%m-%dT%H:%M:%SZ", localtime($from_date)), "\n"; | |
| print "UTC: ", strftime('%Y-%m-%dT%H:%M:%SZ', gmtime($from_date)), "\n"; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| value=$1 | |
| # Check bit | |
| for check in 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536;do | |
| if [ $(( $value & $check )) -eq $check ];then | |
| echo "$check is set" | |
| else | |
| echo "$check is not set" | |
| fi | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env perl | |
| # Wordgame from https://www.facebook.com/paz/photos/a.462264797743.253604.184431752743/10153126259942744/?type=1 | |
| use strict; | |
| use warnings; | |
| my $word = "only"; | |
| my @orig_sentence = qw(She told him that she loved him.); | |
| my @sentence = @orig_sentence; | |
| my @sentence2; |