Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31072

Re: decode hex string

Path csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: decode hex string
Date Fri, 05 Aug 2016 08:06:41 +0200
Organization PointedEars Software (PES)
Lines 32
Message-ID <2022555.8LXgB8ZqXR@PointedEars.de> (permalink)
References <xNidnc-IINPnRj7KnZ2dnUU7-fPNnZ2d@westnet.com.au> <2543619.e9J7NaK4W3@PointedEars.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1470377202 26683 eJwNxckBwDAIA7CVwmXoOMWU/UdI9VEYBExHwGNj54/foCrHJNVZ9XS/dChO41C6dGKPMtr2AhhaEQI= (5 Aug 2016 06:06:42 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Fri, 5 Aug 2016 06:06:42 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwNwoERwEAEBMCWCI4vJ87rv4RkdsOgYDoCHvvjvXLOFKhWGstF0oztfVme0m+cShlTbeYj0tgHZj2cuR9bhxXu
X-NNTP-Posting-Host eJwFwYEBACAEBMCV0vMyTsL+I3RnoPC50qg2NiUiOwSpq4CY04e3PEdu6O5COBcex8/gdn4ORBEI
Xref csiph.com comp.lang.javascript:31072

Show key headers only | View raw


Thomas 'PointedEars' Lahn wrote:

> Andrew Poulos wrote:
>> I have some code I need to edit and the previous programmer has used
>> variable names like _0x29aexe, _0x29aexf, _0x29aex10, _0x29aex11,
>> _0x29aex12, _0x29aex13, _0x29aex14, _0x29aex15...
>> 
>> My guess was that it's hex with a leading underscore but when I convert
>> I get "?)®?" and the like.
>> 
>> Did I convert it wrongly or did the person obfuscate the variable names
>> even further?
> 
> Impossible to say for certain without seeing the source codes (theirs and
> yours).
> 
> However, hexadecimal numbers do not contain the letter “x”, so if you used
> parseInt(…, 16) on anything but the “_”, then you converted it wrongly;
> parseInt(…, 16) would recognize and ignore the “0x” as a hexadecimal
> number
> prefix, but it would stop parsing before the second “x”.  But
> String.fromCharCode(parseInt("0x29aexfoo", 16)) returns "⦮", not "?", so
> you might not have attempted to convert them this way.

You have probably attempted to convert the number as octets: 
String.fromCharCode(0x29, 0xAE) returns ")®".
 
-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

decode hex string Andrew Poulos <ap_prog@hotmail.com> - 2016-08-05 10:19 +1000
  Re: decode hex string $Bill <news@todbe.com> - 2016-08-04 21:28 -0700
  Re: decode hex string Andreas Bergmaier <andber93@web.de> - 2016-08-05 06:44 +0200
  Re: decode hex string Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-05 07:53 +0200
    Re: decode hex string Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-05 08:06 +0200

csiph-web