static void InstallCreateFileHooks() { if (Managed) { return; } dGetFileAttrA = new GetFileAttributesADelegate(GetFileAttributes); dGetFileAttrW = new GetFileAttributesWDelegate(GetFileAttributes); dGetFileAttrExA = new GetFileAttributesExADelegate(GetFileAttributesEx); dGetFileAttrExW = new GetFileAttributesExWDelegate(GetFileAttributesEx); dCreateFileA = new CreateFileADelegate(CreateFile); dCreateFileW = new CreateFileWDelegate(CreateFile); hCreateFileA = AutoHookCreator("kernel32.dll", "CreateFileA", dCreateFileA); hCreateFileW = AutoHookCreator("kernel32.dll", "CreateFileW", dCreateFileW); hGetFileAttrA = AutoHookCreator("kernel32.dll", "GetFileAttributesA", dGetFileAttrA); hGetFileAttrW = AutoHookCreator("kernel32.dll", "GetFileAttributesW", dGetFileAttrW); hGetFileAttrExA = AutoHookCreator("kernel32.dll", "GetFileAttributesExA", dGetFileAttrExA); hGetFileAttrExW = AutoHookCreator("kernel32.dll", "GetFileAttributesExW", dGetFileAttrExW); hCreateFileA.Install(); hCreateFileW.Install(); hGetFileAttrA.Install(); hGetFileAttrW.Install(); hGetFileAttrExA.Install(); hGetFileAttrExW.Install(); Base = BaseDir.TrimEnd('\\', '/'); if (Base == AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\', '/')) { Base += "\\Patch"; } Base += '\\'; Log("CreateFile Hook Path: {0}", true, Base); }