User Profile

Collapse

Profile Sidebar

Collapse
unauthorized
unauthorized
Last Activity: Dec 28 '09, 09:47 PM
Joined: May 2 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • unauthorized
    replied to How to expose API from executable?
    in C
    This is OS dependant. Seeing how you talk about "exe" application, I will go ahead and assume you work under Windows.
    To expose a function to be imported in 3rd party libraries, you need:
    - a DLL which contains the API functions you wish to expose. All objects/functions that need to be accessed from outside the DLL must be declared with __declspec (dllexport) (for Visual Studio, different compilers may work differently) ....
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to IP address of host...
    in C
    There is a pretty standard way to do it through. getaddrinfo() in the berkley sockets API can get you the IP. Not ANSI C, but it works on Windows, 'nix, Mac and I bet a lot more systems.
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to Defining a 1-D array of 2-D Arrays in C
    in C
    So basically, you want to do something like this:

    Code:
    #define MATRIX_SIZE_X 3 // let's try a 3x3 matrix
    #define MATRIX_SIZE_Y 3
    const int stack_size = 100;
    
    typedef double[MATRIX_SIZE_X][MATRIX_SIZE_y] Matrix;
    
    typedef struct {
         Matrix[stack_size] data;
         int stack_pos = 0;
    } Stack;
    
    void push(Stack& s, Matrix& m)
    {
        // todo: check
    ...
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to Pointer to Member Function
    in C
    If you don't mind passing around an extra pointer, you can also declare a static method with the first parameter being a pointer or reference to your class. A static member still can access private data through a pointer/reference to it's class but the syntax is a little ugly. It goes like this:

    Code:
    class my_class {
    public:
         static int my_method(my_class* pthis)
         {
              return pthis->my_var;
    ...
    See more | Go to post

    Leave a comment:


  • ... somebody shoot me.

    'nyway, you only need to explore the documentation of your mail server and see what parameters need to be passed to achieve whatever you want. Assuming you use 'nix, all you need to do is type "man <name-of-your-mail-client>". On Windows, you need to figgure out which command line switch is used for usage info (typically /?, -h, help or --help) or dig up the documentation of your mail client....
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to AJAX Error
    Do this in your browser:
    containerid?
    Shouldn't that be "document.conta inerid"?
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to Should i learn Objective C or C++?
    in C
    C++ is a free form language hybrid between OO, procedural and some elements of generic templatization. In a sense, C++ can be 100% OO if you want it to, through there are few merits to this. The only procedure you ever need to create is a main(), and even that's possible to avoid if your linker supports defining alternative entry point.
    All in all, it's a language designed to balance between power and performance, but execution speed is definitely...
    See more | Go to post

    Leave a comment:


  • Sounds like a logical thing to do. I guess this is one new thing I learned today :)


    You've never heard of that shock site? Do you really live on the same internet as me? Anyway, it's something that can kill gandma's so don't go looking into it unless extremely gross things don't bother you.


    This is a very basic example. However, I remember reading at least one doc that described how this technique can...
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to Going through a node and it's children
    in C
    I'm well aware that JosAH is a moderator. My point was not about the board rule (which I was unaware of until now), but rather expressing my dissatisfaction with handing people code just like this.

    Cheer up, I'm not criticizing him. ;) He did what he thinks was right, and I gave my opinion on the matter. I'm not the one to shy from speaking my mind out with people in power. Don't think for a second that I give a damn about that little...
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to Going through a node and it's children
    in C
    It's a tree, because he is using a vector of instances, rather than pointers.
    It would be a graph if he had a vector<Node*>, but not with vector<Node>. Got me fooled at first too.

    BTW, don't write someone's hw for him!
    See more | Go to post

    Leave a comment:


  • I just wrote a very long post, just to be greeted with the "please login" page... *Goes emo*.

    ...

    *Ahem*, anyway...


    There is no trusted data. For example:

    Code:
    // insert some escaped data into a table
    
    $res = $mysqli->queue("SELECT somefld FROM table1 WHERE id=$hacker_id");
    // insert error handling
    $obj = $mysqli->fetch_object();
    ...
    See more | Go to post

    Leave a comment:


  • So basically, you want us to shoot bulls eye when blind folded and not in line of sight of our target?

    Hmm, let's see...
    1. Are you filtering data that comes from "trusted" sources such as your own DB?
    2. Have you disabled the exec SSI?
    3. Are you filtering the gender and any other dropbox/radiobtn fields?
    4. Have you removed write permissions outside /tmp?
    5. Have you set up your scripts to handle...
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to Going through a node and it's children
    in C
    I suppose you could make a loop out of it, but you would have to manually allocate from the heap and keep track on which memory belongs to which tree leaf... believe me, it gets ugly. The only reason you would want to go this route is if you keep running out of stack space due to recursion overload and increasing the stack size is not an option....
    See more | Go to post

    Leave a comment:


  • Why bruteforce when you can just use one of the freely available rainbow tables on the net and "crack" stuff in seconds?...
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to Going through a node and it's children
    in C
    Going through data structures that can fork to (theoretical) infinity is best done with recursion for a number of reasons, the simplest being we aren't in the 80s where the performance loss of a few extra function calls is a big deal. And if you are doing something where performance actually does matter, you should already know your algorithms inside out and certainly not ask here.

    Seeing as you use C++ containers, my advise is to...
    See more | Go to post

    Leave a comment:


  • You need some kind of database to store taken addresses. I don't see what's the problem....
    See more | Go to post

    Leave a comment:


  • That's called "hashing". Encryption is always reversible e.g. encrypted text can be decrypted if you have the right key(s).

    Ontopic, I would avoid md5() which is very outdated and easy to crack if I were you. If you want secure passwords, the best way would be to use some very resilient hashing algorithm (RipeMD is a great choice) with 6+ character salt. Encryption is slightly more problematic since the attacker only has...
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to Actionscript 3 with PHP
    Whenever you make a PHP API for something, you should always craft manual requests and ensure the script itself is responding as expected. My guess is that your problem comes from server side. Do a few trace() calls and check the contents of the page you receive. If that doesn't help you, then get friendly with telnet or one of those fancy request crafting addons for FFox.
    See more | Go to post

    Leave a comment:


  • The PHP's OpenSSL interface has everything you may ever want from encryption/decryption/hashing and even an awsome RNG.

    See php.net/openssl
    See more | Go to post

    Leave a comment:


  • unauthorized
    replied to INI file reading in C
    in C
    You can use the C standard library function fopen() (stdio.h) and phrase the file yourself, or you could look up some configuration management library.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...