Converting hex or dec to ascii ?

M

mrpink

Hi,
I have a variable like:

test = 0x65 0x78

and I wanna have this converted or outputet to-----> ex

which is the ascii code of 0x65 (=e) and 0x78 (=x) . But how can I do
this ?

test = 0x65 doesn't, test = "0x65" doesn't test = String(0x65) also
doesn't...

can someone please help me with this?

greets
 
A

Abhijit Gadgil

T24gNC8xMy8wNywgbXJwaW5rIDxhZG5hcmltQG1haWwucnU+IHdyb3RlOgo+IEhpLAo+IEkgaGF2
ZSBhIHZhcmlhYmxlIGxpa2U6Cj4KPiB0ZXN0ID0gMHg2NSAweDc4Cj4KPiBhbmQgSSB3YW5uYSBo
YXZlIHRoaXMgY29udmVydGVkIG9yIG91dHB1dGV0IHRvLS0tLS0+IGV4Cj4KPiB3aGljaCBpcyB0
aGUgYXNjaWkgY29kZSBvZiAweDY1ICg9ZSkgYW5kIDB4NzggKD14KSAuIEJ1dCBob3cgY2FuIEkg
ZG8KPiB0aGlzID8KPgo+IHRlc3QgPSAweDY1IGRvZXNuJ3QsIHRlc3QgPSAiMHg2NSIgZG9lc24n
dCB0ZXN0ID0gU3RyaW5nKDB4NjUpIGFsc28KPiBkb2Vzbid0Li4uCgpJZiB5b3UgaGF2ZSB0aGlz
IGluIGFuIGFycmF5LCB5b3UgY2FuIHVzZSBBcnJheSNwYWNrCgplZy4KCmEgPSAgWzB4NjUsIDB4
NzhdLgphLnBhY2soIlUqIikKClRoaXMgd2lsbCB3b3JrIGZvciBtdWx0aWJ5dGUgdW5pY29kZSBz
dHJpbmdzIGFzIHdlbGwuCgpIdGguCgotLSAKCuCkheCkreCkv+CknOClgOCkpAoKW3dyaXR0ZW4g
aW4gaHR0cDovL3d3dy5wYWFoaWplbi5jb20vc2NyYXRjaHBhZF0KCltodHRwOi8vd3d3LnBhYWhp
amVuLmNvbV0K
 
R

Robert Klemme

Hi,
I have a variable like:

test = 0x65 0x78

What exactly is this supposed to mean? This is not valid Ruby:

$ ruby -ce 'test = 0x65 0x78'
-e:1: parse error, unexpected tINTEGER, expecting $
and I wanna have this converted or outputet to-----> ex

which is the ascii code of 0x65 (=e) and 0x78 (=x) . But how can I do
this ?

test = 0x65 doesn't, test = "0x65" doesn't test = String(0x65) also
doesn't...

can someone please help me with this?

Very likely, if we know what your input is.

robert
 
M

mrpink

yeah this was wrong varibale too... but I got it out:


shellcode = "\x65\x61"

puts(shellcode)


does what I needed :D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top