Skip to content

Instantly share code, notes, and snippets.

View shahril96's full-sized avatar
🐢

Mohd Shahril shahril96

🐢
View GitHub Profile
@shahril96
shahril96 / reverseme_4_solution.c
Last active August 29, 2015 14:13
[TBD] Reverseme #4 decoder
/*
here is solution for reverseme #4 php challenge
written using C, cuz wut? cuz im boringgg at dat time
here is the link for mentioned challenge : http://w3.tbd.my/thread-15160-post-175788.html#pid175788
byehhh...
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@shahril96
shahril96 / bitwise_hack_functions.c
Created February 3, 2015 17:22
Set of useful functions for manipulation integer in low level binary
// set of useful functions for manipulation integer in low level binary
// this was written when i'm started to learn C
// code look suck, well, this shit is from 2 years ago :) (ahh unforgotten memories)
// hope you can learn somethings from this code
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
// this shit is written as part of my project with my friends, but that idea was demolished
// this actually will try to find .mp3 direct link file from 4shared audio download link
// im surprised that this still working after 2 years i wrote this script
// btw, here you are, enjoy :) (warning: code looks suck!)
<?php
$shared = new four_shared;
//echo $shared->search('linkin park');
print_r($shared->take_link('https://www.4shared.com/mp3/1ZCsTQJY/fadirul_-_suasana_hari_raya_co.html'));
@shahril96
shahril96 / configuration.js
Created April 26, 2015 05:21
My Aria2 WebUI Config
angular
.module('webui.services.configuration', [])
.constant('$name', 'Aria2 WebUI') // name used across the entire UI
.constant('$titlePattern', 'active: {active} - waiting: {waiting} - stopped: {stopped} — {name}')
.constant('$pageSize', 11) // number of downloads shown before pagination kicks in
.constant('$authconf', { // default authentication configuration, never fill it in case the webui is hosted in public IP as it can be compromised
host: 'localhost',
port: 6800,
encrypt: false,
auth: { // either add the token field or the user and pass field, not both.
#include <iostream>
#include <cmath>
#define MAXF 999999.0
#define EPSILON 0.0000000001
using namespace std;
int main()
{
#include <iostream>
#include <cctype>
using namespace std;
int validate_input(char input[])
{
char bool_zul[30] = {0}, *ptr = input;
while(*ptr)
@shahril96
shahril96 / strlen.asm
Created May 27, 2015 15:37
Assembly - Example of strlen using fully assembly, utilized scan string operation with repetition
; cara nk guna :
; first convert jadi obj file guna nasm -> nasm -f elf32 test.asm -F dwarf -g
; then kena guna linker, guna gcc mudah -> gcc test.o -o test -m32 -ggdb
; kemudian run ./test
section .text
global main ; must be declared for linker (ld)
section .data
msg db 'Hello, world!', 0xa, 0x0 ; our dear string
@shahril96
shahril96 / lcs.c
Created June 11, 2015 04:17
POC of Longest Common Sub-Sequence problem with complexity O(nm)
/* References :
http://www.geeksforgeeks.org/dynamic-programming-set-4-longest-common-subsequence/
https://www.ics.uci.edu/~eppstein/161/960229.html */
#include <stdio.h>
#include <string.h>
#define MAX(X,Y) ((X) > (Y)) ? (X) : (Y)
char str[100];
@shahril96
shahril96 / lis.cpp
Created June 11, 2015 04:20
POC of Longest Increasing Sub-Sequence with complexity O(mn)
/* References :
http://www.geeksforgeeks.org/dynamic-programming-set-3-longest-increasing-subsequence/
https://www.youtube.com/watch?v=4fQJGoeW5VE */
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
@shahril96
shahril96 / print_subsequences.c
Last active August 29, 2015 14:23
Print all string sub-sequences (or power-set in set theory) using binary mapping technique
/* example input-output
input :
abc
expected output :
1 =>
2 => a
3 => b
4 => ab