Join Us and become a Member for a Verified Badge on Discord to access private areas with the latest PS4 FPKGs.
Category PS4 Guides and Tutorials       Thread starter PSXHAX       Start date Mar 12, 2018 at 3:28 AM       17,296       36            
Recently mtnjustme let us know about a utility called BIN2JS (Binary 2 JavaScript) to convert PlayStation 4 v4.05 / v4.55 payload.bin files into payload.js files used when creating Web / USB wifi versions.

Below is a BIN2JS Github repository by @cfwprophet alongside a compiled version from RetroGamer_74 with a roughly translated guide by @fabrebatalla18 for those interested. :geek:

Download: WEB Base 4.05.zip / WEB Base 4.55.zip (Confirmed working) /
bin2js.py (Bin2js 6.72 Al Azif script via Red-J)

Spoiler: Depreciated

Previously we've seen both a Setting Up & Building Payload.bin and a Building PlayStation 4 Payloads tutorial for those who missed them.

From the ReadMe.md: Binary 2 JavaScript

A simple tool to convert a binary file which will be mostly a payload, to a unsigned integer 32 Array, embeded into a JavaScript function call. The application is ready to use for the PS4 OpenSource Hacking Community.
  • Fixed a bug on the bin conversion routine.
  • Added a second format for the .js to write. Simple use any flag to trigger it. Added Vortex Payload Format.
  • Added back conversion support for all 3 formats.
Code:
Flags: -1 = Foramt1 u32[] -2 = Format2 p.write4addr.add(... -3 = Format3 payload = [.... -4 = js2bin
And here's the tutorial from fabrebatalla18 on ElOtroLado, roughly translated: Convert Payload.bin to Payload.js to Create Web / USB Wifi Version Tutorial

Introduction


This tutorial serves both for 4.05 and 4.55 or any other future version by applying small changes that I will describe at any time. Thanks to RetroGamer_74 for compiling the .exe from the source code.

Requirements
  • Windows operating system (tested on Windows 10 Pro 64-bit).
  • Required files: bin2js.zip
Steps to follow
  • Download the necessary files: bin2js.zip and WEB Base that matches the version of the payload.bin that we want to convert.
  • Unzip bin2js.zip and we will see three files: bin2js.exe, cygwin1.dll and bin2js.bat.
  • Finally we drag the .bin file that we want to transform to bin2js.bat , in doing so we will generate a file called payload.js.
  • If everything went well when opening the payload.js with some text editor we would have to see something like this:
    BIN2JS Guide to Convert PS4 Payload.bin to Payload.js Files.png
  • Finally, we unzipped the WEB Base and copied and overwritten the new payload.js for the one that originally had the downloaded Base WEB.
NOTE:
You can create a shortcut of the bin2js.bat in any folder and the function of dragging the .bin to the .bat will continue so that it can do the transformation.
BIN2JS Guide to Convert PS4 Payload.bin to Payload.js Files.jpg
 

Comments

raknam

Member
Contributor
Hello everyone,

I created an html version of the bin2js converter who get a payload as .bin and allow you to download a js payload to be used with templates.

I dev it on Chrome 65.
Code:
<!DOCTYPE html>
<html>
   <head>
       <meta charset="utf-8">
       <title>payload.bin 2 payload.js</title>
   </head>
   <body>
   <input type="file" id="input" onchange="handleFiles(this.files)" accept=".bin">
   <script>
     var reader = new FileReader();
     reader.onload = function(event) {
       if (reader.readyState == FileReader.DONE) {
         var buffer = reader.result;
         console.log("Read " + buffer.byteLength + " bytes");
         var bufView = new Uint32Array(buffer);
         var data = "var payload = [";
         for (i = 0; i < bufView.length; i++) {
           data += "0x" + bufView[i].toString(16) + ",";
         }
         data += "0];";
         var a = document.createElement("a");
         document.body.appendChild(a);
         a.style = "display: none";
         var blob = new Blob([data], {type: "octet/stream"}),
           url = window.URL.createObjectURL(blob);
         a.href = url;
         a.download = "payload.js";
         a.click();
         window.URL.revokeObjectURL(url);
       }
     };

     function handleFiles(files) {
       var file = files[0];
       console.log("File chosen: " + file.name);
       reader.readAsArrayBuffer(file);
     }
   </script>
  </body>
</html>
Hope it will help :)
 

BigWadger

Senior Member
Contributor
Verified
@raknam thanks for sharing this, It works great on all the bins ive tested so far and has saved me a lot of time cos this runs on any os with a web server, Cheers :)
 

muxi

Developer
Senior Member
Contributor
Verified
@mschumacher69 OK, thanks I just thought that because no WEB Base for 6.72 is available in the download folder, converting for 6.72 payloads would not be possible. Obviously it doesn't seem to work with every payload, because when I converted a dumper payload from bin to js, it wasn't executable.
 
Recent Articles
PlayStation 5 Model CFI-1018A Console Images with PS5 Accessories via FCC
Thus far we've seen the official DualSense Wireless Controller Images, official PlayStation 5 Images, some Prototype Images and with the PS5 Price and Release Date known this weekend geronimo_73...
Sony CEO Confirms PS5 Won't Natively Support PS1, PS2 nor PS3 Games
In contrast to Microsoft's upcoming Xbox Series X console that will also play original Xbox, Xbox 360 and Xbox One games at launch, Sony CEO Jim Ryan confirmed in a Famitsu Interview following the...
Call of Duty: Black Ops Cold War PS4 Alpha Live September 18-20th
Proceeding the Call of Duty: Black Ops Cold War PS4 and Call of Duty: Black Ops Cold War PS4 Multiplayer trailers, starting today Activision announced that the Call of Duty: Black Ops Cold War PS4...
Demon's Souls PS5 Gameplay Trailer and More PlayStation 5 Videos!
As a massive fan of the original King's Field series on PSX and PS2 from the Japanese video game company From Software, this is one franchise I don't mind seeing milked unlike so many other...
Top