Unfortunately, if you are already out of status and unlawfully present in the US, you are not eligible to adjust status within the US if you are selected in the diversity visa lottery.  Once you are out of status for more than 1 year, if you leave the US to consular process, you will be subject to an automatic 10 year bar to reentry.  The only way you can adjust status within the US once you are out of status and unlawfully present is through a bona fide marriage to a US citizen.