mydll.cpp
上传用户:nbcables
上传日期:2007-01-11
资源大小:1243k
文件大小:17k
源码类别:

钩子与API截获

开发平台:

Visual C++

  1. // ------------------------------------- //
  2. // 您如果要使用本文件,请不要删除本说明  //
  3. // ------------------------------------- //
  4. //             HOOKAPI 开发例子          //
  5. //   Copyright 2002 编程沙龙 Paladin     //
  6. //       www.ProgramSalon.com            //
  7. // ------------------------------------- //
  8. #include "stdafx.h"
  9. #include <stdio.h>
  10. #include "mydll.h"
  11. #include "util.h"
  12. #include "psapi.h"
  13. #include "tlhelp32.h"
  14. #include "ps.h"
  15. #include "filter.h"
  16. HINSTANCE g_hInstance =NULL;
  17. CFileFilter g_Filter;
  18. BOOL APIENTRY DllMain( HANDLE hModule, 
  19.                        DWORD  ul_reason_for_call, 
  20.                        LPVOID lpReserved
  21.  )
  22. {
  23. g_hInstance =(HINSTANCE)hModule;
  24.     return TRUE;
  25. }
  26. HANDLE WINAPI myCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
  27. {          
  28. char temp[200];
  29. GetModuleFileName(NULL, temp, sizeof(temp));
  30. //WriteLog("myCreateFileA:filename=%s", lpFileName);
  31. if(g_Filter.FilterCreateFile((char *)lpFileName))
  32. {
  33. SetLastError(ERROR_NOT_AUTHENTICATED);
  34. return NULL;
  35. }
  36. return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes,
  37. dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
  38. }
  39. HANDLE WINAPI myCreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
  40. {
  41. char temp[200];
  42. GetModuleFileName(NULL, temp, sizeof(temp));
  43. char fname[128];
  44. int len =WideCharToMultiByte( CP_ACP, 0, lpFileName, -1, fname, 128,NULL,NULL); 
  45. fname[len] =0;
  46. WriteLog("myCreateFileW:filename=%s", fname);
  47. if(strstr(fname, "NOTEPAD") || strstr(fname, "notepad") || strstr(fname, "Notepad") || strstr(fname, "NotePad"))
  48. {
  49. WriteLog("found notepad");
  50. return NULL;
  51. }
  52. if(g_Filter.FilterCreateFile(fname))
  53. {
  54. SetLastError(ERROR_NOT_AUTHENTICATED);
  55. return NULL;
  56. }
  57. HANDLE hFile =CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes,
  58. dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
  59. int err =GetLastError();
  60. //WriteLog("CreateFileW:handle=%x", hFile);
  61. SetLastError(err);
  62. return hFile;
  63. }
  64. BOOL WINAPI myDeleteFileA(LPCSTR lpFileName)
  65. {
  66. char temp[200];
  67. GetModuleFileName(NULL, temp, sizeof(temp));
  68. WriteLog("myDeleteFileA:filename=%s", lpFileName);
  69. if(g_Filter.FilterDeleteFile((char *)lpFileName))
  70. {
  71. SetLastError(ERROR_NOT_AUTHENTICATED);
  72. return NULL;
  73. }
  74. return DeleteFileA(lpFileName);
  75. }
  76. BOOL WINAPI myDeleteFileW(LPCWSTR lpFileName)
  77. {
  78. char temp[200];
  79. GetModuleFileName(NULL, temp, sizeof(temp));
  80. char fname[128];
  81. int len =WideCharToMultiByte( CP_ACP, 0, lpFileName, -1, fname, 128,NULL,NULL); 
  82. fname[len] =0;
  83. WriteLog("myDeleteFileW:filename=%s", fname);
  84. if(g_Filter.FilterDeleteFile(fname))
  85. {
  86. SetLastError(ERROR_NOT_AUTHENTICATED);
  87. return NULL;
  88. }
  89. return DeleteFileW(lpFileName);
  90. }
  91. BOOL WINAPI myCopyFileW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, BOOL bFailIfExists)
  92. {
  93. char fname1[128];
  94. int len =WideCharToMultiByte( CP_ACP, 0, lpExistingFileName, -1, fname1, 128,NULL,NULL); 
  95. fname1[len] =0;
  96. char fname2[128];
  97. len =WideCharToMultiByte( CP_ACP, 0, lpNewFileName, -1, fname2, 128,NULL,NULL); 
  98. fname2[len] =0;
  99. WriteLog("CopyfileW:%s to %s", fname1, fname2);
  100. if(g_Filter.FilterCopyFile(fname1, fname2))
  101. {
  102. SetLastError(ERROR_NOT_AUTHENTICATED);
  103. return NULL;
  104. }
  105. return CopyFileW(lpExistingFileName, lpNewFileName, bFailIfExists);
  106. }
  107. BOOL WINAPI myCopyFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, BOOL bFailIfExists)
  108. {
  109. WriteLog("CopyfileA:%s to %s", lpExistingFileName, lpNewFileName);
  110. if(g_Filter.FilterCopyFile((char *)lpExistingFileName, (char *)lpNewFileName))
  111. {
  112. SetLastError(ERROR_NOT_AUTHENTICATED);
  113. return NULL;
  114. }
  115. return CopyFileA(lpExistingFileName, lpNewFileName, bFailIfExists);
  116. }
  117. BOOL WINAPI myCreateDirectoryW(LPCWSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
  118. {
  119. char pname[128];
  120. int len =WideCharToMultiByte( CP_ACP, 0, lpPathName, -1, pname, 128,NULL,NULL); 
  121. pname[len] =0;
  122. WriteLog("CreateDirectoryW:path=%s", pname);
  123. if(g_Filter.FilterCreateDir(pname))
  124. {
  125. SetLastError(ERROR_NOT_AUTHENTICATED);
  126. return NULL;
  127. }
  128. return CreateDirectoryW(lpPathName, lpSecurityAttributes);
  129. }
  130. BOOL WINAPI myCreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
  131. {
  132. WriteLog("CreateDirectoryA:path=%s", lpPathName);
  133. if(g_Filter.FilterCreateDir((char *)lpPathName))
  134. {
  135. SetLastError(ERROR_NOT_AUTHENTICATED);
  136. return NULL;
  137. }
  138. return CreateDirectoryA(lpPathName, lpSecurityAttributes);
  139. }
  140. BOOL WINAPI myCreateDirectoryExW(LPCWSTR lpTemplateDirectory, LPCWSTR lpNewDirectory,
  141. LPSECURITY_ATTRIBUTES lpSecurityAttributes)
  142. {
  143. char pname1[128], pname2[128];
  144. int len =WideCharToMultiByte( CP_ACP, 0, lpTemplateDirectory, -1, pname1, 128,NULL,NULL); 
  145. pname1[len] =0;
  146. len =WideCharToMultiByte( CP_ACP, 0, lpNewDirectory, -1, pname2, 128,NULL,NULL); 
  147. pname2[len] =0;
  148. WriteLog("CreateDirectoryExW:pathtemp=%s, path=%s", pname1, pname2);
  149. if(g_Filter.FilterCreateDir(pname1))
  150. {
  151. SetLastError(ERROR_NOT_AUTHENTICATED);
  152. return NULL;
  153. }
  154. if(g_Filter.FilterCreateDir(pname2))
  155. {
  156. SetLastError(ERROR_NOT_AUTHENTICATED);
  157. return NULL;
  158. }
  159. return CreateDirectoryExW(lpTemplateDirectory, lpNewDirectory, lpSecurityAttributes);
  160. }
  161. BOOL WINAPI myCreateDirectoryExA(LPCSTR lpTemplateDirectory, LPCSTR lpNewDirectory,
  162. LPSECURITY_ATTRIBUTES lpSecurityAttributes)
  163. {
  164. WriteLog("CreateDirectoryExA:pathtemp=%s, path=%s", lpTemplateDirectory, lpNewDirectory);
  165. if(g_Filter.FilterCreateDir((char *)lpTemplateDirectory))
  166. {
  167. SetLastError(ERROR_NOT_AUTHENTICATED);
  168. return NULL;
  169. }
  170. if(g_Filter.FilterCreateDir((char *)lpNewDirectory))
  171. {
  172. SetLastError(ERROR_NOT_AUTHENTICATED);
  173. return NULL;
  174. }
  175. return CreateDirectoryExA(lpTemplateDirectory, lpNewDirectory, lpSecurityAttributes);
  176. }
  177. HANDLE WINAPI myFindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData)
  178. {
  179. HANDLE h =FindFirstFileW(lpFileName, lpFindFileData);
  180. if(h)
  181. {
  182. char fname[128];
  183. int len =WideCharToMultiByte( CP_ACP, 0, lpFindFileData->cFileName, -1, fname, 128,NULL,NULL); 
  184. fname[len] =0;
  185. WriteLog("FindFirstFileW:%s", fname);
  186. if(strstr(fname, "Debug"))//g_Filter.FilterOpenFile(fname))
  187. {
  188. WriteLog("okkkkkkkkkkkkkkkkkkkkkk");
  189. //SetLastError(ERROR_NOT_AUTHENTICATED);
  190. //return NULL;
  191. memset(lpFindFileData, 0, sizeof(*lpFindFileData));
  192. if(!FindNextFileW(h, lpFindFileData))
  193. {
  194. FindClose(h);
  195. SetLastError(ERROR_NOT_AUTHENTICATED);
  196. return h;
  197. }
  198. }
  199. }
  200. return h; 
  201. }
  202. HANDLE WINAPI myFindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData)
  203. {
  204. WriteLog("FindFirstFileA:%s", lpFileName);
  205. /*if(g_Filter.FilterFindFile(lpFileName))
  206. {
  207. SetLastError(ERROR_NOT_AUTHENTICATED);
  208. return NULL;
  209. }*/
  210. return FindFirstFileA(lpFileName, lpFindFileData);
  211. }
  212. //隐藏文件或目录
  213. HANDLE WINAPI myFindFirstFileExW(LPCWSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPWIN32_FIND_DATAW lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags)
  214. {
  215. HANDLE h=FindFirstFileExW(lpFileName, fInfoLevelId, lpFindFileData, fSearchOp, lpSearchFilter, dwAdditionalFlags);
  216. if(h)
  217. {
  218. char fname[128];
  219. int len =WideCharToMultiByte( CP_ACP, 0, lpFindFileData->cFileName, -1, fname, 128,NULL,NULL); 
  220. fname[len] =0;
  221. WriteLog("FindFirstFileW:%s", fname);
  222. if(g_Filter.FilterOpenFile(fname))
  223. {
  224. //WriteLog("okkkkkkkkkkkkkkkkkkkkkk");
  225. //SetLastError(ERROR_NOT_AUTHENTICATED);
  226. //return NULL;
  227. memset(lpFindFileData, 0, sizeof(*lpFindFileData));
  228. if(!FindNextFileW(h, lpFindFileData))
  229. {
  230. FindClose(h);
  231. SetLastError(ERROR_NOT_AUTHENTICATED);
  232. return h;
  233. }
  234. }
  235. }
  236. return h; 
  237. }
  238. //隐藏文件或目录
  239. BOOL WINAPI myFindNextFileW(HANDLE h, LPWIN32_FIND_DATAW lpFindFileData)
  240. {
  241. //WriteLog("FindNextFileW");
  242. BOOL f =FindNextFileW(h, lpFindFileData);
  243. if(f)
  244. {
  245. char fname[128];
  246. int len =WideCharToMultiByte( CP_ACP, 0, lpFindFileData->cFileName, -1, fname, 128,NULL,NULL); 
  247. fname[len] =0;
  248. WriteLog("FindNextFileW:%s", fname);
  249. if(g_Filter.FilterOpenFile(fname))  // 如果发现了此文件或目录,就跳过返回下一个查找结果
  250. {
  251. //WriteLog("ok2 kkkkkkkkkkkkkkkkkkkkk");
  252. //SetLastError(ERROR_NOT_AUTHENTICATED);
  253. //return NULL;
  254. return FindNextFileW(h, lpFindFileData);
  255. }
  256. }
  257. return f; 
  258. }
  259. BOOL WINAPI myFindNextFileA(HANDLE h, LPWIN32_FIND_DATAA lpFindFileData)
  260. {
  261. BOOL f =FindNextFileA(h, lpFindFileData);
  262. if(f)
  263. {
  264. WriteLog("FindNextFileA:%s", lpFindFileData->cFileName);
  265. if(g_Filter.FilterOpenFile(lpFindFileData->cFileName))
  266. {
  267. //WriteLog("ok2 kkkkkkkkkkkkkkkkkkkkk");
  268. //SetLastError(ERROR_NOT_AUTHENTICATED);
  269. //return NULL;
  270. return FindNextFileA(h, lpFindFileData);
  271. }
  272. }
  273. return f; 
  274. }
  275. BOOL WINAPI myMoveFileW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName)
  276. {
  277. char fname[128];
  278. int len =WideCharToMultiByte( CP_ACP, 0, lpExistingFileName, -1, fname, 128,NULL,NULL); 
  279. fname[len] =0;
  280. char fname1[128];
  281. len =WideCharToMultiByte( CP_ACP, 0, lpNewFileName, -1, fname1, 128,NULL,NULL); 
  282. fname1[len] =0;
  283. WriteLog("MoveFileW:%s,%s", fname, fname1);
  284. if(g_Filter.FilterMoveFile(fname, fname1))
  285. {
  286. SetLastError(ERROR_NOT_AUTHENTICATED);
  287. return NULL;
  288. }
  289. return MoveFileW(lpExistingFileName, lpNewFileName);
  290. }
  291. BOOL WINAPI myMoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName)
  292. {
  293. WriteLog("MoveFileA:%s,%s", lpExistingFileName, lpNewFileName);
  294. if(g_Filter.FilterMoveFile((char *)lpExistingFileName, (char *)lpNewFileName))
  295. {
  296. SetLastError(ERROR_NOT_AUTHENTICATED);
  297. return NULL;
  298. }
  299. return MoveFileA(lpExistingFileName, lpNewFileName);
  300. }
  301. BOOL WINAPI myMoveFileExW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, DWORD dwFlags)
  302. {
  303. char fname[128];
  304. int len =WideCharToMultiByte( CP_ACP, 0, lpExistingFileName, -1, fname, 128,NULL,NULL); 
  305. fname[len] =0;
  306. char fname1[128];
  307. len =WideCharToMultiByte( CP_ACP, 0, lpNewFileName, -1, fname1, 128,NULL,NULL); 
  308. fname1[len] =0;
  309. WriteLog("MoveFileExW:%s,%s", fname, fname1);
  310. if(g_Filter.FilterMoveFile(fname, fname1))
  311. {
  312. SetLastError(ERROR_NOT_AUTHENTICATED);
  313. return NULL;
  314. }
  315. return MoveFileExW(lpExistingFileName, lpNewFileName, dwFlags);
  316. }
  317. BOOL WINAPI myMoveFileExA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, DWORD dwFlags)
  318. {
  319. WriteLog("MoveFileExA:%s,%s", lpExistingFileName, lpNewFileName);
  320. if(g_Filter.FilterMoveFile((char *)lpExistingFileName, (char *)lpNewFileName))
  321. {
  322. SetLastError(ERROR_NOT_AUTHENTICATED);
  323. return NULL;
  324. }
  325. return MoveFileExA(lpExistingFileName, lpNewFileName, dwFlags);
  326. }
  327. BOOL WINAPI myReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
  328. LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
  329. {
  330. //WriteLog("ReadFile:handle=%x", hFile);
  331. char fname[200];
  332. GetFileNameByHandle(hFile, fname);
  333. if(g_Filter.FilterReadFile(fname))
  334. {
  335. SetLastError(ERROR_NOT_AUTHENTICATED);
  336. return NULL;
  337. }
  338. return ReadFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped);
  339. }
  340. BOOL WINAPI myReadFileEx(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
  341. LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
  342. {
  343. WriteLog("ReadFileEx");
  344. char fname[200];
  345. GetFileNameByHandle(hFile, fname);
  346. if(g_Filter.FilterReadFile(fname))
  347. {
  348. SetLastError(ERROR_NOT_AUTHENTICATED);
  349. return false;
  350. }
  351. return ReadFileEx(hFile, lpBuffer, nNumberOfBytesToRead,
  352. lpOverlapped, lpCompletionRoutine);
  353. }
  354. BOOL WINAPI mySetCurrentDirectoryW(LPCWSTR lpPathName)
  355. {
  356. char pname[128];
  357. int len =WideCharToMultiByte( CP_ACP, 0, lpPathName, -1, pname, 128,NULL,NULL); 
  358. pname[len] =0;
  359. WriteLog("SetCurrentDirectoryW:%s", pname);
  360. if(strstr(pname, "Debug"))
  361. {
  362. SetLastError(ERROR_NOT_AUTHENTICATED);
  363. return false;
  364. }
  365. if(g_Filter.FilterChDir(pname))
  366. {
  367. SetLastError(ERROR_NOT_AUTHENTICATED);
  368. return false;
  369. }
  370. return SetCurrentDirectoryW(lpPathName);
  371. }
  372. BOOL WINAPI mySetCurrentDirectoryA(LPCSTR lpPathName)
  373. {
  374. WriteLog("SetCurrentDirectoryA:%s", lpPathName);
  375. if(g_Filter.FilterChDir((char *)lpPathName))
  376. {
  377. SetLastError(ERROR_NOT_AUTHENTICATED);
  378. return false;
  379. }
  380. return SetCurrentDirectoryA(lpPathName);
  381. }
  382. BOOL WINAPI myWriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
  383. LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
  384. {
  385. //WriteLog("WriteFile");
  386. char fname[200];
  387. GetFileNameByHandle(hFile, fname);
  388. if(g_Filter.FilterWriteFile(fname))
  389. {
  390. SetLastError(ERROR_NOT_AUTHENTICATED);
  391. return false;
  392. }
  393. return WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten,
  394. lpOverlapped);
  395. }
  396. BOOL WINAPI myWriteFileEx(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
  397. LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
  398. {
  399. WriteLog("WriteFileEx");
  400. char fname[200];
  401. GetFileNameByHandle(hFile, fname);
  402. if(g_Filter.FilterWriteFile(fname))
  403. {
  404. SetLastError(ERROR_NOT_AUTHENTICATED);
  405. return false;
  406. }
  407. return WriteFileEx(hFile, lpBuffer, nNumberOfBytesToWrite, lpOverlapped, lpCompletionRoutine);
  408. }
  409. // 过滤执行文件
  410. DWORD WINAPI myCreateProcessW(
  411. LPCWSTR lpApplicationName,
  412. LPWSTR lpCommandLine, 
  413. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  414. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  415. BOOL bInheritHandles,
  416. DWORD dwCreationFlags,
  417. LPVOID lpEnvironment,
  418. LPCWSTR lpCurrentDirectory,
  419. LPSTARTUPINFOW lpStartupInfo,
  420. LPPROCESS_INFORMATION lpProcessInformation
  421. )
  422. {
  423. char cmd[600];
  424. int len =WideCharToMultiByte( CP_ACP, 0, lpCommandLine, -1, cmd, sizeof(cmd),NULL,NULL); 
  425. cmd[len] =0;
  426. //WriteLog("CreateProcessW :cmd=%s", cmd);
  427. if(g_Filter.FilterExecute(cmd))
  428. {
  429. SetLastError(ERROR_NOT_AUTHENTICATED);
  430. return false;
  431. }
  432. BOOL ifsuccess = CreateProcessW(lpApplicationName,
  433. lpCommandLine, lpProcessAttributes,
  434. lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment,
  435. lpCurrentDirectory, lpStartupInfo, lpProcessInformation);
  436. DWORD err =GetLastError();
  437. SetLastError(err);
  438. return (DWORD)ifsuccess;
  439. }
  440. DWORD WINAPI myCreateProcessA(
  441. LPCSTR lpApplicationName,
  442. LPSTR lpCommandLine, 
  443. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  444. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  445. BOOL bInheritHandles,
  446. DWORD dwCreationFlags,
  447. LPVOID lpEnvironment,
  448. LPCSTR lpCurrentDirectory,
  449. LPSTARTUPINFO lpStartupInfo,
  450. LPPROCESS_INFORMATION lpProcessInformation
  451. )
  452. {
  453. if(g_Filter.FilterExecute(lpCommandLine))
  454. {
  455. SetLastError(ERROR_NOT_AUTHENTICATED);
  456. return false;
  457. }
  458. BOOL ifsuccess = CreateProcessA(lpApplicationName,
  459. lpCommandLine, lpProcessAttributes,
  460. lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment,
  461. lpCurrentDirectory, lpStartupInfo, lpProcessInformation);
  462. DWORD err =GetLastError();
  463. WriteLog("CreateProcessA %s", lpCommandLine);
  464. SetLastError(err);
  465. return (DWORD)ifsuccess;
  466. }
  467. DWORD WINAPI myGetFileAttributesW(LPCWSTR pfile)
  468. {
  469. char fname[128];
  470. int len=WideCharToMultiByte(CP_ACP, 0, pfile, -1, fname, sizeof(fname), NULL, NULL);
  471. fname[len] =0;
  472. WriteLog("myGetFileAttributesW:%s",fname);
  473. return GetFileAttributesW(pfile);
  474. }
  475. DWORD WINAPI myGetFileAttributesA(LPCSTR pfile)
  476. {
  477. WriteLog("myGetFileAttributesA:%s",pfile);
  478. return GetFileAttributesA(pfile);
  479. }
  480. MYAPIINFO myapi_info[] =
  481. {
  482. {"KERNEL32.DLL", "CreateFileA", 7, "myCreateFileA"},
  483. {"KERNEL32.DLL", "CreateFileW", 7, "myCreateFileW"},
  484. {"KERNEL32.DLL", "ReadFile", 5, "myReadFile"},
  485. {"KERNEL32.DLL", "ReadFileEx", 6, "myReadFileEx"},
  486. {"KERNEL32.DLL", "WriteFile", 5, "myWriteFile"},
  487. {"KERNEL32.DLL", "WriteFileEx", 5, "myWriteFileEx"},
  488. {"KERNEL32.DLL", "MoveFileA", 2, "myMoveFileA"},
  489. {"KERNEL32.DLL", "MoveFileW", 2, "myMoveFileW"},
  490. {"KERNEL32.DLL", "MoveFileExA", 3, "myMoveFileExA"},
  491. {"KERNEL32.DLL", "MoveFileExW", 3, "myMoveFileExW"},
  492. {"KERNEL32.DLL", "DeleteFileA", 1, "myDeleteFileA"},
  493. {"KERNEL32.DLL", "DeleteFileW", 1, "myDeleteFileW"},
  494. {"KERNEL32.DLL", "CopyFileA", 3, "myCopyFileA"},
  495. {"KERNEL32.DLL", "CopyFileW", 3, "myCopyFileW"},
  496. {"KERNEL32.DLL", "FindFirstFileA", 2, "myFindFirstFileA"},
  497. {"KERNEL32.DLL", "FindFirstFileW", 2, "myFindFirstFileW"},
  498. {"KERNEL32.DLL", "FindNextFileW", 2, "myFindNextFileW"},
  499. {"KERNEL32.DLL", "CreateDirectoryExA", 3, "myCreateDirectoryExA"},
  500. {"KERNEL32.DLL", "CreateDirectoryExW", 3, "myCreateDirectoryExW"},
  501. {"KERNEL32.DLL", "CreateDirectoryA", 2, "myCreateDirectoryA"},
  502. {"KERNEL32.DLL", "CreateDirectoryW", 2, "myCreateDirectoryW"},
  503. {"KERNEL32.DLL", "SetCurrentDirectoryA", 1, "mySetCurrentDirectoryA"},
  504. {"KERNEL32.DLL", "SetCurrentDirectoryW", 1, "mySetCurrentDirectoryW"},
  505. {"KERNEL32.DLL", "CreateProcessW", 10, "myCreateProcessW"},
  506. {"KERNEL32.DLL", "CreateProcessA", 10, "myCreateProcessA"},
  507. {"KERNEL32.DLL", "GetFileAttributesW", 1, "myGetFileAttributesW"},
  508. {"KERNEL32.DLL", "GetFileAttributesA", 1, "myGetFileAttributesA"},
  509. {"KERNEL32.DLL", "FindFirstFileExW", 6, "myFindFirstFileExW"},
  510. {NULL,NULL,NULL}
  511. };
  512. MYAPIINFO *GetMyAPIInfo()
  513. {
  514. return &myapi_info[0];
  515. }