• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Pimps getting creative"

Collapse

  • Jonesgt
    replied
    Not sure what the rules of the challenge were ...

    But I modified the code to:

    1) include i in the printf statement in function try
    2) changed the <= FTBL_LEN to < FTBL_LEN in the error/boundary check section

    Call program with 5 as argument i.e. index=5 to invoke goal function which outputs the same address as the pointer stored in tbl[5].

    I'll get my coat ...

    Leave a comment:


  • Sysman
    replied
    Originally posted by NickFitz View Post
    I'm also getting a warning at

    Code:
    index = strtol(argv[1], NULL, 10);
    "Implicit conversion loses integer precision: 'long' to 'int'"

    Maybe they're assuming a 32-bit system?
    That wouldn't surprise me.

    I did a course on analysing malware last year and every single research paper presented addressed 32 bit only.

    Which I thought somewhat odd.

    Leave a comment:


  • suityou01
    replied
    Originally posted by darmstadt View Post
    Progressed onto D now?
    Seesh harp.

    Leave a comment:


  • darmstadt
    replied
    Originally posted by suityou01 View Post
    My C coding days are long behind me, so don't judge too harshly.
    Progressed onto D now?

    Leave a comment:


  • suityou01
    replied
    Originally posted by VectraMan View Post
    Eh? tbl is an array of function pointers that take one argument. So that's fine. I guess try is okay in C because it's a keyword in C++.

    Is there more to it than 5?
    I may have mentioned that tbl is an array of function pointers in the post before yours. Why not pop over and take a look?

    My C coding days are long behind me, so don't judge too harshly.

    Leave a comment:


  • NickFitz
    replied
    Originally posted by DaveB View Post
    gcc -m32 is targetting it for a 32 bit system isnt it?
    Dunno ¯\_(ツ)_/¯

    I went from various assembly languages and Forth directly to JavaScript; I never did anything with C, so I only really know as much of it as I need to work in Objective C. Things like gcc command-line options are not within my ambit

    As I'm looking at it in Xcode, the warnings will be from clang, so maybe gcc wouldn't mind that bit.

    Leave a comment:


  • sbakoola
    replied
    It outputs the Steam Key for Samantha Fox Strip Poker, can I have my GCHQ code breaker job now please ?

    Leave a comment:


  • DaveB
    replied
    Originally posted by NickFitz View Post
    I'm also getting a warning at

    Code:
    index = strtol(argv[1], NULL, 10);
    "Implicit conversion loses integer precision: 'long' to 'int'"

    Maybe they're assuming a 32-bit system?
    gcc -m32 is targetting it for a 32 bit system isnt it?

    Leave a comment:


  • NickFitz
    replied
    Originally posted by FatLazyContractor View Post


    Did you say that you are still on bench ?!!!
    I haven't sought to leave it yet

    Leave a comment:


  • NickFitz
    replied
    I'm also getting a warning at

    Code:
    index = strtol(argv[1], NULL, 10);
    "Implicit conversion loses integer precision: 'long' to 'int'"

    Maybe they're assuming a 32-bit system?

    Leave a comment:


  • DaveB
    replied
    Originally posted by NickFitz View Post
    BTW, Suity is correct about the printf in the try function: GCC gives a warning that there are more placeholders than variables. Obviously, i should also be mentioned in that call
    In the very dim and distant past when I actually coded stuff, I seem to remember that printf will grab the last matching variable off the stack if not told otherwise. So printf(%d) would grab the last integer value from the stack, since that seems to be i as passed to try() then it uses that. Slopping coding but it works.

    Of course I could be entirely wonrg / out of date.

    Leave a comment:


  • VectraMan
    replied
    Originally posted by NickFitz View Post
    BTW, Suity is correct about the printf in the try function: GCC gives a warning that there are more placeholders than variables. Obviously, i should also be mentioned in that call
    Won't print 0 though, probably not anyway. It'll print whatever is lurking around the stack as an integer.

    Leave a comment:


  • FatLazyContractor
    replied
    Originally posted by NickFitz View Post
    When it's first requested from within the page, the Referer (TBL's everlasting spelling mistake) header check on the Disney server results in a 403 Forbidden response. Once you've looked at it in another tab, your browser has cached it. Thus it never makes the request after that, it just shows the cached copy.

    This also explains why Suity reckons it's working for him, as obviously he had to have looked at it to get the URL to post it, so he's seeing the copy his own browser has cached.

    The rest of us are left quoting T S Eliot:
    What are the roots that clutch, what branches grow
    Out of this stony rubbish? Son of man,
    You cannot say, or guess, for you know only
    A heap of broken images…


    Did you say that you are still on bench ?!!!

    Leave a comment:


  • NickFitz
    replied
    BTW, Suity is correct about the printf in the try function: GCC gives a warning that there are more placeholders than variables. Obviously, i should also be mentioned in that call

    Leave a comment:


  • NickFitz
    replied
    Originally posted by DaveB View Post
    WTBS.

    Although if I grab the image url from the page properties and load it in a seperate tab, it then appears correctly in the thread.
    When it's first requested from within the page, the Referer (TBL's everlasting spelling mistake) header check on the Disney server results in a 403 Forbidden response. Once you've looked at it in another tab, your browser has cached it. Thus it never makes the request after that, it just shows the cached copy.

    This also explains why Suity reckons it's working for him, as obviously he had to have looked at it to get the URL to post it, so he's seeing the copy his own browser has cached.

    The rest of us are left quoting T S Eliot:
    What are the roots that clutch, what branches grow
    Out of this stony rubbish? Son of man,
    You cannot say, or guess, for you know only
    A heap of broken images…

    Leave a comment:

Working...
X