Interesting discussion.
I remember when I used to use Windows 98, somehow I managed to dig out the Internet Explorer 4 easter egg.
The following code demonstrate the decoding of this easter egg as it is still present, even in Internet Explorer 6.
(just tested on Windows XP).
___
[tt]
Private Declare Function LoadLibraryEx Lib "kernel32" Alias "LoadLibraryExA" (ByVal lpLibFileName As String, ByVal hFile As Long, ByVal dwFlags As Long) As Long
Private Declare Function FindResource Lib "kernel32" Alias "FindResourceA" (ByVal hInstance As Long, ByVal lpName As Any, ByVal lpType As Any) As Long
Private Declare Function LoadResource Lib "kernel32" (ByVal hInstance As Long, ByVal hResInfo As Long) As Long
Private Declare Function LockResource Lib "kernel32" (ByVal hResData As Long) As Long
Private Declare Function SizeofResource Lib "kernel32" (ByVal hInstance As Long, ByVal hResInfo As Long) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Const LOAD_LIBRARY_AS_DATAFILE = &H2
Const RT_HTML = 23&
Private Sub Form_Load()
Dim WCEE As String, Data As String, Credits() As String
WCEE = Get_WCEE_HTML_Resource
Data = Get_HashData(WCEE)
Decrypt Data
Credits = Split(Data, vbCrLf)
ShowCredits Credits
End Sub
Function Get_WCEE_HTML_Resource() As String
Dim hLib As Long, hRsrc As Long, hGlbl As Long, pRes As Long, lRes As Long
hLib = LoadLibraryEx("shdoclc", 0, LOAD_LIBRARY_AS_DATAFILE)
hRsrc = FindResource(hLib, "WCEE.HTM", RT_HTML)
hGlbl = LoadResource(hLib, hRsrc)
pRes = LockResource(hGlbl)
lRes = SizeofResource(hLib, hRsrc)
Get_WCEE_HTML_Resource = Space$(lRes)
CopyMemory ByVal Get_WCEE_HTML_Resource, ByVal pRes, lRes
FreeLibrary hLib
End Function
Function Get_HashData(WCEE As String) As String
Dim Lines() As String, N As Long
Lines = Split(WCEE, vbCrLf)
For N = 0 To UBound(Lines)
If Left$(LTrim$(Lines(N)), 12) = "g_HashTable[" Then
Get_HashData = Get_HashData & Split(Lines(N), """")(1)
End If
Next
End Function
Sub Decrypt(Data As String)
Data = Replace$(Data, "{", vbCrLf)
For N = 1 To Len(Data)
Select Case Mid$(Data, N, 1)
Case "A" To "M": Mid$(Data, N, 1) = Chr$(Asc(Mid$(Data, N, 1)) + 32 + 13)
Case "a" To "m": Mid$(Data, N, 1) = Chr$(Asc(Mid$(Data, N, 1)) - 32 + 13)
Case "N" To "Z", "n" To "z": Mid$(Data, N, 1) = Chr$(Asc(Mid$(Data, N, 1)) - 13)
End Select
Next
End Sub
Sub ShowCredits(Credits() As String)
ScaleMode = vbPixels: AutoRedraw = True
Font = "Times New Roman": FontSize = 12
Caption = "WCEE": Show
On Error Resume Next
Dim Y As Long, TextHeight As Long, TopRow As Long, PixelIdx As Long, Row As Long
TextHeight = Me.TextHeight("")
For TopRow = -ScaleHeight / TextHeight To UBound(Credits)
For PixelIdx = 0 To TextHeight
Cls
For Y = 0 To ScaleHeight / TextHeight
Row = TopRow + Y
CurrentX = (ScaleWidth - TextWidth(Credits(Row))) \ 2
CurrentY = Y * TextHeight - PixelIdx
Print Credits(Row)
Next
DoEvents
Next
Next
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub[/tt]
___
Note that this easter egg can still be viewed in IE using the following method.
Open Notepad, paste the following lines...
[tt]
<script>
name="TheWCEE";
navigate("res://shdoclc.dll/wcee.htm");
</script>
[/tt]
and save the file as wcee.htm. Open the file in IE to reveal the egg.