xyaz
xyaz

Reputation: 147

Win32Exception (0x80004005) When Looping Through Process Modules

Yesterday this exception started to occurr and I have no idea why it is happening. If I change p[0] to p[1] it stops the error, but it doesn't get client.dll. Screenshot of error.

            Process[] p = Process.GetProcessesByName(Offsets.pro);

             if (p.Length > 0)
            {
                foreach (ProcessModule m in p[0].Modules)
                {
                    if (m.ModuleName == "client.dll")
                    {
                        Offsets.bClient = (int)m.BaseAddress;
                        return true;
                    }
                }
                return true;
            }
            else
            {
                return false;
            }
        }
        catch (Exception e)
        {
            MessageBox.Show("Erro: " + e);
            return false;
        }
    }

Upvotes: 1

Views: 204

Answers (1)

xyaz
xyaz

Reputation: 147

I resolved it restarting my pc apparently the vs was bugged XD.

Upvotes: 1

Related Questions