Loading ...
Sorry, an error occurred while loading the content.

Re: Locking a program

Expand Messages
  • Rod
    I am finding your post confusing and distracting. I have no idea what mustermind is or where I can get it. I have no idea what this locking subject is all
    Message 1 of 2 , Dec 1, 2011
    • 0 Attachment
      I am finding your post confusing and distracting. I have no idea what mustermind is or where I can get it. I have no idea what this locking subject is all about or where I can read about it.

      If you want real help post real questions with real code that demonstrates real problems.

      This community thrives on challenges, currently I am failing to understand what you are asking.
    • Yshua Calkins
      Hello, Readers:           My curiosity was quite peaked at this encryption coding to lock a program....   I would like to get a copy of the original
      Message 2 of 2 , Dec 4, 2011
      • 0 Attachment
        Hello, Readers:
         
                My curiosity was quite peaked at this encryption coding to lock a program....   I would like to get a copy of the original Mustermind code (locked version), but was unable to find it again in uploaded Liberty Basic files.  Would like to compare it with the unlocked version which I copied.  Can I hear once more how to look at that code?
         
        Sincerely,
        Yshua

        From: green8819 <green8819@...>
        To: libertybasic@yahoogroups.com
        Sent: Thursday, December 1, 2011 8:11 PM
        Subject: [libertybasic] Re: Locking a program


         

        Confusing? Maybe. Distracting? Never intended.

        Mustermind is my version of the universally popular game called `Mastermind'.
        The code for my version is given below. There is no problem with it.

        Let's say I want to sell it. You have to encrypt it right? I discovered a bas called `encryption' made by Carl, Ian, Alyce and Brosco. I used this (slightly modified) to encrypt my program. Let's call it `Mustermind Locked'. (It's back in Files page).

        I play, then close it. Is it really closed? No! It runs hidden with CPU at 100%.

        1)Any idea what's wrong?
        2)Is there any other method to lock a program?

        'code for unlocked Mustermind
        nomainwin
        WindowWidth = 240 :WindowHeight = 500
        UpperLeftX=int((DisplayWidth-WindowWidth)/2)
        UpperLeftY=int((DisplayHeight-WindowHeight)/2)
        crlf$=chr$(13)+chr$(10)
        stylebits #w, 0, _WS_MAXIMIZEBOX, 0, 0
        TextboxColor$ = "buttonface"
        textbox #w.rp,110,60,43,35
        textbox #w.wp,155,60,40,35
        stylebits #w.guess, _ES_NUMBER, 0, 0, 0
        statictext #w.txt1, "Guess the 3-dgt number",30, 30, 200, 25
        TextboxColor$ = "white" :textbox #w.guess, 30, 60, 60, 35
        TextboxColor$ = "yellow" :textbox #w.num, 30, 100, 60, 280
        TextboxColor$ = "buttonface":textbox #w.status, 110,100, 85, 280
        statictext #w.result,"",30,395,200,25
        button #w.default "", [entered], UL, 1, 1, 1, 1
        button #w.again," Again ",[again], UL, 30, 430 ', 45, 25
        button #w.quit," End ",[quit], UL, 145, 430 ', 40, 25

        open "Mustermind ...by Mike" for dialog as #w
        #w, "font courier_new 20" :#w, "trapclose [quit]"
        #w.rp, "!font tahoma 8" :#w.wp, "!font tahoma 8"
        #w.txt1, "!font arial 12" :#w.result, "!font courier_new 12"
        #w.again, "!font arial 12" :#w.quit, "!font arial 12"
        #w.rp, "Right"+crlf$+"Places" :#w.wp,"Right"+crlf$+"Digits"
        success=SendMessage(hwnd(#w.guess),_EM_LIMITTEXT,3,0)

        [start]
        try=0
        rdm=1+int(rnd(0)*1000) :rdm$="00"+str$(rdm) :rdm$=right$(rdm$,3)
        for x=1 to 3 :dm$(x)=mid$(rdm$,x,1):next
        #w.again,"!hide" :#w.quit,"!hide"
        [LoopGuess]
        for x=1 to 3:copy$(x)=dm$(x):next
        #w.guess, "!setfocus"
        wait

        [entered]
        #w.guess, "!contents? guess$"
        if len(guess$)<3 then #w.guess, "!setfocus":wait
        try=try+1
        num$=num$+guess$+crlf$ :#w.num, num$ :#w.guess, ""
        for x=1 to 3 :gs$(x)=mid$(guess$,x,1):next
        rp=0:rd=0
        for x=1 to 3:if gs$(x)=dm$(x)then rp=rp+1 'rigt placess
        next
        for x=1 to 3
        in$=""
        for y=1 to 3
        if gs$(x)=copy$(y)then in$="in"
        next:if in$="in" then rd=rd+1 'right digits
        next
        ans$=" "+str$(rp)+" "+str$(rd)
        chk$=chk$+ans$+crlf$
        #w.status,chk$
        if guess$<>rdm$ and try<>9 then [LoopGuess]
        #w.guess,rdm$ :result$=" Game Over"
        if guess$=rdm$ and try<=9 then result$="Congratulations!"
        gosub [ShowResult]
        #w.again,"!show" :#w.quit,"!show"
        wait

        [again]
        num$="":chk$=""
        #w.num,"" :#w.status,"":#w.guess,"":#w.result,""
        redim dm$(3):redim gs$(3):redim copy$(3):try=0
        goto [start]

        [quit]
        close #w
        END
        '---------------------------------------------------------
        function SendMessage(handle, message, wParam, lParam)
        calldll #user32, "SendMessageA", handle as ulong, message as ulong,_
        wParam as ulong, lParam as ulong, SendMessage as ulong
        end function

        sub pause msec
        timer msec, [timeroff]
        wait
        [timeroff]
        timer 0
        end sub

        [ShowResult]
        for x=1 to 9
        #w.result,"" :#w.guess,"":call pause 200
        #w.result,result$ :#w.guess,rdm$ :call pause 200
        next
        call pause 1000
        return

        'end code

        --- In libertybasic@yahoogroups.com, "Rod" <rodbird@...> wrote:
        >
        > I am finding your post confusing and distracting. I have no idea what mustermind is or where I can get it. I have no idea what this locking subject is all about or where I can read about it.
        >
        > If you want real help post real questions with real code that demonstrates real problems.
        >
        > This community thrives on challenges, currently I am failing to understand what you are asking.
        >




        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.