diff --git a/BrainLILO.cpp b/BrainLILO.cpp index 617f9ea..a598313 100644 --- a/BrainLILO.cpp +++ b/BrainLILO.cpp @@ -126,10 +126,32 @@ static void loadDriverIfNeeded(){ HANDLE driver=NULL; wchar_t driverPath[1024]; - getThisDllDirectoryPath(driverPath); - wcscat(driverPath, L"\\BrainLILODrv.dll"); + + getThisDllDirectoryPath(driverPath); + wcscat(driverPath, L"\\MyJITDebugger.exe"); TCHAR newDriverPath[128]; + wcscpy(newDriverPath,L"\\Windows\\MyJITDebugger.exe"); + + { + wchar_t buf[1024]; + swprintf(buf, L"BrainLILO: copying \"%ls\" to \"%ls\"", + driverPath, newDriverPath); + OutputDebugString(buf); + } + + if(!CopyFile(driverPath,newDriverPath, FALSE)){ + + + if(GetFileAttributes(newDriverPath)==(DWORD)-1){ + OutputDebugString(L"BrainLILO: failed to copy"); + return; + } + + } + + getThisDllDirectoryPath(driverPath); + wcscat(driverPath, L"\\BrainLILODrv.dll"); wcscpy(newDriverPath,L"\\Windows\\BrainLILODrv.dll"); { diff --git a/BrainLILODrv.cpp b/BrainLILODrv.cpp index d2d49b6..522e73a 100644 --- a/BrainLILODrv.cpp +++ b/BrainLILODrv.cpp @@ -68,7 +68,7 @@ static FileSystemPowerFunctionProc FileSystemPowerFunction; typedef LPVOID (*AllocPhysMemProc)(DWORD,DWORD,DWORD,DWORD,PULONG); -DWORD wReadSize; +DWORD FileSize; unsigned long bootloaderphysaddr; static void disableInterrupts(){ @@ -129,7 +129,7 @@ static void EDNA2_runPhysicalInvoker(){ "bic r0, r0, #5\n" // disable MMU/DCache "mcr p15,0,r0,c1,c0,0\n" // write ctrl regs ); - for(DWORD i=0;i