+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,923

    Default A trick with numbers

    Code:
    (setq stringNew "")
    (foreach index '(0 1 2 3 4 5)
     (setq stringNew
           (strcat stringNew
                   (chr
                    (fix
                     (atof
                      (rtos (+ (* index
                                  (+ (* index
                                      (+ (* index
                                          (- (* index
                                              (+ (* index
                                                    -0.75)
                                                 7.2917))
                                             22.5))
                                         16.708))
                                     28.25))
                               72)
                            2 0))))))
     )
    (foreach index '(0 1 2 3 4 5)
     (setq stringNew
           (strcat stringNew
                   (chr
                    (fix
                     (atof
                      (rtos
                       (+ (* index
                             (- (* index
                                 (+ (* index
                                     (- (* index
                                         (+ (* index
                                             (- (* index
                                                   0.425)
                                                6.8667))
                                            40.833))
                                        109.58))
                                    122.24))
                                23.05))
                          87)
                       2 0))))))
     )
    (alert stringNew)
    (translated from a Visual Basic 6 routine; author unknown)
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,737

    Default

    Reminds me of this:

    Code:
    (   (lambda ( f x ) (f x))
        (lambda ( x ) (eval x))
        (   (lambda ( f x ) (f x))
            (lambda ( x ) (read x))
            (   (lambda ( f x ) (f x))
                (lambda ( x ) (vl-list->string x))
                (   (lambda ( f x ) (mapcar 'f x))
                    (lambda ( x ) (boole 6 90 x))
                    (   (lambda ( f x ) (f x))
                        (lambda ( x ) (vl-string->list x))
                        "r;6?(.zx\022?665z\r5(6>{xs"
                    )
                )
            )
        )
    )
    Or, 'unobfuscated':

    Code:
    (eval
        (read
            (vl-list->string
                (mapcar
                    (function
                        (lambda ( x ) (boole 6 90 x))
                    )
                    (vl-string->list "r;6?(.zx\022?665z\r5(6>{xs")
                )
            )
        )
    )
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  3. #3
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,923

    Default

    Nice ones! I especially like the "built-in displaying"...
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,737

    Default

    Quote Originally Posted by MSasu View Post
    Nice ones! I especially like the "built-in displaying"...
    Certainly fun, but very dangerous in the wrong hands...
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  5. #5
    Super Member irneb's Avatar
    Computer Details
    irneb's Computer Details
    Operating System:
    Win7 Pro 64bit
    Computer:
    Antec One Hundred
    Motherboard:
    ASUS P8P67-Pro P67
    CPU:
    Intel i7 2600 @ 3.4GHz
    RAM:
    16GB-1600MHz
    Graphics:
    GeForce GT 430 (1GB)
    Primary Storage:
    Seagate1TB SATA2 - 7200rpm
    Monitor:
    Samsung 2333TN 23" 1920 x 1080 Full HD LCD Monitor2GW
    Discipline
    Architectural
    irneb's Discipline Details
    Occupation
    Architectural Technician and Programmer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    Sep 2010
    Location
    Jo'burg SA
    Posts
    1,737

    Default

    Registered forum members do not see this ad.

    Yep, this type of thing is usually used as a way of hard-coding unlock-codes / passwords so that such can't be readily seen in compiled code by simply viewing an EXE in a hex editor. A simple "hash" function to obfuscate such things. It's not the best method, but works to stop most people from cracking a program - won't stop a determined guy though

    It can be seen as introducing a key into your program. Although this would be like adding a 2 leaver key (i.e. easily pickable with a hairpin).
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

Similar Threads

  1. Convert integers numbers into real numbers, introducing decimal separator.
    By teknomatika in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 3rd Sep 2010, 04:07 pm
  2. Trick question ?
    By Kemion in forum AutoCAD Beginners' Area
    Replies: 7
    Last Post: 4th Feb 2008, 01:30 pm
  3. Autocad trick
    By ricardfernandes in forum AutoCAD General
    Replies: 7
    Last Post: 28th Sep 2007, 02:39 pm
  4. That did the trick
    By glazier in forum AutoCAD Beginners' Area
    Replies: 0
    Last Post: 2nd Mar 2006, 06:11 am
  5. adding numbers to numbers
    By philk in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 23rd Feb 2006, 05:45 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts