-1

I came across a script that converts font files from one type to another (i.e. WOFF to TTF, etc).

I would like to understand it and incorporate some of the code into a personal project. The script was written in JS and uses Web Assembly and Web Workers. I am not at all familiar with Web Assembly or Web Workers, but I would like to at least understand what the JS is doing.

It was minified and unfortunately obfuscated. I unminified it, but I have no idea how to de-obfuscate it. I have never really reverse engineered something so elaborate like this before.

Are there any tools on the web that will at least try to de-obfuscate (i.e. assign placeholder names to single character variables, arguments, parameters, etc) the code?

Are there any other useful tools or anything else that I should know about?

P.S. I just found this resource.

8
  • 1
    Does this answer your question? Analyzing highly obfuscated JavaScript
    – perror
    Commented Jan 28, 2020 at 9:00
  • @perror im not sure. i think its kind of unrelated based on a glance. ill check it out when i get some more free time
    – oldboy
    Commented Jan 29, 2020 at 3:41
  • Uhm what exactly is obfuscated in the linked script? I am not very familiar with this stuff, but this seems to be TypeScript code (not obfuscated) and the invocation of yarn would cause all of the WASM and minification stuff ... but the code itself is obfuscated where? You are literally linking an open source project here ...
    – 0xC0000022L
    Commented Jan 31, 2020 at 8:31
  • @0xC0000022L i meant 'obfuscated' in its literal sense due the minifying of the code
    – oldboy
    Commented Jan 31, 2020 at 19:21
  • 1
    @oldboy here (part of the project you linked to) is a directory full of TypeScript code. I'd be hard pressed to say I am familiar with any of that either, but I know plain text from obfuscated/garbled and I know TypeScript gets compiled to JavaScript.
    – 0xC0000022L
    Commented Feb 2, 2020 at 12:51

1 Answer 1

1

I know you probably have figured this out... but the JavaScript Beautifier worked perfectly when I used it.

7
  • i havent tried that one yet, but one of them did give me a bit more info i.e. the types of parameters/arguments, altho im not sure how reliable the output is. what exactly does beautifier do? does it rename the minified variables/arguments or?
    – oldboy
    Commented Jan 22, 2020 at 0:50
  • The beautifier will just take the gross one liner and format it in readable JavaScript code. I read your post wrong and I apologize. I don’t know much about de-obsfucating the code. If it’s variable names it is something you will have to do manually. Commented Jan 22, 2020 at 0:54
  • its the variables, but also the parameters, arguments, properties, etc. they make it even more confusing because the letters that represent the variables, parameters, arguments, properties, etc, are reused in different scopes throughout the document
    – oldboy
    Commented Jan 22, 2020 at 2:45
  • From my experience (which is minimal right now). You’ll just have to work through it manually and rename things as you learn what they are for. Obsfucation is meant to make this job difficult and tedious. Commented Jan 22, 2020 at 2:47
  • ya lol im beginning to feel thats the only way :(
    – oldboy
    Commented Jan 22, 2020 at 2:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.