ForumForum  PortalliPortalli  GalleryGallery  RegjistrohuRegjistrohu  identifikimiidentifikimi  
Kėrko
 
 

Display results as :
 
Rechercher Advanced Search
Tema Fundit
» Rreziqet dhe mbrojtja e rrjetit pa tela
Mon Dec 19, 2011 3:20 pm nga baton

» Download 62 Programe
Thu Dec 15, 2011 12:09 pm nga muha

» Paraqitni problemet tuaja
Wed Dec 14, 2011 12:55 pm nga muha

» Nese e kini XP jo Origjinal atehere merrne patjeter ket Software
Sun Dec 20, 2009 6:03 am nga CLIRIMI

» Chocolatier 2: The Secret Ingredient
Mon Nov 02, 2009 7:38 pm nga konvict

» Beni KErKEsa pER fIlmA
Thu May 07, 2009 11:20 am nga ZAMIRI75

» Exclamation 1 menyr per web hacking
Sat Feb 07, 2009 5:11 pm nga p!rAt-xXx

» SONY ERICSSON S001 – I KA TĖ GJITHA
Tue Feb 03, 2009 2:55 am nga p!rAt-xXx

» prezentimi
Wed Oct 29, 2008 9:10 pm nga Shkodran

Navigacion
 Portalli
 Indeksi
 Lista e Anėtarėve
 Profili
 Kėrko
Shiko rezultatet live

Share | 
 

 Hole in Notepad

Shiko temėn e mėparshme Shiko temėn pasuese Shko poshtė 
AutoriMesazh
p!rAt-xXx
Webmaster
Webmaster


Male
Numri i postimeve : 232
Location : System32
Job/hobbies : HaCk3r iN kOsoVA
Registration date : 04/02/2008

MesazhTitulli: Hole in Notepad   Mon Mar 10, 2008 2:43 am

Hole in Notepad



Quote:





Over at WinCustomize, someone thought they'd found an Easter Egg in the Windows Notepad application. If you:

1. Open Notepad
2. Type the text "this app can break" (without quotes)
3. Save the file
4. Re-open the file in Notepad

Notepad displays seemingly-random Chinese characters, or boxes if your default Notepad font doesn't support those characters.

It's not an Easter egg (even though it seems like a funny one), and as
it turns out, Notepad writes the file correctly. It's only when Notepad
reads the file back in that it seems to lose its mind.

But we can't even blame Notepad: it's a limitation of Windows itself,
specifically the Windows function that Notepad uses to figure out if a
text file is Unicode or not.

You see, text files containing Unicode (more correctly, UTF-16-encoded
Unicode) are supposed to start with a "Byte-Order Mark" (BOM), which is
a two-byte flag that tells a reader how the following UTF-16 data is
encoded. Given that these two bytes are exceedingly unlikely to occur
at the beginning of an ASCII text file, it's commonly used to tell
whether a text file is encoded in UTF-16.

But plenty of applications don't bother writing this marker at the
beginning of a UTF-16-encoded file. So what's an app like Notepad to
do?

Windows helpfully provides a function called IsTextUnicode()--you pass
it some data, and it tells you whether it's UTF-16-encoded or not.

Sorta.

It actually runs a couple of heuristics over the first 256 bytes of the
data and provides its best guess. As it turns out, these tests aren't
terribly reliable for very short ASCII strings that contain an even
number of lower-case letters, like "this app can break", or more
appropriately, "this api can break".

The documentation for IsTextUnicode says:

These tests are not foolproof. The statistical tests assume certain
amounts of variation between low and high bytes in a string, and some
ASCII strings can slip through. For example, if lpBuffer points to the
ASCII string 0x41, 0x0A, 0x0D, 0x1D (A\n\r^Z), the string passes the
IS_TEXT_UNICODE_STATISTICS test, though failure would be preferable.

_________________

Mbrapsht nė krye Shko poshtė
Shiko profilin e anėtarit http://www.hard-team.org
 
Hole in Notepad
Shiko temėn e mėparshme Shiko temėn pasuese Mbrapsht nė krye 
Faqja 1 e 1

Drejtat e ktij Forumit:Ju nuk mund ti pėrgjigjeni temave tė kėtij forumi
 :: Tutoriale-
Kėrce tek: