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
  • K3Nv2 @ K3Nv2:
    10 tabs open on chrome and no slow downs suck it low ram plebs lol
  • Veho @ Veho:
    Firefox users be like "look at what they have to do to mimic a fraction of our power."
  • K3Nv2 @ K3Nv2:
    they be like which lite firefox exe pls
  • Veho @ Veho:
    Wut.
  • Maximumbeans @ Maximumbeans:
    GM all
  • K3Nv2 @ K3Nv2:
    butt
  • SylverReZ @ SylverReZ:
    douche
  • Veho @ Veho:
    Touché.
  • SylverReZ @ SylverReZ:
    Push it :creep:
  • Veho @ Veho:
    Talk about propaganda.
  • Veho @ Veho:
    Illinois is working to ban toxic food additives that have been banned for decades in other countries; additives that can be replaced and all those countries still have Skittles and Mountain Dew. Title of the piece: GUBMINT WANTS TO TAKE AWAY YOUR CANDY
  • Veho @ Veho:
    Gee, I wonder if the author is biased?
  • SylverReZ @ SylverReZ:
    @Veho, Sounds and smells like bullshit. They don't give you cancer, and California should know that. I don't get why they stick labels that say "may or may not cause reproductive harm or cancer".
  • Veho @ Veho:
    Arsenic doesn't give you cancer either.
    +1
  • Veho @ Veho:
    California has already banned those additives BTW.
    +1
  • Veho @ Veho:
    Psi has been banned in the state of California.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I am the cancer!!! lol
  • Psionic Roshambo @ Psionic Roshambo:
    Yayyy got arcade games on the Pi working lol
  • Veho @ Veho:
    Cool.
  • Psionic Roshambo @ Psionic Roshambo:
    Now to spend 6 months deleting all the garbage lol
  • Psionic Roshambo @ Psionic Roshambo:
    Mame should be two sets one for preservation of everything and one set for people who just want to play and enjoy the old old ganes
    Psionic Roshambo @ Psionic Roshambo: Mame should be two sets one for preservation of everything and one set for people who just want...