A Simple Hex Address Calculator in Python - [Coding]

cristi(70)
Published in
#science
Words
195
Reading
1 min
Listen
Play
8y

Hex Calculator in Python.png


So, I'm currently in the process of teaching myself reverse engineering for the purpose of being able to analyze malware. And I have to be honest, it's a very slow and painful process for me. Assembly code just can't seem to get into my head.

To distract myself a bit from the tedious path, I've quickly coded a hex calculator in Python. When you read and try to understand assembly code, you often have to calculate addresses in memory. And sometimes you need to be able to perform different operations with these addresses. So, this will come very in handy as I advance into the field.

It's only a couple of lines of code and to run it, you only need to do this:

  • python hexcalc.py address1 operation address2

For example, if I want to calculate 0xf + 0xf, the line arguments will be:

  • python hexcalc.py 0xf + 0xf

Simple right? Indeed. So, if this is useful to you, go ahead and grab the code from my github below.

A Simple Hex Address Calculator in Python - [Coding]


To stay in touch with me, follow cristi@cristi


Cristi Vlad Self-Experimenter and Author

A Simple Hex Address Calculator in Python - [Coding] | Ecency