-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.

oldboy
  • 99
  • 3
  • 1
  • @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 Jan 29 '20 at 03: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 Jan 31 '20 at 08:31
  • @0xC0000022L i meant 'obfuscated' in its literal sense due the minifying of the code – oldboy Jan 31 '20 at 19:21
  • @oldboy I think that wasn't the main point of my comment. It was more that what you are trying is the equivalent of trying to make sense of objuscated C (JS) code generated by a transpiler and Assembly (WASM) from C++ (Typescript) ... what's the point? Why not read the Typescript code? Also you still didn't answer what particular script is supposedly obfuscated. Following your link I didn't find one. I mean sure, if the point is to learn how to deobfuscate stuff, fair enough. But your question doesn't state that. – 0xC0000022L Feb 01 '20 at 09:29
  • @0xC0000022L obvs i didnt even know that typescript was being used. im not familiar with typescript whatsoever. can you link me to the typescript code itself that is not obfuscated aka minified? im sorry but i dont really understand what youre asking – oldboy Feb 01 '20 at 21:45
  • 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 Feb 02 '20 at 12:51
  • @0xC0000022L youre right, its no longer obfuscated. i was looking at an app.ts file that was in fact previously obfuscated. thanks for pointing that out!! – oldboy Feb 03 '20 at 20:29

1 Answers1

1

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

Chase Opsahl
  • 105
  • 8
  • 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 Jan 22 '20 at 00: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. – Chase Opsahl Jan 22 '20 at 00: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 Jan 22 '20 at 02: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. – Chase Opsahl Jan 22 '20 at 02:47
  • ya lol im beginning to feel thats the only way :( – oldboy Jan 22 '20 at 02:47
  • It will be annoying, but it’ll be good experience! Good luck, brother! – Chase Opsahl Jan 22 '20 at 02:49
  • ty sir (too few chars) – oldboy Jan 22 '20 at 02:54