Original Post
I picked this up from an old programming test found on the web. I understand what it does, as in I can explain in words what happens, but why and where would you use something like this?
What does this code block do?
{
u_int *source, *end;
u_int addr_printf, addr_scePrintf;
int counter = 0;
addr_printf = ((u_int) printf & 0xFFFFFF) / 4;
addr_scePrintf = ((u_int) scePrintf & 0xFFFFFF) / 4;
source = (u_int *) sceGsSyncPath;
end = source + 195;
while (source < end)
{
if ((*source & 0xFF000000) == 0x0C000000)
{
// Function call...
if ((*source & 0xFFFFFF) == addr_printf)
{
*source = 0x0C000000 | addr_scePrintf;
counter++;
}
}
source++;
}
}