Skip to content

Commit

Permalink
Bug Fix in Format 3
Browse files Browse the repository at this point in the history
Changed 'payload = [' to 'var payload = ['.
Credits @Leeful
  • Loading branch information
cfwprpht committed Feb 28, 2019
1 parent d30603c commit 79e7723
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Binary file modified .vs/bin2js/v14/.suo
Binary file not shown.
4 changes: 3 additions & 1 deletion ReadMe.md
Expand Up @@ -2,6 +2,8 @@
Binary 2 JavaScript
==============================

* Fixed Bug in Format 3 output. Should be 'var payload = ['. Credits @Leeful

* Fixed EndianSwap for option -4. Credits to Z80 0x90h.

* Fixed a bug on the bin convertion routine.
Expand All @@ -17,5 +19,5 @@ Added back convertion supportfor all 3 formats.
Flags:
-1 = Foramt1 u32[]
-2 = Format2 p.write4addr.add(...
-3 = Format3 payload = [....
-3 = Format3 var payload = [....
-4 = js2bin
4 changes: 2 additions & 2 deletions bin2js/Program.cs
Expand Up @@ -276,7 +276,7 @@ class Program {
/// </summary>
/// <param name="args">The arguments.</param>
static void Main(string[] args) {
Console.WriteLine(" bin2js (c) by cfwprpht 2017\n");
Console.WriteLine(" bin2js (c) by cfwprpht 2017\n v1.6\n");
CheckArgs(args);

FileInfo fi = new FileInfo(args[0]); // Get file informations.
Expand Down Expand Up @@ -321,7 +321,7 @@ class Program {
newFile.WriteLine("// https:" + "//github.com/cfwprpht/bin2js\n"); // Write some repo info into the file.
byte[] trick = encode.GetBytes("function write" + newFile.GetName().Replace(".js", "") + "(write) {\n setBase(write);\n"); // Encode the function string to bytes.
byte[] trick2 = encode.GetBytes("function payload(p, addr) {\n"); // Encode the function string to bytes.
byte[] trick3 = encode.GetBytes("payload = [");
byte[] trick3 = encode.GetBytes("var payload = [");
if (args[1] == "-2") trick2.Write(newFile); // Write the Function and name it like the input bin.
else if (args[1] == "-3") trick3.Write(newFile);
else if (args[1] == "-1") trick.Write(newFile);
Expand Down

0 comments on commit 79e7723

Please sign in to comment.