Reko.Environments.Windows.Win32Emulator.LoadLibraryA C# (CSharp) Method

LoadLibraryA() private method

private LoadLibraryA ( IProcessorEmulator emulator ) : void
emulator IProcessorEmulator
return void
        void LoadLibraryA(IProcessorEmulator emulator)
        {
            // M[Esp] is return address.
            // M[Esp + 4] is pointer to DLL name.
            uint esp = (uint)emulator.ReadRegister(Registers.esp);
            uint pstrLibName = ReadLeUInt32(esp + 4u);
            string szLibName = ReadMbString(pstrLibName);
            Module module = EnsureModule(szLibName);
            emulator.WriteRegister(Registers.eax, module.Handle);

            // Clean up the stack.
            emulator.WriteRegister(Registers.esp, esp + 8);
        }