0

I have a javascript program that loops through a encoded hex file and converts it into readable hex and it shows the values that I need it to so they can be changed. The problem I'm having is converting it back to the encoded hex file perfectly in the exact same size and compression as before. I'm relatively new with this stuff so forgive me if I didn't explain it well enough, but it would help so much if I could solve this problem. It's the last thing to make my program run properly. How would I take my hex code and re compress it back to its original form but with the edited values? I have tried simply converting the hex characters. My current end result is a big file with nothing but hex, but I need to make something like this

0220022008F60000024002400252024002640240024002400240024002400240024002760288029A02AC02BE02D002E2024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240039603A403B6024003EA040E04320456047A049E04C204E6050A052E05520576059A05BE05E2060203D80240024002400240024002400240024002400240024002400240024002400922094209620982024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240062E0654068406B006D006F00710073007500770079007B007D007F00810083008500870089008B808E209020240024002400240024002400240024002F403840240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240024002400240

convert to look like this:

  ö @@R@d@@@@@@@@vˆš¬¾Ðâ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@–¤¶@ê2VzžÂæ

I know it has something to do with encoding.

  • Stack Overflow is not a free code writing service. You are expected to try to write the code yourself. After doing [more research](http://meta.stackoverflow.com/questions/261592) if you have a problem you can post what you've tried with a clear explanation of what isn't working and providing a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). I suggest reading [How to Ask a good question](https://stackoverflow.com/questions/how-to-ask). Also, be sure to [take the tour](https://stackoverflow.com/tour). – bfris Sep 15 '19 at 16:38
  • Possible duplicate of [How to program hex2bin in Javascript?](https://stackoverflow.com/questions/7695450/how-to-program-hex2bin-in-javascript) – Ross Jacobs Sep 19 '19 at 20:25

0 Answers0