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 ...
- 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!
Reply to: Pimps getting creative
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.
Logging in...
Previously on "Pimps getting creative"
Collapse
-
Originally posted by NickFitz View PostI'm also getting a warning at
Code:index = strtol(argv[1], NULL, 10);
Maybe they're assuming a 32-bit system?
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:
-
Originally posted by VectraMan View PostEh? 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?
My C coding days are long behind me, so don't judge too harshly.
Leave a comment:
-
Originally posted by DaveB View Postgcc -m32 is targetting it for a 32 bit system isnt it?
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:
-
It outputs the Steam Key for Samantha Fox Strip Poker, can I have my GCHQ code breaker job now please ?
Leave a comment:
-
I'm also getting a warning at
Code:index = strtol(argv[1], NULL, 10);
Maybe they're assuming a 32-bit system?
Leave a comment:
-
Originally posted by NickFitz View PostBTW, 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
Of course I could be entirely wonrg / out of date.
Leave a comment:
-
Originally posted by NickFitz View PostBTW, 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:
-
Originally posted by NickFitz View PostWhen 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:
-
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:
-
Originally posted by DaveB View PostWTBS.
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.
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:
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Streamline Your Retirement with iSIPP: A Solution for Contractor Pensions Sep 1 09:13
- Making the most of pension lump sums: overview for contractors Sep 1 08:36
- Umbrella company tribunal cases are opening up; are your wages subject to unlawful deductions, too? Aug 31 08:38
- Contractors, relabelling 'labour' as 'services' to appear 'fully contracted out' won't dupe IR35 inspectors Aug 31 08:30
- How often does HMRC check tax returns? Aug 30 08:27
- Work-life balance as an IT contractor: 5 top tips from a tech recruiter Aug 30 08:20
- Autumn Statement 2023 tipped to prioritise mental health, in a boost for UK workplaces Aug 29 08:33
- Final reminder for contractors to respond to the umbrella consultation (closing today) Aug 29 08:09
- Top 5 most in demand cyber security contract roles Aug 25 08:38
- Changes to the right to request flexible working are incoming, but how will contractors be affected? Aug 24 08:25
Leave a comment: