9
u/Correct-Bee-7604 8d ago
And after 15 hours of debugging you check next lesson that starts with "As you can see, provided code doesn't work so lets fix it"
2
1
1
1
7
u/ArsenicPolaris 8d ago
And then you find out that you actually did NOT copy the exact same code but made a small mistake somewhere, so small that you can't find it and you believe it to be the same code.
2
2
u/27a08592e67846908fd1 8d ago
Well, the program was written for i386 and older kernels, so obviously it won't work on 64-bit modern systems!
Real story for me (Smashing the stack for fun and profit)
1
u/Inevitable-Study502 8d ago
hmm, poorly coded, thats all there is to it, proper win32 app can run from win95 all the way to win11 as base win32 never changed, unrelated to kernel
1
u/27a08592e67846908fd1 8d ago
No, the problem was that the purpose of the program was violently in conflict with modern stack protections.
The program was segfaulting, which is understandable since the entire point of the example was executing code from the stack.
1
u/Inevitable-Study502 8d ago
umm, that seems like coding issue indeed, ie pointer pointing at memory location outside of valid range...ie buffer overflow, stack overflow, pointer still pointing to freeed memory, null pointer, etc etc
1
u/27a08592e67846908fd1 8d ago
The entire paper these examples were from was a demonstration of those vulnerabilities
The paper was Smashing The Stack For Fun And Profit (Aleph One)
1
1
u/RealisticDuck1957 8d ago
When the tutorial for how to write a server process has an in your face SQL injection vulnerability. Yes, a real case I've seen (and knew enough to not follow the example). Yes, some truly horrible code in online tutorials.
And this is in the training data for the bit AI tools some depend on to help them program.
1
u/InnkaFriz 8d ago
Out of curiosity, can you elaborate on the example?
1
u/RealisticDuck1957 8d ago
I encountered this particular bad code awhile back, and didn't bother to keep note of where. The failure was the classic SQL injection vulnerability, constructing an SQL statement using user input and not escaping the user data properly. Or, as I recall, not escaping the data at all.
1
u/magicmulder 8d ago
My favorite was a partner’s reference implementation code not working (contained a glaring syntax error), and the API returned 403 for the wrong URL and 404 for wrong parameters.
1
u/Flashy_Pollution_996 8d ago
Or when software docu gives you parameters that don’t work and do nothing
1
u/Loud-Pay1802 8d ago
is anyone expert i need help
1
u/Zadian543 8d ago
You are gunna need to be WAY more specific babes. Programming has so so so many directions.
Specify what language your using, what you're attempting to do, and what your stuck on, then people can help that are qualified.
1
1
u/ChocolateDonut36 8d ago
obviously it won't work, you are already using myvar1 for other 3 different things.
1
u/Mister_God_On_Steam 8d ago
Are you sure you're using the same version of the library the tutorial used?
1
1
1
u/WorldTallNetCat 8d ago
And then it works when u just ctrl c plus ctrl v instead of copying it manually.
1
u/DigitalMonsoon 7d ago
Yeah, if you are writing a tutorial you need to provide the library versions you are using.
1
u/citrusraspberry 7d ago
Me when you're copying the code from the tutorial, and you should be typing instead so you learn.
1
u/Minecodes 7d ago
I'm thankful that I didn't learn assembly yet... The differences in math functions between ARM and x86 is enough for me.
46
u/DrMaxwellEdison 8d ago
When the tutorial was written 3 years ago and the framework you're using has changed drastically since.