Skip to content

Instantly share code, notes, and snippets.

@pratikone
pratikone / zombiewars.py
Last active September 2, 2021 09:16
This is script to reverse engineer and extract images and sounds assets from Zombie Wars game (also known as Halloween Harry 2)
# Utility to extract image and sound assets from Zombie Wars game (also known as Halloween Harry 2)
# takes some inspiration from Wombat https://www.szevvy.com/
# Pratik Anand 2021 (twitter : @pratikone)
# Blog post : https://pratikone.github.io/gaming/2021/09/02/reverse-engineer-zombiewars.html
# Running :
# Download DEARK from https://entropymine.com/deark/ and keep it somewhere and modify DEARK_PATH_WIN to point to deark.exe
# set GAME_FOLDER_PATH to point to folder containing game assets like GFX.SB0, SFX.SB0
# run the script (install binario using pip). You don't need to provide any args.
# folders will be created for each .SB0 like gfx. If the extracted assets contain RAW files deark convert it to png and store
# it in converted folder within the parent folder like gfx.
@pratikone
pratikone / tweetthreader.py
Created March 17, 2020 02:30
This script fetches and creates threads from twitter statuses of a twitter profile. A thread is a series of tweets created by replying to your own tweet.
import os
import re
import time
from collections import namedtuple
import codecs
import tweepy
import json
from datetime import datetime
from requests.exceptions import Timeout, ConnectionError
from requests.packages.urllib3.exceptions import ReadTimeoutError, ProtocolError
@pratikone
pratikone / sqlsplitter.py
Last active July 9, 2018 05:21
It splits a large SQL dump file into smaller ones. It preservers SQL queries by splitting only after ; It is multi-threaded for I/O write and easy resumable.
###########################################################################################################
# Created by :
# PRATIK ANAND
# github.com/pratikone
# It splits a large SQL dump file into smaller files.
# It preservers queries by only splitting at ;
# It launches a new thread for write I/O operation
# Tested on SQL dump of size 170 GB
# It is resumable by filename as it creates filename with lines
# For example, if a file contains lines from 501 - 2000 , the filename will be 500-2000
@pratikone
pratikone / word_ladder.py
Created September 18, 2017 15:44
Word ladder with both weighted and unweighted edges
import string
import sys
from sets import Set
class Node :
def __init__(self, word) :
self.value = word
self.neighbors = []
self.weight = sys.maxint
@pratikone
pratikone / input
Last active January 3, 2017 05:00
Snake game question :
2 3
4
0 1
0 2
1 2
1 1
8
R
R
D
import time
from subprocess import *
PATH = "/home/pratikone/Documents/git/redis/src/redis-cli"
string = "zadd sortie "
for i in xrange(1,1000001) :
string = string + str(i) + " richa" + str(i) + " "
if (i % 1000) == 0 :
print i
@pratikone
pratikone / global_local_alignment
Last active October 25, 2016 00:35
Global and local alignments
##########################
# Author : Pratik Anand #
##########################
from tabulate import tabulate
import copy
IS_LOCAL_ALIGNMENT = False
USE_BLOSUM = False
match = 1
mismatch = -1
@pratikone
pratikone / global_affinity_alignment.py
Last active October 25, 2016 00:58
Global alignment with affinity
##########################
# Author : Pratik Anand #
##########################
from tabulate import tabulate
import copy
class Obj :
data = 0
x = 0
y = 0
@pratikone
pratikone / blosum.py
Last active October 25, 2016 00:58
Create blosum matrix with 5 alignments
##########################
# Author : Pratik Anand #
##########################
from sets import Set
from math import log
from decimal import *
from tabulate import tabulate
import copy
@pratikone
pratikone / knapsack.c
Last active July 26, 2016 17:07
OpenCL knapsack implementation - host and kernel files
// The code is based on needle.c for Needleman-Wunsch algorithm at
// https://github.com/vtsynergy/OpenDwarfs/blob/master/dynamic-programming/nw/needle.c
#define LIMIT -999
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "needle.h"
#include <sys/time.h>