Esempio n. 1
0
        public MZ_EXE(string file)
        {
            code = Kernel.fs.readFile(file);

            fixed(byte *ptr = code)
            {
                header  = (MZ_Header *)ptr;
                rel_ptr = (byte *)((uint)ptr + (uint)header->RelocationTab);
            }

            for (int i = 0; i < header->RelocationItems; i++)
            {
                RelocationStruct *rs = (RelocationStruct *)(i * 8);
                RelocationInfo    ri = new RelocationInfo();
                ri.Offest  = rs->Offest;
                ri.Segment = rs->Segment;
                symbolsToRelocate.Add(ri);
            }
        }
Esempio n. 2
0
        public MZ_EXE(string file)
        {
            code = Kernel.fs.readFile(file);

            fixed (byte* ptr = code)
            {
                header = (MZ_Header*)ptr;
                rel_ptr = (byte*)((uint)ptr + (uint)header->RelocationTab);
            }
            for (int i = 0; i < header->RelocationItems; i++)
            {
                RelocationStruct* rs = (RelocationStruct*)(i * 8);
                RelocationInfo ri = new RelocationInfo();
                ri.Offest = rs->Offest;
                ri.Segment = rs->Segment;
                symbolsToRelocate.Add(ri);
            }
        }