Results 1 to 10 of 10

Thread: A small challenge

  1. #1
    XER
    Guest

    A small challenge

    My dad's an arrogant bastard and thinks this source code is air tight. I thought I'd put it to the test here.

    Code:
    Here is code where you can seek equation to determine fyt (command$):
     
     
    4 gh = 1056: fyt = VAL(COMMAND$)
    5 ON ERROR GOTO 6000
    10 CLS
    12 IF gh <> 1056 THEN PRINT "NOT SUCCESSFUL": END ELSE GOSUB 7000
    IF PW <> VAL(COMMAND$) THEN 5000 ELSE PRINT "SUCCESSFUL": END
    5000 PRINT "NOT SUCCESSFUL": END
    6000 PRINT "ERROR": END
    7000 PW1 = 120900!: : FYT2 = INT(SQR(fyt))
    7020 PW2 = 83 - FYT2
    PW = PW1 + PW2
    7030 RETURN
    Solve for PW.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    To crash or not to crash
    Join Date
    Dec 2001
    Posts
    120
    To be an arrogant bastard he should first improve his coding. It must be the worst coding style I have ever seen

    Anyway, the answer is 120636

    A question though: What is the variable gh good for and why is it checked? It's not used apart from the check which can't fail.
    Last edited by Iwarez; December 25th, 2008 at 17:46. Reason: added question

  3. #3
    Howdy,

    I sat here and stared at that code and I have a very vague sense of that style.

    He must be my age (old) .

    That code was airtight before we had math .

    Sorry Dad.

    Woodmann

  4. #4
    XER
    Guest
    Nice job Iwarez! That didn't' take long, as I expected =). Would you be kind enough to post how or what method you used to get the answer? My dad wants to know.

    As for the 'gh' variable', I was wondering that myself when I looked at it. The only thing I could think of is that 'gh' plays a roll somewhere else in the program and he just fixed the value to 1056 instead of deleting the code at line at 12. And yes Woodmann, it is old code. My dad originally painted this program on a cave wall . Not to say that you're as old as that .

    P.S. - I'm dazzled by everyone's level of expertise here. I'm a little unsure of my own reversing progress. Would you guys mind telling me how long you've been reversing and/or how long it's taken you to get proficient? By proficient I mean being able to sit down with a piece of disassembled code and understand what it's doing.
    Last edited by XER; December 25th, 2008 at 19:52. Reason: Added P.S.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  5. #5
    Howdy,

    Square root? (I dont remember what that button means on my calculator) of 120900=347
    347-83=264

    120900-264=120636

    I'm a hack so I dont look at such things as the gh variable.
    I mean I looked at it but it didnt make any sense to me so I ignored it.

    As for how long have I been doing this, thats kind of arbitrary. It depends on your age.
    I am from the age or BASIC, actually, I am older than that .

    Young'ins these days are born of computers. I was born before color TV .

    Woodmann

  6. #6
    Super Moderator
    Join Date
    Dec 2004
    Posts
    1,512
    Blog Entries
    15
    how would one tend to solve it

    pw = pw1 +pw2
    pw = pw1 + 83 -fyt2
    pw = pw1 + 83 - int(sqr(fyt))
    pw = 120900 + 83 - int(sqr(fyt))
    pw = 120983 - int(sqr(fyt))

    since pw <> fyt

    pw + sqrt (pw) = 120983

    or in mathematical notation

    y = x + root(x)

    which can be deduced
    or we can use some online graph plotter

    see pic

    the url is in pic
    Attached Images Attached Images  

  7. #7
    Musician member evaluator's Avatar
    Join Date
    Sep 2001
    Posts
    1,489
    Blog Entries
    1
    Don Wooma!!!
    (i nothing understood, BUT!) finally you shoWed grEat reWer_sing!
    ~8D

  8. #8
    XER
    Guest
    Ah, I thought of linear equations myself. Thank you for taking the time to post your method blabberer =).

    XER
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  9. #9
    Errrrrrr.........

    Don Wooma i understood grEat but not .

    Party on Wayne.

    Woodmann

  10. #10
    Super Moderator
    Join Date
    Dec 2004
    Posts
    1,512
    Blog Entries
    15
    Quote Originally Posted by XER View Post
    Ah, I thought of linear equations myself. Thank you for taking the time to post your method blabberer =).

    XER
    well you should have thought about quadratic equations as well

    Code:
    y = x + root x 
    
    120983 = x + sqrt(x)
    
    
    let x = z^2 
    
    so 
    
    y = z^2 + z
    
    z^2 +z -120983 = 0
    
    solving this quadratic equation 
    
    ax^2 + bx +c = 0 
    
    where a= 1, b= 1, c= -120983 
    
    you get 347.326465353055  and -348.326465353055 as roots
     
    ie 
    z = sqrt(x) = 347.326465353055
    
    z^2 = x = 120635.673534646915325797833025
    
    so y = x + sqrt(x) = 120982.999999999970325797833025 ~ = 120983
    
    so since we are considering the integer part of sqrt 
    
    we should roundup 120635,67#### 
    to 120636 which is your pw

Similar Threads

  1. small help
    By x102 in forum The Newbie Forum
    Replies: 4
    Last Post: April 21st, 2010, 15:59
  2. Need small help (20% only)
    By w_a_r_1 in forum The Newbie Forum
    Replies: 4
    Last Post: June 18th, 2009, 09:47
  3. Need small help for UPX
    By Hero in forum The Newbie Forum
    Replies: 7
    Last Post: May 13th, 2005, 15:29
  4. Need help with this very small app please
    By Flack in forum Malware Analysis and Unpacking Forum
    Replies: 2
    Last Post: August 16th, 2002, 02:59

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
  •