2003-12-23 15:33:13 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2019-01-30 09:03:12 +00:00
|
|
|
| Copyright (c) The PHP Group |
|
2003-12-23 15:33:13 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 12:51:34 +00:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2003-12-23 15:33:13 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available through the world-wide-web at the following url: |
|
2021-05-06 10:16:35 +00:00
|
|
|
| https://www.php.net/license/3_01.txt |
|
2003-12-23 15:33:13 +00:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Author: Wez Furlong <wez@thebrainroom.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* This little application will list the DLL dependencies for a PE
|
|
|
|
* module to it's stdout for use by distro/installer building tools */
|
|
|
|
|
|
|
|
#include <windows.h>
|
2015-05-28 21:06:49 +00:00
|
|
|
#include <stdio.h>
|
2003-12-23 15:33:13 +00:00
|
|
|
#include <imagehlp.h>
|
|
|
|
|
|
|
|
BOOL CALLBACK StatusRoutine(IMAGEHLP_STATUS_REASON reason,
|
2020-08-10 17:42:05 +00:00
|
|
|
PCSTR image_name, PCSTR dll_name,
|
|
|
|
ULONG_PTR va, ULONG_PTR param)
|
2003-12-23 15:33:13 +00:00
|
|
|
{
|
|
|
|
switch (reason) {
|
|
|
|
case BindImportModuleFailed:
|
|
|
|
printf("%s,NOTFOUND\n", dll_name);
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
case BindImportModule:
|
|
|
|
printf("%s,OK\n", dll_name);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* usage:
|
|
|
|
* deplister.exe path\to\module.exe path\to\symbols\root
|
|
|
|
* */
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
return BindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES,
|
2015-01-03 09:22:58 +00:00
|
|
|
argv[1], NULL, argv[2], StatusRoutine);
|
2003-12-23 15:33:13 +00:00
|
|
|
}
|