• What are you working on? v15
    5,001 replies, posted
[QUOTE=nekosune;27958295]Fixed a bug in a browser game for a friend, as it stands, 90% of any browser game based on Legend of the Green Dragon, is open to a major XSS bug that would let someone gain admin easilly.[/QUOTE] Please, elaborate.
[QUOTE=q3k;27960902]I do glBindVertexArray -> (glBindBuffer -> glEnableVertexAttribArray -> glBufferData -> glVertexAttribPointer) x n -> glBindBuffer -> glBufferData when creating vertex data (where n is the numbver of attributes you want in your shader, then another buffer for the index buffer. Then, when drawing, just bind to the Vertex Array again and call glDrawElements. I may not be using the best way, though.[/QUOTE] Thank you, doing that now. Finally I can draw my triangle, still problem tho. The matrix is weird :O [url]http://gyazo.com/b8cad1a56ba4d015787d21314a92e860.png[/url] again, if I set 0 instead of WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB it's working: [url]http://gyazo.com/19faf2c8982cde445b0ceba186554772.png[/url]
[QUOTE=Xeon06;27961794]Please, elaborate.[/QUOTE] For obvious reasons I will not go into too much detail, but they left a major part open to XSS, so could post javascript that would steal cookies, I then find an admin's session cookie, use that I am logged in as the admin, set my character to an admin for future access, then I have full control Especially since the control panel has a PHP/SQL runner. As I said i was fixing this problem after finding it. But so far the beta of the new version has fixed it, but no one is moving to that yet.
I spent some time typing up a Brainfuck interpreter in Python. After a lot of struggling with the loops, I finally got the to work, and the interpreter is 100% functional and it's in merely 85 lines of code. It may not be much, but still :smile:
[QUOTE=Jookia;27960740]Oh, also, not meaning to derail the thread to why Soda's parents allow him to use the Internet, but: [img_thumb]http://i51.tinypic.com/33xelg9.png[/img_thumb][/QUOTE] shut the fuck up. [highlight](User was banned for this post ("Rude" - Craptasket))[/highlight]
I think I solved my problem. I'm using gluPerspective and it's deprecated, right?
too many projects/test/homework assignments... don't have time to do any coding, and our next deadline is the 16th, exactly a week from now... oh yeah and I have a Comp Sci project due on Friday, a text-based game of Battleship. meh
[QUOTE=nekosune;27961990]For obvious reasons I will not go into too much detail, but they left a major part open to XSS, so could post javascript that would steal cookies, I then find an admin's session cookie, use that I am logged in as the admin, set my character to an admin for future access, then I have full control Especially since the control panel has a PHP/SQL runner. As I said i was fixing this problem after finding it. But so far the beta of the new version has fixed it, but no one is moving to that yet.[/QUOTE] This might seem dumb, but that means he was storing credentials in client-side cookies instead of server sessions?
[media]http://gyazo.com/43256fbd28e76cf800631c8f0057563f.png[/media] What did I do wrong? :saddowns:
[QUOTE=G71tc4;27964481]-snip- What did I do wrong? :saddowns:[/QUOTE] First of all, the code in your editor looks like C++; I'm not sure if Code::Blocks tries to use a C compiler since the file extension is .c. Secondly, you have to include windows.h to use system("pause") if I remember correctly.
[QUOTE=G71tc4;27964481][media]http://gyazo.com/43256fbd28e76cf800631c8f0057563f.png[/media] What did I do wrong? :saddowns:[/QUOTE] nice theme (i'm being sarcastic it's actually horrible)
[QUOTE=calzoneman;27964549]First of all, the code in your editor looks like C++; I'm not sure if Code::Blocks tries to use a C compiler since the file extension is .c. Secondly, you have to include windows.h to use system("pause") if I remember correctly.[/QUOTE] [media]http://gyazo.com/1e13465dea7691d237ef5c94d3a5b7f0.png[/media] You are my friend :buddy: I was an idiot and didn't pay attention to the file extension, went back and resaved it and added windows.h, and it worked! [editline]10th February 2011[/editline] [QUOTE=deloc;27964576]nice theme (i'm being sarcastic it's actually horrible)[/QUOTE] Nice post (i'm being sarcastic it was actually pointless) Also, posting in all lowercase and trying to be BHB isn't working for you
[QUOTE=Xeon06;27964419]This might seem dumb, but that means he was storing credentials in client-side cookies instead of server sessions?[/QUOTE] No was storing credientals in the session, however a session is identified through a cookie: [url]http://www.php.net/manual/en/session.idpassing.php[/url] if you can steal and use that cookie, you can steal the session, and use the credientials of that session. [editline]10th February 2011[/editline] Oh and this was not a bug with my friend's code, but a bug in all LoGD based browser games that have not manually patched it, or upgraded to the beta.
[QUOTE=DevBug;27168189]Anyone know of a Motorola 6800 assembler? Edit: Can't find a standalone assembler that's open source. So: [url]http://docs.google.com/viewer?a=v&q=cache:A-rfkZ-QKloJ:bytecollector.com/archive/digital_group/documentation/hardware/dg_systems/system_cards/6800_cpu_card/6800_Instruction_Set.PDF+motorola+6800+instruction+set&hl=en&gl=ca&pid=bl&srcid=ADGEESh9x1bYI4BEBS5c9OFYHq9R-6GsYx4x5PHyILmbh3MtvKIMSNzhYFcQKzoEj1W3Dbg5hjw2eIFv4-0lrmLUChY30xlkY6CccgCX7kGUcH5Xpwu_ozpBEl-p50FeAmT2GlLWIwd9&sig=AHIEtbSUSHPqeNz_mmJwyv-oTkCbtFRgOA[/url][/QUOTE] (late) I love the opcode "!HCF!", "Halt and Catch Fire"
[QUOTE=G71tc4;27964594]Also, posting in all lowercase and trying to be BHB isn't working for you[/QUOTE] :frog:
[QUOTE=deloc;27964576]nice theme (i'm being sarcastic it's actually horrible)[/QUOTE] What the hell is your problem?
[cpp]#include <iostream> #include <windows.h> #include <cmath> void myfunc(int); int main() { using namespace std; myfunc(42); system("pause"); return 0; } void myfunc(int x) { using namespace std; cout << "My favorite number is " << x << endl; } [/cpp] Today, I decide my favorite number. Tomorrow, [b]the world.[/b]
[QUOTE=likesoursugar;27962642]I think I solved my problem. I'm using gluPerspective and it's deprecated, right?[/QUOTE] Yep. You got to use your own matrix stuff. With OpenGL you pretty much have to start by thinking everything you do is deprecated. Then it's only happy fun time when you realize something actually isn't :P
[QUOTE=Darwin226;27966759]Yep. You got to use your own matrix stuff. With OpenGL you pretty much have to start by thinking everything you do is deprecated. Then it's only happy fun time when you realize something actually isn't :P[/QUOTE] I need to use shaders to translate and rotate the matrices, right? Then I'll have alot to do, alot of fun :)
That's not really recommended since then you'll be recalculating the matrices per vertex. You should calculate the matrices per mesh and then just pass them to the shader where you multiply them with the vertex coordinate.
[QUOTE=Darwin226;27966959]That's not really recommended since then you'll be recalculating the matrices per vertex. You should calculate the matrices per mesh and then just pass them to the shader where you multiply them with the vertex coordinate.[/QUOTE] That's what I said :O Nvm, understand what you mean. Thanks. This will probably help me alot [url]http://www.swiftless.com/tutorials/opengl4/3-opengl-4-matrices.html[/url]
[QUOTE=likesoursugar;27966930]I need to [b]use shaders to translate and rotate the matrices[/b], right? Then I'll have alot to do, alot of fun :)[/QUOTE] Nope. :) You translate and rotate the matrices, as you say, outside of the shader. Unless you meant translate and rotate the vertices. Then yes.
[QUOTE=Darwin226;27967234]Nope. :) You translate and rotate the matrices, as you say, outside of the shader. Unless you meant translate and rotate the vertices. Then yes.[/QUOTE] Ok :] Just another question. Will it be hard to use more than 1 shader for 2 objects? I mean, I'll need to send the view matrix to both my shaders?
[QUOTE=bootv2;27967708]why don't you put "using namespace std;" just below the #include lines, this way it will use that namespace in all functuins and you don't have to write it every time.[/QUOTE] The way he is doing it is actually nicer for larger programs because it doesn't clutter the global namespace with everything in std, just the functions local namespace. For a simple program though there's no reason why you should really worry about it.
[QUOTE=likesoursugar;27967567]Ok :] Just another question. Will it be hard to use more than 1 shader for 2 objects? I mean, I'll need to send the view matrix to both my shaders?[/QUOTE] First you compile your vertex and fragment shaders (glCreateShader, glShaderSource, glCompileShader). Then, you create a program, attach the two shaders to it (glCreateProgram, glAttachShader). Then you bind your attribute locations (glBindAttribLocation), and link your program (glLinkProgram). Now, when you want to draw some triangles, just glUseProgram your program then set your program's uniforms for that mesh (glGetUniformLocation & glUniform). Every vertices that will be drawn will be using this shader with these uniforms. If you want to change the uniforms, well, issue more glUniform calls. If you want to change the shader program, just call glUseProgram again. Uniforms are being sent to all the shaders in the program, and are accessible via the uniform keyword. If you want to use the same matrix in different shaders, just call glUniformMatrix4fv again for your second shader, right after you glUseProgram it.
[QUOTE=q3k;27967857]First you compile your vertex and fragment shaders (glCreateShader, glShaderSource, glCompileShader). Then, you create a program, attach the two shaders to it (glCreateProgram, glAttachShader). Then you bind your attribute locations (glBindAttribLocation), and link your program (glLinkProgram). Now, when you want to draw some triangles, just glUseProgram your program then set your program's uniforms for that mesh (glGetUniformLocation & glUniform). Every vertices that will be drawn will be using this shader with these uniforms. If you want to change the uniforms, well, issue more glUniform calls. If you want to change the shader program, just call glUseProgram again. Uniforms are being sent to all the shaders in the program, and are accessible via the uniform keyword. If you want to use the same matrix in different shaders, just call glUniformMatrix4fv again for your second shader, right after you glUseProgram it.[/QUOTE] Then I probably should write a shader class, so I can add pointers to all the "local" matrices such as the view matrix to the shader class when I initialize the class, I'm right?
[QUOTE=likesoursugar;27968487]Then I probably should write a shader class, so I can add pointers to all the "local" matrices such as the view matrix to the shader class when I initialize the class, I'm right?[/QUOTE] I actually split it into two classes: a [url=https://github.com/SergeB/Rhubarb/blob/master/Rhubarb/Shaders/CShaderBase.cpp]shader base[/url] (with sample [url=https://github.com/SergeB/Rhubarb/blob/master/Rhubarb/Shaders/CFlatShader.cpp]implementation[/url]), and a [url=https://github.com/SergeB/Rhubarb/blob/master/Rhubarb/Helpers/CMatrixManager.cpp]"matrix manager"[/url] to which I push view and model matrices and set a projection matrix. When I ->Use a shader, I pass it the result from that class
Thank you alot for the source code! I'll post some content of my progress with shaders when it's working
[QUOTE=JenkinsJ;27952739]I'm not sure it's been proven to work at all. I mean let's just say a certain frequency has an affect on the brain, it still wouldn't be magic. I see a lot of people say it will help you quit smoking or whatever, but I call bullshit. In fact I quit smoking on Wednesday despite [u]actual[/u] chemicals affecting my brain telling me to smoke loads and loads because it's ace. I think the most effect, if [i]any[/i] would be the same kind of effect warm milk has when you drink it. Warm milk (not cold milk) makes the brain release serotonin, which makes you sleepy - that definitely happens, and yet, I could go get some warm milk now and still be awake later, because I can decide to not go to sleep, serotonin released or not. So even if this binaural sounds did work, the effect wouldn't be of much use. Although I'm not saying you can ignore anaesthetics or chemicals that numb you at the dentist, or drugs that cause different chemicals to release, that's different. Sorry for the off-topiccy-ness but to answer your question about the time max delay between ears - I'm not sure that's relevant - the 'beat' in binaural beats is sort of imagined by the brain if I remember right (I probably don't) because of the difference in frequencies.[/QUOTE] Thanks! I did some tests in audacity and found out that I didn't hear an echo effect when I offset one of the R/L channels to <~40ms. EDIT: From what direction does this sound come from? [url]http://anyhub.net/file/1MBM-c-users-michael-desktop-audio_test.wav[/url]
[QUOTE=G71tc4;27965110][cpp]#include <iostream> #include <windows.h> #include <cmath> void myfunc(int); int main() { using namespace std; myfunc(42); system("pause"); return 0; } void myfunc(int x) { using namespace std; cout << "My favorite number is " << x << endl; } [/cpp] Today, I decide my favorite number. Tomorrow, [b]the world.[/b][/QUOTE] I reject your reality and substitute my own! [img]http://dl.dropbox.com/u/11782997/irejectyourreality.png[/img] Behind the scenes: [img]http://dl.dropbox.com/u/11782997/irejectyourreality_behindthescenes.png[/img] Oh god, I'm bored.
Sorry, you need to Log In to post a reply to this thread.