Hacking [Question] Converting Payload Bin into .js

MostlyUnharmful

Well-Known Member
Member
Joined
Feb 8, 2018
Messages
410
Trophies
0
Age
42
XP
1,446
Country
Italy
Sure, with a few lines of Python (excuse the crude example):

Code:
#!/usr/bin/python3

import sys
import binascii

filename = sys.argv[1]

print("var payload = [", end='')

with open(filename, 'rb') as input_file:
    word = input_file.read(4)
    while word:
        output = binascii.hexlify(word)
        print("0X%s, " % output.decode('utf-8'), end='')
        word = input_file.read(4)

print("]")
 
  • Like
Reactions: cearp and Ronhero
D

Deleted User

Guest
Sure, with a few lines of Python (excuse the crude example):

Code:
#!/usr/bin/python3

import sys
import binascii

filename = sys.argv[1]

print("var payload = [", end='')

with open(filename, 'rb') as input_file:
    word = input_file.read(4)
    while word:
        output = binascii.hexlify(word)
        print("0X%s, " % output.decode('utf-8'), end='')
        word = input_file.read(4)

print("]")

dang who the heck is this guy. A new strange pokemon has appeared. Howdy stranger.
 
  • Like
Reactions: Ronhero

Ronhero

Too Weird to Live, Too Rare to Die
OP
Member
Joined
Jun 28, 2014
Messages
3,470
Trophies
1
Location
Arizona Bay
Website
127.0.0.1
XP
2,062
Country
United States
Sure, with a few lines of Python (excuse the crude example):

Code:
#!/usr/bin/python3

import sys
import binascii

filename = sys.argv[1]

print("var payload = [", end='')

with open(filename, 'rb') as input_file:
    word = input_file.read(4)
    while word:
        output = binascii.hexlify(word)
        print("0X%s, " % output.decode('utf-8'), end='')
        word = input_file.read(4)

print("]")

Wow thanks i didn't expect to see an answer to this question
 
  • Like
Reactions: cearp

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=BjK2lPBzGzo