how to assign first img linked on a node to image field
I would write a module that read the field_data_body table in database. This table contains a field called body_value where the values are stored. If the module find a  mark, you can get the "src" attributte. 

You don't forget to make a comparison in field_revision_body table to avoid problems.

Once you have the path of the file, you must save it as managed file in database. For this, take a look to "file.inc".

Here a little summary for last changes in D7. 

I think it's important that you understand the difference between managed files and unmanaged files. Once you have saved the file, you could load the node, and assign to the field_image field, then node_save().