Skip to content

Instantly share code, notes, and snippets.

View hash3liZer's full-sized avatar
💛
Breaking & Building Stuff

Shameer Kashif (Shiri) hash3liZer

💛
Breaking & Building Stuff
View GitHub Profile
@hash3liZer
hash3liZer / base64_encode_decode.cpp
Created June 3, 2020 15:45 — forked from williamdes/base64_encode_decode.cpp
c++ 11 encoding and decoding base64
//FROM
//https://stackoverflow.com/a/34571089/5155484
typedef unsigned char uchar;
static const std::string b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";//=
static std::string base64_encode(const std::string &in) {
std::string out;
int val=0, valb=-6;
for (uchar c : in) {
@hash3liZer
hash3liZer / remMediaDrives.cpp
Created January 31, 2020 12:20
Printing Connected Removable Media Drives on the Computer in C++
#include <iostream>
#include <string>
#include <Windows.h>
void remMediaDrives(){
string value = "";
for(char i=65; i<=90; i++){
value = i;
value += ':';
@hash3liZer
hash3liZer / macaddress.cpp
Created January 31, 2020 10:23
Getting MAC address of Ethernet Interface of a PC in C++
#include <stdio.h>
#include <Windows.h>
#include <Iphlpapi.h>
#include <Assert.h>
#include <string>
#pragma comment(lib, "iphlpapi.lib")
char* getMAC();
@hash3liZer
hash3liZer / md5sum.cpp
Created January 31, 2020 09:36
Implementation of MD5 Hash Function in C++
#include <Windows.h>
#include <Wincrypt.h>
#include <stdio.h>
using namespace std;
char* HashMD5(char* data, DWORD *result)
{
DWORD dwStatus = 0;
DWORD cbHash = 16;
@hash3liZer
hash3liZer / hexdump.py
Created July 29, 2018 06:40 — forked from JonathonReinhart/hexdump.py
hexdump implementation in Python
import string
def hexdump(src, length=16, sep='.'):
DISPLAY = string.digits + string.letters + string.punctuation
FILTER = ''.join(((x if x in DISPLAY else '.') for x in map(chr, range(256))))
lines = []
for c in xrange(0, len(src), length):
chars = src[c:c+length]
hex = ' '.join(["%02x" % ord(x) for x in chars])
if len(hex) > 24: