How can I customize wp_footer, where is the code that controls what this function does?

This could be multiple things. I’m not sure what the credits do. However, the chance is quite big that the search field is being created by a widget, shown in the get_sidebar('main'). Under “Appearance” > “Widgets”, you should be able to find more information.

The template being called is probably sidebar-main.php.

If it is a specific plugin creating the output into the wp_footer() (which I think is unlikely), you could probably find it with add_action('wp_footer', 'the_function');, “the_function” being the function called.

This specific action hooks a function into the wp_footer().

wp_footer is mainly used to load javascripts and other necessities, but not so much to add extra content.

I hope this clears things up for you a bit. In case it didn’t, I’d be glad to clarify as much as possible.