Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,10 +0,0 @@
package OO_Privacy is
type Confidential_Stuff is tagged private;
subtype Password_Type is String(1 .. 8);
private
type Confidential_Stuff is tagged record
Password: Password_Type := "default!"; -- the "secret"
end record;
end OO_Privacy;

View file

@ -1,16 +0,0 @@
with OO_Privacy, Ada.Unchecked_Conversion, Ada.Text_IO;
procedure OO_Break_Privacy is
type Hacker_Stuff is tagged record
Password: OO_Privacy.Password_Type := "?unknown";
end record;
function Hack is new Ada.Unchecked_Conversion
(Source => OO_Privacy.Confidential_Stuff, Target => Hacker_Stuff);
C: OO_Privacy.Confidential_Stuff; -- which password is hidden inside C?
begin
Ada.Text_IO.Put_Line("The secret password is """ & Hack(C).Password & """");
end OO_Break_Privacy;

View file

@ -1,5 +0,0 @@
package OO_Privacy.Friend is -- child package of OO.Privacy
function Get_Password(Secret: Confidential_Stuff) return String;
end OO_Privacy.Friend;

View file

@ -1,6 +0,0 @@
package body OO_Privacy.Friend is -- implementation of the child package
function Get_Password(Secret: Confidential_Stuff) return String is
(Secret.Password);
end OO_Privacy.Friend;

View file

@ -1,11 +0,0 @@
with OO_Privacy.Friend, Ada.Text_IO;
procedure Bypass_OO_Privacy is
C: OO_Privacy.Confidential_Stuff; -- which password is hidden inside C?
begin
Ada.Text_IO.Put_Line("Password: """ &
OO_Privacy.Friend.Get_Password(C) &
"""");
end Bypass_OO_Privacy;