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
#!/usr/bin/python | |
## Converts hex to decimal | |
# Dictionary for hexadecimal. Covers both lower case and upper case. | |
hexDict = {'a':10, 'b':11, 'c':12, 'd':13, 'e':14, 'f':15, 'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15} | |
result = 0 | |
# Get user input | |
myhex = raw_input('Enter hex: ') | |
# Reverse the input | |
myhex = myhex[::-1] |
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
#!/bin/bash | |
## This script will read the file extension and add proper shenbang to the script | |
# Exit if no args | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 [filename]" | |
exit 1 | |
fi | |
for file in $@ | |
do |
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
#!/usr/bin/python | |
## Escape dots in domain name or IP address | |
## You can put multiple domains/IPs split by space | |
domainIP = raw_input('Enter domain or IP: ') | |
domainIPList = domainIP.split(' ') | |
for i in domainIPList: | |
i = i[::-1].replace('.', '].[', 1) | |
print(i[::-1]) |
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
#!/usr/bin/python | |
## Simple xor encoder | |
def simpleXOR(): | |
result = '' | |
data = raw_input('Enter data: ') | |
key = raw_input('Enter key: ') | |
for i in data: | |
result += chr(ord(i) ^ int(key)) |
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
Hex Decimal Type | |
------------------------------- | |
0x14 20 ChangeCiperSpec | |
0x15 21 Alert | |
0x16 22 Handshake | |
0x17 23 Application Data |
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
Reference | |
http://blog.asial.co.jp/iphone/820 | |
http://www.w3.org/Graphics/GIF/spec-gif89a.txt | |
0000000: 4749 4638 3961 3303 cc01 f700 00ff ffff GIF89a3......... | |
0000010: ffff ffff ffff ffff ffff ffff ffff ffff ................ | |
0000020: ffff ffff ffff ffff ffff ffff ffff ffff ................ | |
0000030: ffff ffff ffff ffff ffff ffff ffff ffff ................ | |
0000040: ffff ffff ffff ffff ffff ffff ffff ffff ................ | |
0000050: ffff ffff ffff ffff ffff ffff ffff ffff ................ |
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
#!/bin/bash | |
## Convert hex to decimal | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 [hex data]" | |
exit 1 | |
fi | |
head=0x |
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
#!/bin/bash | |
## Convert filesize and deletion date from recycle bin hex data | |
f_flag=0 | |
d_flag=0 | |
usage() { | |
echo "Usage: $0 [-f filesize in hex] [-d deletion date in hex]" | |
exit 1 |
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
## Starting with the .NET Framework 4.5, the DeflateStream class uses the zlib library. | |
https://msdn.microsoft.com/en-us/library/system.io.compression.deflatestream(v=vs.110).aspx | |
78 01 | |
78 5e | |
78 9c | |
78 da | |
Above is the typical header for zilb compressed data but does not mean it always start with 78. | |
Could be start from these numbers as well. |
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
ファイルのタイムスタンプには4種類ある。 | |
Create - the time when the file was created (ファイルの作成日時) | |
Access - the last time the file was read (ファイルが最後に読まれた日時) | |
Modify - the last time the file was modified (content has been modified) (ファイルの中身が最後に更新された日時) | |
Change - the last time meta data of the file was changed (e.g. permissions) (ファイルの属性(読み書きの権限など)が最後に更新された日時) | |
またファイルにはStandard Information Attribute と FileName Attributeの2種類の属性がある。 | |
Standard Information Attributeは簡単に編集することが可能。 |
OlderNewer