-2

I have found this in a JavaScript source code file:

function getElementsByClass(_0x62cbx2, _0x62cbx3, _0x62cbx4) {...

How can I translate _0x62cbx2, _0x62cbx3, _0x62cbx4 in the correct variable names?

pimvdb
  • 151,816
  • 78
  • 307
  • 352
xRobot
  • 25,579
  • 69
  • 184
  • 304
  • 12
    Define "correct" variable name. Those character sequences form valid identifiers and if everything work's, there's nothing wrong with them... technically. Of course, it may be the product of some obfuscation, but in that case you'd need the original source code (or knowledge of how the obfuscator arrived at those names). –  Sep 18 '11 at 10:01
  • +1 for possible obfuscation. There's no way to get back the original names without the original, unobfuscated source code. – Alex Sep 18 '11 at 10:04
  • 1
    First, those are arguments, not really variables. Next, `_0x62cbx2` is perfectly valid - not less proper than `className`, `arg1` or `confusingName`. Not the best name for a child, given, but works for generated code. – Kobi Sep 18 '11 at 10:05
  • I don't have the original source code :( . So it's impossible ? but what is 0x62cbx2 ? hexdecimal ? – xRobot Sep 18 '11 at 10:08
  • `0x` does look like hex, but the `x` near the end doesn't fit. You can still try to search Google for the function - maybe it is similar to this one?: http://www.anyexample.com/webdev/javascript/javascript_getelementsbyclass_function.xml – Kobi Sep 18 '11 at 10:09
  • 4
    `_0x62cbx2` is just a sequence of characters which form a valid identifier in JS. There is nothing special about it. – Felix Kling Sep 18 '11 at 10:18

1 Answers1

6

You cannot restore original variable names after code was obfuscated. But you can reverse engineer their meaning, if you have time and desire to do so.

c69
  • 19,951
  • 7
  • 52
  • 82