flat assembler
Message board for the users of flat assembler.

Index > DOS > What encoding is this?

Author
Thread Post new topic Reply to topic
cypher



Joined: 07 Apr 2011
Posts: 51
Location: The cave
cypher
Code:
org 100h

start:
        mov ah,9
        mov dx,msg
        int 21h

        xor ax,ax
        int 16h

        mov ax,4C00h
        int 21h

msg dw 1204h, 4B04h, 2000h, 4204h, 3E04h, 3B04h, 4C04h
    dw 3A04h, 3E04h, 2000h, 4704h, 4204h, 3E04h, 2000h
    dw 3204h, 4B04h, 3804h, 3304h, 4004h, 3004h, 3B04h
    dw 3804h, 2000h, 2400h, 2000h, 2104h, 4204h, 3E04h
    dw 2000h, 3E04h, 4204h, 2000h, 2D04h, 3B04h, 3204h
    dw 3804h, 3D04h
    dw "$"
    


When I display the above I get the some strange result. Could someone tell me what encoding is used above, please?

Thank you in advance.

_________________
When all in life fails, get weird and disappear into the mountains
Post 18 Apr 2011, 21:22
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
apparentlly, you can delete the low significant byte from every dw in msg, letting only bytes, it will displays:

 K B > ; L : > G B > 2 K 8 3 @ 0 ; 8

effectivelly, the text is encoded.
maybe just conditionally xored with a fixed key, the simplest to do.
Post 18 Apr 2011, 22:36
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
UTF-16 Big Endian (Except for the dollar sign at the end). Cyrillic text of unknown meaning to me Razz

BTW, don't expect DOS to correctly handle this, only simple 8-bits per char is possible here.

[edit]In case you want to see this by yourself:
Code:
format binary as 'txt'
    db $FE, $FF

msg dw 1204h, 4B04h, 2000h, 4204h, 3E04h, 3B04h, 4C04h
    dw 3A04h, 3E04h, 2000h, 4704h, 4204h, 3E04h, 2000h
    dw 3204h, 4B04h, 3804h, 3304h, 4004h, 3004h, 3B04h
    dw 3804h, 2000h, 2400h, 2000h, 2104h, 4204h, 3E04h
    dw 2000h, 3E04h, 4204h, 2000h, 2D04h, 3B04h, 3204h
    dw 3804h, 3D04h
    dw "$"     
As shown by WinXP's Notepad wrote:
Вы только что выиграли $ Сто от Элвин␀
Sorry if this is not really Cyrillic text, I thought it was initially, but now I'm not so sure all characters are Cyrillic.[/edit]

[edit2]Oh right, Google Translator!
Quote:
You've just won $ hundred of Alvin
That seems to be what the text means.[/edit2]
Post 18 Apr 2011, 22:40
View user's profile Send private message Reply with quote
cypher



Joined: 07 Apr 2011
Posts: 51
Location: The cave
cypher
edfed Thanks, man; but LocoDelAssembly figured it out.

LocoDelAssembly, Thanks. I had a feeling that it was some UTF.

Quote:
You've just won $ hundred of Alvin

That's exactly what it should mean. My friend had this string of hexadecimals as his status and he asked if anyone could figure what it meant, and if someone did, he/she would win $100. Yay! I won!
But I never knew that he would encode it in UTF-16 Big Endian. Smart guy.

I think he should join FASM.

Thanks again guys.
Post 18 Apr 2011, 23:29
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
It means, "Вы только что выиграли $ Сто от Элвин." = "You just won 1 houndred $ from Alwin." Wink
Post 18 Apr 2011, 23:33
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
quote wrote:

But I never knew that he would encode it in UTF-16 Big Endian
Well, considering you said it was as a string of hexadecimals, then perhaps it was in little endian, but since you grouped it in byte pairs and used "dw" then the "endianess" was reversed. For instance, if a hex editor shows "01 02 03 04" then you have to remember to use "dd $04030201", or "dw $0201, $0403" or "db $01, $02, $03, $04" to preserve the order in which the byte values appear.
Post 18 Apr 2011, 23:45
View user's profile Send private message Reply with quote
cypher



Joined: 07 Apr 2011
Posts: 51
Location: The cave
cypher
Ahh I see. So little endian is the reverse of big endian and vice versa. If it was big endian, then the little endian of the hex string would be the complete reverse of the hex string above.
Post 19 Apr 2011, 01:02
View user's profile Send private message Reply with quote
nop



Joined: 01 Sep 2008
Posts: 165
Location: right here left there
nop
cypher wrote:
My friend had this string of hexadecimals as his status and he asked if anyone could figure what it meant, and if someone did, he/she would win $100. Yay! I won!
i think u owe loco $100 Razz
Post 19 Apr 2011, 01:32
View user's profile Send private message Reply with quote
cypher



Joined: 07 Apr 2011
Posts: 51
Location: The cave
cypher
lol. do i? yea i do.
here you go:
Image


where i am from, you are actually getting twice what i would get.
Post 19 Apr 2011, 02:16
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Huurra, I've just got a week of salary by resolving simple puzzle Very Happy
Post 19 Apr 2011, 02:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17467
Location: In your JS exploiting you and your system
revolution
cypher wrote:
Image


where i am from, you are actually getting twice what i would get.
But you only gave one side so it is only worth $50. Very Happy
Post 19 Apr 2011, 02:31
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17467
Location: In your JS exploiting you and your system
revolution
LocoDelAssembly wrote:
Huurra, I've just got a week of salary by resolving simple puzzle Very Happy
You're now a professional code breaker. Cool
Post 19 Apr 2011, 02:33
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
OK, half a week then (although I rounded up earlier so is more than half a week).
Post 19 Apr 2011, 02:36
View user's profile Send private message Reply with quote
cypher



Joined: 07 Apr 2011
Posts: 51
Location: The cave
cypher
Half a week's pay? Very Happy

Check to see if it's legal tender because i found it somewhere on the ground... [lies] Actually I took it from a homeless man Sad I've done wrong
Post 19 Apr 2011, 14:03
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.