diff options
author | midipix <writeonce@midipix.org> | 2016-07-25 15:09:14 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-07-27 10:00:43 -0400 |
commit | 22238c52f19167008af978a5a4acf2dffef3ba94 (patch) | |
tree | 0450d80c296661d83deae5583a469db3c21d81cd /src/ldr | |
parent | 3b2c111c7e1ab6eea017ed0e8ffe62fbbf1bfa2d (diff) | |
download | ntapi-22238c52f19167008af978a5a4acf2dffef3ba94.tar.bz2 ntapi-22238c52f19167008af978a5a4acf2dffef3ba94.tar.xz |
__ntapi_ldr_load_system_dll(): pass the system directory as the path parameter.
Diffstat (limited to 'src/ldr')
-rw-r--r-- | src/ldr/ntapi_ldr_load_system_dll.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/ldr/ntapi_ldr_load_system_dll.c b/src/ldr/ntapi_ldr_load_system_dll.c index a5c56f6..306d8e9 100644 --- a/src/ldr/ntapi_ldr_load_system_dll.c +++ b/src/ldr/ntapi_ldr_load_system_dll.c @@ -17,30 +17,31 @@ int32_t __stdcall __ntapi_ldr_load_system_dll( __out void ** image_base) { int32_t status; + wchar16_t * sysdir; + nt_unicode_string nt_sysdir; nt_unicode_string nt_image_name; uintptr_t buffer[0x80]; (void)image_flags; /* stack buffer */ - __ntapi->tt_aligned_block_memset(buffer,0,sizeof(buffer)); + __ntapi->tt_aligned_block_memset( + buffer,0,sizeof(buffer)); - status = __ntapi->tt_get_system_directory_dos_path( - hsysdir, - (wchar16_t *)buffer, - sizeof(buffer), - base_name, - base_name_size, - &nt_image_name); + sysdir = (wchar16_t *)buffer; - if (status != NT_STATUS_SUCCESS) + if ((status = __ntapi->tt_get_system_directory_dos_path( + hsysdir, + sysdir,sizeof(buffer), + 0,0,&nt_sysdir))) return status; - status = __ntapi->ldr_load_dll( - 0, - 0, + nt_image_name.strlen = base_name_size; + nt_image_name.maxlen = base_name_size; + nt_image_name.buffer = base_name; + + return __ntapi->ldr_load_dll( + sysdir,0, &nt_image_name, image_base); - - return status; } |