From d7c519f4b44e965eb57bb94f0fa60795450a523d Mon Sep 17 00:00:00 2001 From: midipix Date: May 28 2019 20:56:12 +0000 Subject: __ntapi_tt_create_thread(): remote threads: x86_64: properly pass arg in reg. --- diff --git a/src/thread/ntapi_tt_create_thread.c b/src/thread/ntapi_tt_create_thread.c index 5ee1db0..ad69905 100644 --- a/src/thread/ntapi_tt_create_thread.c +++ b/src/thread/ntapi_tt_create_thread.c @@ -1,6 +1,6 @@ /********************************************************/ /* ntapi: Native API core library */ -/* Copyright (C) 2013--2017 Z. Gilboa */ +/* Copyright (C) 2013--2019 Z. Gilboa */ /* Released under GPLv2 and GPLv3; see COPYING.NTAPI. */ /********************************************************/ @@ -217,7 +217,7 @@ int32_t __stdcall __ntapi_tt_create_thread(nt_thread_params * params) /* */ /* A "RAPUNZEL" TOP-OF-STACK, VARIABLE-SIZE ENTRY-ROUTINE CONTEXT */ /* */ -/* COPYRIGHT (C) 2013--2018 ZVI GILBOA */ +/* COPYRIGHT (C) 2013--2019 ZVI GILBOA */ /* */ /* */ /* */ @@ -264,11 +264,17 @@ int32_t __stdcall __ntapi_tt_create_thread(nt_thread_params * params) /**/ /**/ /**/ /**/ /* write entry-routine argument */ -/**/ if (params->creation_flags & NT_CREATE_LOCAL_THREAD) /**/ +/**/ if (sizeof(intptr_t) == 8) { /**/ /**/ at_store( /**/ /**/ (intptr_t *)parg, /**/ /**/ (intptr_t)params->arg); /**/ -/**/ else { /**/ +/**/ /**/ +/**/ } else if (params->creation_flags & NT_CREATE_LOCAL_THREAD) { /**/ +/**/ at_store( /**/ +/**/ (intptr_t *)parg, /**/ +/**/ (intptr_t)params->arg); /**/ +/**/ /**/ +/**/ } else { /**/ /**/ status = __ntapi->zw_write_virtual_memory( /**/ /**/ params->hprocess, /**/ /**/ parg, /**/