<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Adam Hacks</title><link>https://hackeradam.com/blog/python/</link><description>Recent content in Python on Adam Hacks</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 23 Aug 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://hackeradam.com/blog/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Solving seVeb's Crackme05</title><link>https://hackeradam.com/blog/solving-sevebs-crackme05/</link><pubDate>Sun, 23 Aug 2020 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/solving-sevebs-crackme05/</guid><description>&lt;p&gt;I&amp;rsquo;ve recently found myself wanting to further my reverse engineering skills. One of the ways I’ll be doing this is by working on crackmes. This one in particular is from Crackmes.de user seVeb and is called &lt;strong&gt;&lt;a href="http://crackmes.cf/users/seveb/crackme05/"&gt;crackme05&lt;/a&gt;&lt;/strong&gt;. It’s marked as a C/C++ program compiled for Linux and is rated as being easy. Sounds like a perfect place to start!&lt;/p&gt;</description></item><item><title>Dumping Map Tiles from MBTiles with Python</title><link>https://hackeradam.com/blog/dumping-map-tiles-from-mbtiles-with-python/</link><pubDate>Mon, 12 Feb 2018 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/dumping-map-tiles-from-mbtiles-with-python/</guid><description>&lt;p&gt;MBTiles is a database format, developed by &lt;a href="https://www.mapbox.com/"&gt;Mapbox&lt;/a&gt;, for storing tiled data. It’s a relatively simple database format that allows for a convenient, portable way to store map tile data.&lt;/p&gt;
&lt;p&gt;Here recently, I’ve been developing code that works with tiled map data, including data contained within an MBTiles database. As part of this, I’ve needed an easy way to dump the map tiles from an MBTiles database to my local disk. It turns out that we can do this quite easily with a little bit of Python, so let’s dig in!&lt;/p&gt;</description></item><item><title>Python - How to Capture Video from a Webcam with OpenCV</title><link>https://hackeradam.com/blog/python-how-to-capture-video-from-a-webcam-with-opencv/</link><pubDate>Mon, 07 Aug 2017 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/python-how-to-capture-video-from-a-webcam-with-opencv/</guid><description>&lt;p&gt;Have you ever written code to interface with a webcam? Well, if you have then you know that it can be a royal pain in the ass. And God forbid you want it to be a cross-platform solution! The good news is that there is a ready-made solution that can help us out: OpenCV. Yes, you heard me right. Not only is OpenCV and amazing computer vision library, but it also provides a handy, cross-platform way of interfacing with webcams. Let’s take a look at how simple OpenCV makes this. I’ll be using Python for these examples, but the API is similar in other languages.&lt;/p&gt;</description></item><item><title>Quickly Generating Primes Below n with the Sieve of Eratosthenes</title><link>https://hackeradam.com/blog/quickly-generating-primes-below-n-with-the-sieve-of-eratosthenes/</link><pubDate>Wed, 17 May 2017 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/quickly-generating-primes-below-n-with-the-sieve-of-eratosthenes/</guid><description>&lt;p&gt;The uses for prime numbers in computer science are nearly endless. They are useful for everything from hashing, cryptology, factorization, and all sorts of applications in-between.&lt;/p&gt;
&lt;p&gt;There exists a great number of algorithms that allow us to quickly generate primes, but today we are going to take a look at a popular method known as a &lt;strong&gt;prime sieve&lt;/strong&gt;. There are a number of different implementations of prime sieves, but one of the simplest to implement is known as the &lt;a href="https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes"&gt;Sieve of Eratosthenes&lt;/a&gt;. This algorithm is great for quickly generating smaller prime numbers (but it may not be the best choice for generating very large primes).&lt;/p&gt;</description></item><item><title>How to Route URLLib2 Through TOR (Python)</title><link>https://hackeradam.com/blog/how-to-route-urllib2-through-tor-python/</link><pubDate>Wed, 06 Jan 2016 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/how-to-route-urllib2-through-tor-python/</guid><description>&lt;p&gt;I’ve recently been experimenting on a new project to scrape data from webpages located on the Tor network. For simplicity’s sake, I decided to write this bit of code in Python and use the handy urllib2 library to handle the HTTP requests.&lt;/p&gt;
&lt;p&gt;For those that don’t know, Tor runs a SOCKS5 proxy, which, by default, runs on &lt;strong&gt;127.0.0.1:9050&lt;/strong&gt;. I thought things would be as simple as telling urllib2 to use a proxy located at IP &lt;em&gt;127.0.0.1&lt;/em&gt; and port &lt;em&gt;9050&lt;/em&gt;, but I quickly found that this doesn’t work.&lt;/p&gt;</description></item></channel></rss>