Function at 0x41ca60
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5f216e
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x6ec0
call fcn.005c0d00
mov eax, dword [0x6b7e40]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov byte [ebp - 0x6e49], dl
mov esi, ecx
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
xor edi, edi
mov dword [ebp - 0x6e5c], eax
mov dword [ebp - 0x6e48], ecx
mov dword [ebp - 0x6e54], 0
mov dword [ebp - 0x6e64], edi
test ecx, ecx
je 0x41cc41
push edi
push 0x63bfdc
call fcn.00402090
push 0xfffffffffffffff5
mov dword [ebp - 0x6e84], 0xc
mov dword [ebp - 0x6e7c], 1
mov dword [ebp - 0x6e80], edi
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push edi
lea eax, [ebp - 0x6e84]
push eax
lea eax, [ebp - 0x6e64]
push eax
lea eax, [ebp - 0x6e54]
push eax
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x41cb9f
push str.INTERNAL_ERROR_in_RunCmd:_unable_to_create_pipe_for_stdout_in_GetRegistryStringValue
lea ecx, [ebp - 0x6e44]
call fcn.004021e0
push ecx
mov ecx, esp
push 0x63bfdc
mov dword [ebp - 4], edi
call fcn.004021e0
push edi
lea eax, [ebp - 0x6e44]
push eax
push 0x15fa
push str.C:_amintegration_tools_setupishield_sldim_baseUtilities.cpp
push 1
push 1
xor ecx, ecx
call fcn.004051a0
mov ecx, eax
call fcn.004022e0
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x6e44]
add edx, 0xfffffff0
or ebx, 0xffffffff
lea ecx, [edx + 0xc]
mov eax, ebx
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x41cb88
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
xor edi, edi
mov dword [ebp - 0x6e54], 0
mov dword [ebp - 0x6e64], edi
jmp 0x41cc44
push 0
push 1
push dword [ebp - 0x6e54]
call dword [sym.imp.KERNEL32.dll_SetHandleInformation]
test eax, eax
jne 0x41cc3b
push str.INTERNAL_ERROR_in_RunCmd:_::SetHandleInformation_failed_for_stdout_in_GetRegistryStringValue
lea ecx, [ebp - 0x6e44]
call fcn.004021e0
push ecx
mov ecx, esp
push 0x63bfdc
mov dword [ebp - 4], 1
call fcn.004021e0
push 0
lea eax, [ebp - 0x6e44]
push eax
push 0x1603
push str.C:_amintegration_tools_setupishield_sldim_baseUtilities.cpp
push 1
push 1
xor ecx, ecx
call fcn.004051a0
mov ecx, eax
call fcn.004022e0
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x6e44]
add edx, 0xfffffff0
or ebx, 0xffffffff
lea ecx, [edx + 0xc]
mov eax, ebx
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x41cc29
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x6e64]
mov dword [ebp - 0x6e54], 0
jmp 0x41cc44
mov edi, dword [ebp - 0x6e64]
or ebx, 0xffffffff
push 0x44
lea eax, [ebp - 0x6ed0]
push 0
push eax
call fcn.005c26e0
xor eax, eax
add esp, 0xc
mov dword [ebp - 0x6ed0], 0x44
mov dword [ebp - 0x6ecc], 0
mov dword [ebp - 0x6e9c], 0
mov word [ebp - 0x6e9e], ax
mov dword [ebp - 0x6ec8], eax
mov dword [ebp - 0x6ec4], eax
mov dword [ebp - 0x6ec0], eax
mov dword [ebp - 0x6ebc], eax
mov dword [ebp - 0x6eb8], eax
mov dword [ebp - 0x6eb4], eax
mov dword [ebp - 0x6eb0], eax
mov dword [ebp - 0x6eac], eax
test edi, edi
je 0x41ccc4
mov dword [ebp - 0x6e94], edi
mov dword [ebp - 0x6ea4], 0x101
jmp 0x41ccce
mov dword [ebp - 0x6ea4], 1
mov al, byte [ebp + 0x14]
test al, al
je 0x41ccd9
xor ecx, ecx
jmp 0x41ccde
mov ecx, 1
mov word [ebp - 0x6ea0], cx
test al, al
mov ecx, 0x4000000
mov edx, 0xc000000
cmovne ecx, edx
cmp byte [ebp + 0xc], 0
je 0x41cd00
or ecx, 0x800
test edi, edi
je 0x41cd0a
or ecx, 0x400
lea edx, [ebp - 0x6e40]
sub edx, esi
movzx eax, word [esi]
mov word [esi + edx], ax
lea esi, [esi + 2]
test ax, ax
jne 0x41cd12
lea eax, [ebp - 0x6e78]
push eax
lea eax, [ebp - 0x6ed0]
push eax
push dword [ebp - 0x6e5c]
xor eax, eax
push 0
test edi, edi
setne al
push ecx
xorps xmm0, xmm0
movq qword [ebp - 0x6e78], xmm0
movq qword [ebp - 0x6e70], xmm0
push eax
push 0
push 0
lea eax, [ebp - 0x6e40]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov esi, eax
mov dword [ebp - 0x6e68], esi
mov dword [ebp - 0x6e58], 0xffffffff
test esi, esi
jne 0x41ce9f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 0x6e5c], esi
call fcn.004a4516
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x41cdaa
push 0x80004005
call fcn.00402040
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x6e44], eax
push esi
lea eax, [ebp - 0x6e44]
push str.INTERNAL_ERROR_in_RunCmd:_Failed_in_call_to_CreateProcess:_GetLastError_returned__u_n
push eax
mov dword [ebp - 4], 2
call fcn.00404520
add esp, 0xc
lea ecx, [ebp - 0x6e50]
push 0x63bfdc
call fcn.004021e0
xor ecx, ecx
call fcn.004051a0
mov edi, eax
push ecx
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0x6e50]
add ecx, 0xfffffff0
mov esi, esp
push ecx
call fcn.004046f0
add esp, 4
add eax, 0x10
push 0
push 0
mov dword [esi], eax
lea eax, [ebp - 0x6e44]
push eax
push 0x1655
push str.C:_amintegration_tools_setupishield_sldim_baseUtilities.cpp
push 1
push 1
mov ecx, edi
call fcn.004055a0
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x6e50]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x41ce50
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x6e58]
mov ecx, 0x2e4
cmp dword [ebp - 0x6e5c], ecx
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x6e44]
cmove eax, ecx
add edx, 0xfffffff0
mov dword [ebp - 0x6e58], eax
lea eax, [edx + 0xc]
mov ecx, ebx
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x41cf7f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x6e68]
jmp 0x41cfa0
cmp byte [ebp - 0x6e49], 0
je 0x41ceb3
lea ecx, [ebp - 0x6e78]
call fcn.0041f1b0
lea eax, [ebp - 0x6e58]
push eax
push dword [ebp - 0x6e78]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
jne 0x41cf87
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.004a4516
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x41cef2
push 0x80004005
call fcn.00402040
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x6e44], eax
push esi
lea eax, [ebp - 0x6e44]
push str.INTERNAL_ERROR_in_RunCmd:_Failed_in_call_to_GetExitCodeProcess:_GetLastError_returned__u_n
push eax
mov dword [ebp - 4], 4
call fcn.00404520
add esp, 8
mov ecx, esp
push 0x63bfdc
call fcn.004021e0
push 0
lea eax, [ebp - 0x6e44]
push eax
push 0x166b
push str.C:_amintegration_tools_setupishield_sldim_baseUtilities.cpp
push 1
push 1
xor ecx, ecx
call fcn.004051a0
mov ecx, eax
call fcn.004022e0
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x6e44]
add edx, 0xfffffff0
mov dword [ebp - 0x6e58], 0xffffffff
lea eax, [edx + 0xc]
mov ecx, ebx
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x41cf7f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x6e68]
jmp 0x41cfa0
mov eax, dword [ebp - 0x6e58]
mov ecx, 2
cmp eax, 0x103
cmove eax, ecx
mov dword [ebp - 0x6e58], eax
mov edi, dword [ebp - 0x6e48]
test edi, edi
je 0x41d197
cmp dword [ebp - 0x6e54], 0
je 0x41d197
mov eax, dword [ebp - 0x6e64]
mov dword [ebp - 0x6e5c], 0
mov bl, 1
test eax, eax
je 0x41d05b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x41d05b
push str.INTERNAL_ERROR_in_RunCmd:_Unable_to_close_pipe_for_stdout_in_GetRegistryStringValue
lea ecx, [ebp - 0x6e50]
call fcn.004021e0
push ecx
mov ecx, esp
push 0x63bfdc
mov dword [ebp - 4], 5
call fcn.004021e0
push 0
lea eax, [ebp - 0x6e50]
push eax
push 0x1686
push str.C:_amintegration_tools_setupishield_sldim_baseUtilities.cpp
push 1
push 1
xor ecx, ecx
call fcn.004051a0
mov ecx, eax
call fcn.004022e0
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x6e50]
add edx, 0xfffffff0
or esi, 0xffffffff
lea eax, [edx + 0xc]
mov ecx, esi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x41d119
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x41d119
test esi, esi
je 0x41d116
mov dword [ebp - 4], 6
xor esi, esi
lea esp, [esp]
cmp esi, 0x3e8
jge 0x41d116
push 0
lea eax, [ebp - 0x6e5c]
push eax
push 0x1000
lea eax, [ebp - 0x2020]
push eax
push dword [ebp - 0x6e54]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x41d1d8
test esi, esi
jne 0x41d1d8
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [ebp - 0x6e44]
mov esi, eax
call fcn.00404540
push esi
lea eax, [ebp - 0x6e44]
push str.INTERNAL_ERROR_in_RunCmd:_Failed_in_call_to_ReadFile:_GetLastError_returned__u_n
push eax
mov byte [ebp - 4], 7
call fcn.00404520
add esp, 0xc
push ecx
mov ecx, esp
push 0x63bfdc
call fcn.004021e0
push 0
lea eax, [ebp - 0x6e44]
push eax
push 0x1699
push str.C:_amintegration_tools_setupishield_sldim_baseUtilities.cpp
push 1
push 1
xor ecx, ecx
call fcn.004051a0
mov ecx, eax
call fcn.004022e0
lea ecx, [ebp - 0x6e44]
call fcn.00401020
or esi, 0xffffffff
mov dword [ebp - 4], 0xa
push dword [ebp - 0x6e54]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x41d197
push str.INTERNAL_ERROR_in_RunCmd_closing_handle_hChildStdoutRd
lea ecx, [ebp - 0x6e48]
call fcn.004021e0
push ecx
mov ecx, esp
push 0x63bfdc
mov byte [ebp - 4], 0xb
call fcn.004021e0
push 0
lea eax, [ebp - 0x6e48]
push eax
push 0x16db
push str.C:_amintegration_tools_setupishield_sldim_baseUtilities.cpp
push 1
push 1
xor ecx, ecx
call fcn.004051a0
mov ecx, eax
call fcn.004022e0
mov byte [ebp - 4], 0xa
mov edx, dword [ebp - 0x6e48]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x41d197
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp dword [ebp - 0x6e68], 0
je 0x41d1b6
push dword [ebp - 0x6e74]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0x6e78]
call esi
mov eax, dword [ebp - 0x6e58]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.005bc16b
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x6e5c]
test edx, edx
je 0x41d116
test esi, esi
jne 0x41d207
lea ecx, [ebp - 0x2020]
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x41d1f3
sub ecx, edi
mov edi, dword [ebp - 0x6e48]
cmp ecx, edx
setl bl
test bl, bl
je 0x41d259
and edx, 0xfffffffe
cmp edx, 0x2002
jae 0x41d254
xor eax, eax
mov word [ebp + edx - 0x2020], ax
lea eax, [ebp - 0x2020]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x41d230
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x2020]
push eax
mov ecx, edi
call fcn.00404910
inc esi
jmp 0x41d070
call fcn.005bcad4
lea eax, [ebp - 0x2020]
push eax
mov ecx, edi
mov byte [ebp + edx - 0x2020], 0
call fcn.00420210
inc esi
jmp 0x41d070