How do I print the value 0x9B as the corresponding
ASCII character ?

I have this code:
004015FB  |. 68 C4304000    PUSH Convert.004030C4                    ; /Text = "?"

00401600 |. 68 A20F0000 PUSH 0FA2 ; |ControlID = FA2
00401605 |. FF75 08 PUSH DWORD PTR SS:[EBP+8] ; |hWnd
00401608 |. E8 C7000000 CALL <JMP.&user32.SetDlgItemTextA> ; \SetDlgItemTextA

I get an odd character like "|" - not the exact one, but nearly.

The character I would have printed out is: "?"


The SharK
Posted on 2004-12-28 15:46:19 by The SharK
I can only think of OemToChar function. It should convert it to correct character. But there probably should be other, better(?) way.
Posted on 2004-12-28 16:07:51 by arafel
Hi arafel

I can only think of OemToChar function.

That gives me the wrong output :cry:


The SharK
Posted on 2004-12-28 17:02:49 by The SharK
You probably need to use a different font. The system font may not have a graphic for 0x9B. Strictly speaking, graphics exist in ASCII/ANSI for only values 0x20-0x7E. And some fonts comply with that restriction.
Posted on 2004-12-28 18:27:31 by tenkey
Dont know if this helps or not...
Looked at some standard (and extended) ASCII tables and the one you
listed as wanting was missing from almost all of them.

Except one:

According to that document its a "Microsoft? Windows Latin-1 Added Character". My only guess from the description of that would be the dialog would need to have its font set to Latin-1?

Just a wild guess here bro...
Hope it helps
Posted on 2004-12-28 18:37:06 by Graebel
oh yes, sorry. i thought you wanted to print oem ascii representation of 9bh (OemToChar prints ISO 8859-1 Latin-1 only character set without Windows Latin-1 added characters (characters from 82h to 9Fh)). should have read your post till the end :)

in order to print the right single angle quote mark (>) it's must be supported by the current font (as tenkey already pointed out). if not it's replaced by default character - empty box.
Posted on 2004-12-28 18:42:35 by arafel

I made a small 8-bit program, to print out 255 characters
in a DOS box. And I saw that only the characters from
0x20 to 0x7E where valid ASCII characters, as tenkey
said ;-)

The character I saw printed for 0x9B "?",
where in OllyDbg. But obviously it must
be the default windows character set.


The SharK
Posted on 2004-12-28 19:24:45 by The SharK
You didn't write a program in 8 bits that does that, or I'll eat my hat.
Posted on 2004-12-28 19:53:48 by Sephiroth3
Okay Sephiroth3, start eating..... :-D

Of course not, but I used mostly 8-bit registers :)
The whole program is 136 bit !

I could maybe have made it smaller if I wanted ;-)


Posted on 2004-12-29 13:16:34 by The SharK