hex

Printing out traces to be read by a memory simulation application in Python

Printing out traces to be read by a memory simulation application in Python Question: Trying to print out large traces of memory addresses (32 bits) for 2^32 addresses in the following manner: 0x12345678 W 0x23456789 R . . . . 0xFFFFFFFF W Basically going from one address to the other. So it could be going …

Total answers: 2

Python: How to convert string of an encoded Unicode variable to a binary variable

Python: How to convert string of an encoded Unicode variable to a binary variable Question: I am building an app to transliterate Myanmar (Burmese) text to International Phonetic Alphabet. I have found that it’s easier to manipulate combining Unicode characters in my dictionaries as binary variables like this b’xe1x80xadxe1x80xafxe1x80x84′: ‘áɪŋ̃’, #’ိုင’ because otherwise they glue …

Total answers: 1

"non-hexadecimal number found in fromhex() arg at position 65"

"non-hexadecimal number found in fromhex() arg at position 65" Question: I made a program that makes Bitcoin Address with random private key. Some variables and methods that do not have a separate description are the fixed values of the SECP256K1 elliptic curve. As they are not related to errors, I omitted them. get_private_key method returns …

Total answers: 1

How to get varying shades of red colour based on an input value in python?

How to get varying shades of red colour based on an input value in python? Question: In python, how can I get varying shades of the red/yellow colour based on an input value between -1 and 1? If the value is between -1 and 0, the function should return yellow colour. If the value is …

Total answers: 2

How to convert raw bytes in Hexadecimal from to RGB image

How to convert raw bytes in Hexadecimal from to RGB image Question: I am trying to get my hands dirty by exploring the act of detecting malware using machine learning. So I stumbled across a Microsoft Big 2015 dataset on Kaggle. The dataset contains bytes data in hexadecimal form. i.e 00401000 00 00 80 40 …

Total answers: 1

Hexadecimal to Image Conversion

Hexadecimal to Image Conversion Question: I am converting the hexadecimal files to images. The input files are converted to byte string using binascii library. The problem arises when the byte string is written to form an image. The output of all the hexadecimal files is same. I will be grateful if someone provides me a …

Total answers: 2

TypeError: '<=' not supported between instances of 'str' and 'int'

TypeError: '<=' not supported between instances of 'str' and 'int' Question: Why when put input value such as hexadecimal values like in below if __name__ == ‘__main__’: p = (0x41, 0x31, 0x31, 0x37) it take it as input without error but if I get p from output such as (answer from my previous question) New_MS …

Total answers: 2

How adding 0x to output values to be as hexadecimal input value

How adding 0x to output values to be as hexadecimal input value Question: I have output New_MS= 102311144 I need to make this value as input by read each two number and add 0x to be hexadecimal, if the last number is just one number then should added 0 to end. As like in below …

Total answers: 2

Hex to float and float to hex

Hex to float and float to hex Question: I couldn’t find a working answer for the conversion of an hex to float value. Starting from this answer for converting a float to an hex float to hex, would you know how I can then convert that same hex to the original float back again? Asked …

Total answers: 1