Program keygen ; {name the program}
uses crt ; {crt is a unit, this is similar to the include directive in c/c++}
var {variable declarations}
  namelen, name1, i, eax : longint ;
  username : string ;

begin
  clrscr ; {clear the screen, similar to CLS in QBasic}
  writeln('Keygen for cyT0m!cs CrackMe #1 by ManKind') ;
  writeln('=========================================') ;
  writeln ;

  write('Name: ') ; {input user}
  readln(username) ; {gets user's input, similar to gets in c/c++}
  namelen:=length(username) ; {get the length of user's name into variable namelen}
  eax:=1 ;

  if namelen > 0 then {the calculation will only take place if name is entered}
   begin
    for i:=1 to namelen do
     begin
      name1 := Ord(username[i]) * eax ;
      eax:= name1 ;
     end ;
    eax:=eax and 268435455 ;
    write('Serial #:') ; {output the correct serial}
    writeln(eax) ;
   end ;

  if namelen < 1 then
   begin
    writeln('Invalid name!') ; {display this message if no name is entered}
   end ;

readln ;
end.