Aboutcurrently stuck on personal projects that never really get finished.
Skillsc and c++, there is a difference. löve for power and lots, lots of freedom
Joined devRant on 3/11/2018
Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
so the other day i was programming and suddenly i wanted to learn haskell. (i don't know why it hit me so suddenly, maybe because it's a 'pure' functional programming language and these 2 terms i knew nothing about)
and to be honest it's really hard coming from an imperative programming language (C/C++, yes, i know they are different in their ways). it's like learning to program again! you really have to get a different mindset and for me honestly it's hard to grasp the idea that 'variables' are immutable! like, that's soooo weird it still stucks to me. for example how did they define the max or min function without using a while loop? what are monads?
I am just 2 days in but it'll be a fun ride!6
i just want to shoot my both hands, eyes and legs.
NO I DID NOT MEAN __d_dirname!!!!
I MEANT dd_name!!
NOT d_name, but dd_name!!
i swear to god the other times it worked. WHAT THE FUCK IS WRONG? I SPENT 3 FUCKING HOURS DEBUGGING THIS SHIT!
yes i have included sys/types.h, dirent.h AND sys/stat.h AND I CAN'T DO THIS ANYMORE!!
why did you worked last time? i just wanted to implement a better library than handling all the known and unknown errors myself.
if anyone knows what is wrong, please help me, i am disperate.19
just found out a vulnerability in the website of the 3rd best high school in my country.
TL;DR: they had burried in some folders a c99 shell.
i am a begginer html/sql/php guy and really was looking into learning a bit here and there about them because i really like problem solving and found out ctfs mainly focus on this part of programming. i am a c++ programmer which does school contest like programming problems and i really enjoy them.
now back on topic.
with this urge to learn more web programming i said to myself what other method to learn better than real life sites! so i did just that. i first checked my school site. right click. inspect element. it seemed the site was made with wordpress. after looking more into the html code for the site i concluded all the images and files i could see on the site were from a folder on the server named 'wp-content/uploads'. i checked the folder. and here it got interesting. i did a get request on the site. saw the details. then i checked the site. bingo! there are 3 folders named '2017', '2018', '2019'. i said to myself: 'i am god.'
i could literally see all the announcements they have made from 2017-2019. and they were organised by month!!! my curiosity to see everything got me to the final destination.
with this adrenaline i thought about another site. in my city i have the 3rd most acclaimed high school in the country. what about checking their security?
so i typed the web address. looked around. again, right click, inspect element and looked around the source code. this time i was more lucky. this site is handmade!!! i was soooo happy because with my school's site i was restricted with what they have made with wordpress and i don't have much experience with it.
amd so i began looking what request the site made for the logos and other links. it seemed all the other links on the site were with this format: www.site.com/index.php?home. and i was very confused and still am. is this referencing some part of the site in the index.php file? is the whole site written inside the index.php file and with the question mark you just get to a part of the site? i don't really get it.
so nothing interesting inside the networking tab, just some stylesheets for the site's design i guess. i switched to the debugger tab and holy moly!! yes, it had that tree structure. very familiar. just like a project inside codeblocks or something familiar with it. and then it clicked me. there was the index.php file! and there was another folder from which i've seen nothing from the network tab. i finally got a lead!! i returned in the network tab, did a request to see the spgm folder and boooom a site appeared and i saw some files and folders from 2016. there was a spgm.js file and a spgm.php file. there was a contrib, flavors, gal and lang folders. then it once again clicked me! the lang folder was las updated this year in february. so i checked the folder and there were some files named lang with the extension named after their language and these files were last updated in 2016 so i left them alone. but there was this little snitch, this little 650K file named after the name of the school's site with the extension '.php' aaaaand it was last modified this year!!!! i was so excited! i thought i found a secret and different design of the site or something completely else! i clicked it and at first i was scared there was this black/red theme going on my screen and something was a little odd. there were no school announcements or event, nononoooo. this was still a tree structured view. at the top of the site it's written '!c99Shell v. 1.0...'
this was a big nono. i saw i could acces all kinds of folders. then i switched to the normal school website and tried to access a folder i have seen named userfiles and got a 403 forbidden error. wopsie. i then switched to the c99 shell website and tried to access the userfiles folder and my boy showed all of its contents. it was nakeeed naked. like very naked. and in the userfiles folder there were all, but i mean ALL files and folders they have on the server. there were a file with the salary of each job available in the school. some announcements. there was a list with all the students which failed classes. there were folders for contests they held. it was an absolute mess and i couldn't believe it.
i stopped and looked at the monitor. what have i done? just to learn some web programming i just leaked the server of the 3rd most famous high school in my country. image a black hat which would have seriously caused more damage. currently i am writing an email to the school to updrage their security because it is reaaaaly bad.
and the journy didn't end here. i 'hacked' the site 2 days ago and just now i thought about writing an email to the school. after i found i could access the WHOLE server i searched for the real attacker so if you want to knkw how this one went let me know in the comments.
sorry for the long post, but couldn't held it anymore12
so recently i have been through memory management hell. maybe i should rethink about pointers and stuff.
long story short: i have done a calendar app using SDL2 and the program is written in C++. when rendering textures using fonts i referenced null pointers to the font.
i will implement events in the future and if you have any suggestions or some advice leave it in the comments, the feedback helps me a lot!
anyways you might give it a try (i am sorry about the makefile not working, i built the app on windows and needed to link against the folder where sdl is located): https://github.com/zetef/calviewer3
TL;DR: a dude thinks good graphics make a game good.
so every day when the school ends, me, a dude and another girl walk home. as expected we have lots of time to talk about anything. I wanted that day to tell that dude about what I am going to buy on steam summer sales with just 15$.
me: I am going for this summer to play lots of games so I saved some money for this summer sale. do you want to hear what awesome games I am about to buy with just 15$?
dude: yeah, sure thing.
he wasn't expecting much
M: this summer I am going to buy 5 games and maybe keep more for some others. they are so awesome!
D: ok, let's hear those 'awesome' games!
M: the first game is devil daggers, maybe you don't kno...
D: of course I do. is that game
M: I want to get that game just to improve my aim, but maybe I will have some fun.
D: yeah yeah, I know that game
M: *poker face*
I KNEW he doesn't know this game and anything about pc games because of the followings...
M: ok then... I also want to get Half-Life 2 : Episode 1 & 2. they have pretty rich story and I already have both Half-Lives.
D: holy shit but the graphics... ok, one more 'awesome' game of yours.
M: there are 2 episodes, 2 separate games. I really don't care about the graphics, I love the story.
D: continue with your 'awesom' games...
that dude didn't even knew about half-life and said that game is bad.
M: another game I want to get is Battlefront 2, the one from 2005 and...
M: yeah, the new one sucks, and the gameplay in the original is way better and...
D: *starts laughing* 2005!? I thought you were getting the new one. I imagine the graphics being like this car. *points to a fucking car, yeah that kind of comparasion, I know*
after this I was so fucking pissed off. he doesn't even know about some cult classics that are meant to be played. he doesn't even have a pc nor console and he is stating his opinion on fine air for fucks sake!
M: ok, what about getting the facts and then make an opinon.
D: yeah yeah *making fun of me at that point*
I didn't tell him that I wanted to buy the binding of isaac, cause it was enough for me. I told him to watch some reviews on these games and blog posts about them and I am sure tomorrow he will say that he 'wathced' the reviews and that those games are garbage. it's his style to underestimate things. I fucking hate him, not becuase of the games, but because he underestimates everything that is not on his list of 'good games'. that list consists of new games with great graphics(3D only).
sorry if I exaggerate saying that those games are cult classics but I really look forward into buying them.
if you have another indie game to run on this potato machine(2gb ram, pentium dual-core 2.1ghz, gtx 525m) that I should or at least try comment, I am open to suggestions!11
so I started a side project a while ago.
the only thing it could do was to create some files with desired names and extensions. so this was basically a pretty simple editor.
I left this project with no future plans for a month or so until I started working on it again this week. I added comments to the editor, a console user interface.
the ui isn't futuristic. the program runs in the console. it just lists all the files and folders where the program is currently located in. in the beginning it could take user input and that input was the location where the files created in the editor would be saved. then I thought: it would be more interesting if I created a folder in which I saved the files from the editor. so I did this thing.
then I thought, again: hey, this console is pretty boring and stuff. why should I add some special commands? and so I did.
now you can create an empty folder, before you created a folder and saved at the same time the files created in the editor. now you can open another folder in which you can do the same stuff as before. you can get the current location of the folder you are currently in, so you don't get lost in your fancy computer. you can delete a folder completely, set color, reset color.
but one thing that I lost almost ONE FREAKING HOUR ON IT TO MAKE THE USER EXPERIENCE BETTER was the following: when creating a folder, either empty or with the files from the editor, the program automatically opens the folder, not in the console(hey, I didn't thought of that) but in the file explorer from the os. now it only works for windows and windows explorer because I used system(const char*). I know it's not portable or efficient but I just wanted things to work, I will optimise it later.
the thing that made me lose that one hour debugging was figuring out how to open that file.
ok, so I used windows api with GetCurrentDirectory, I knew how to use system, I knew how to form the path that would match up with the folder, I almost knew how to open the folder with system().
the problem was that I had the path complete, but if the folder had white spaces system() wouldn't recognise the freaking command!
so the string with the path would also contain the command used in system() and I would just .c_str() the string so it could work. as an example my wrong way to make the path was this:
can you figure out what is the problem?
it's just so trivial.
how cannot you figure it out?
of course you NEED to put "explorer" between the start command and the actual path!
pffft, you idiot! so easy to figure it out.
so yeah, the right way to open a folder is like this:
"start explorer C:\\path to heLL!!"
p.s.: I still don't understand why putting explorer works and without it doesn't. without explorer it just just says that path with the first word before the white space doesn't exist.