Esempio n. 1
0
        static void Main(string[] args)
        {
            var petool = new PETool();

            petool.Read(@"d:\hawkaoc\aoc\language.dll");
            petool.Layout();
            petool.WriteFile(@"d:\hawkaoc\aoc\`language.dll");
            Console.ReadKey();
        }
Esempio n. 2
0
        void patch_exes_for_large_address_support()
        {
            List <string> files_to_patch = new List <string> {
                "h2tool", "h2sapien"
            };
            PETool pe = new PETool();

            foreach (string file in files_to_patch)
            {
                if (!File.Exists(H2Ek_install_path + file + ".large_address.exe") && File.Exists(H2Ek_install_path + file + ".exe"))
                {
                    pe.Read(H2Ek_install_path + file + ".exe");
                    pe.fileHeader.Characteristics |= PECharacteristics.IMAGE_FILE_LARGE_ADDRESS_AWARE;
                    pe.UpdateHeader();
                    pe.WriteFile(H2Ek_install_path + file + ".large_address.exe");
                }
            }
        }