Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue