Friday, January 14, 2011

[MIPS/C] Tiny little search function

I thought I would share this, since I'm sure someone else might be able to use it. Some1 asked me to write a function to search for a string and return its location, in order to find functions in a PSP VSH exploit. The function is simple enough, it searches for the first letter of your null-terminated string, and once it does, loops through the string to test if the next characters are the same, if not, it goes back and looks for the first character again. It returns 0 if nothing was found.