Function at 0x10005236
Capabilities:
Write file on windows

Disassembly:
push 0x10
mov eax, 0x1001f2f2
call fcn.1001d02b
mov edi, ecx
mov esi, dword [ebp + 8]
test esi, esi
jne 0x10005269
push ecx
mov ecx, esp
push str.Send_command___invalid_buffer
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__4]
push 3
mov ecx, edi
call fcn.10005998
xor al, al
jmp 0x10005615
xor ebx, ebx
push ebx
push dword [ebp + 0xc]
push esi
call sub.mfc140u.dll_AfxIsValidAddress
test eax, eax
jne 0x10005283
push ecx
mov ecx, esp
push str.Send_command___invalid_buffer_address
jmp 0x10005253
push dword [ebp + 0xc]
mov ecx, edi
push esi
push ebx
call fcn.10005b20
lea ecx, [edi + 0x14]
test ecx, ecx
jne 0x100052ae
push ebx
push str.pSect
push 0x1c
push str.C:_buildAgentwork_b687d30c96366458clarityCswControlsCommonTools.h
call sub.cswbasemfc14.dll_Ordinal_1234
add esp, 0x10
lea ecx, [edi + 0x14]
mov al, byte [ebp + 0x1c]
mov dword [ebp - 0x1c], ecx
mov byte [ebp - 0x18], al
test al, al
je 0x100052c2
push ecx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [edi + 0x58]
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
cmp byte [edi + 0x2064], 0
lea eax, [edi + 0x2c]
mov dword [eax], ebx
mov dword [edi + 0x30], ebx
mov dword [edi + 0x34], ebx
mov dword [edi + 0x38], ebx
je 0x10005372
imul eax, dword [ebp + 0x18], 5
mov ecx, dword [edi + 0x2060]
mov dword [ebp + 0x1c], eax
test ecx, ecx
jne 0x1000530a
push 3
pop esi
push ecx
mov ecx, esp
push str.Not_NETPAD_COM_handle
jmp 0x100053ee
push eax
lea eax, [ebp - 0x14]
push eax
push dword [ebp + 0xc]
push esi
push ecx
call fcn.1000395e
add esp, 0x14
test al, al
jne 0x100054ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [ebp + 0x1c]
mov dword [edi + 0x2068], 1
mov esi, eax
call dword [sym.imp.mfc140u.dll_Ordinal_296]
push esi
mov byte [ebp - 4], 1
push str.Error__d_on_NETPAD_COM_line
lea eax, [ebp + 0x1c]
push eax
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__9]
pop ecx
pop ecx
lea eax, [ebp + 0x1c]
mov ecx, esp
push eax
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__14]
push 1
mov ecx, edi
call fcn.10005998
lea ecx, [ebp + 0x1c]
jmp 0x10005605
cmp byte [edi + 0x2065], 0
je 0x100053dd
imul eax, dword [ebp + 0x18], 5
mov ecx, dword [edi + 0x2060]
mov dword [ebp + 0x1c], eax
test ecx, ecx
jne 0x10005399
push 3
pop esi
push ecx
mov ecx, esp
push str.Not_NETCOM_COM_handle
jmp 0x100053ee
push eax
lea eax, [ebp - 0x14]
push eax
push dword [ebp + 0xc]
push esi
push ecx
call fcn.100038ac
add esp, 0x14
test al, al
jne 0x100054ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [ebp + 0x1c]
mov dword [edi + 0x2068], 1
mov esi, eax
call dword [sym.imp.mfc140u.dll_Ordinal_296]
push esi
mov byte [ebp - 4], 2
push str.Error__d_on_NETCOM_COM_line
jmp 0x10005349
cmp dword [edi + 4], 0xffffffff
jne 0x10005407
push 3
pop esi
push ecx
mov ecx, esp
push str.Not_COM_handle
mov dword [edi + 0x2068], esi
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__4]
push esi
mov ecx, edi
call fcn.10005998
jmp 0x1000560b
cmp byte [edi + 0x206d], 0
je 0x1000541e
push 8
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_PurgeComm]
lea eax, [edi + 0x2c]
push eax
lea eax, [ebp - 0x14]
push eax
push dword [ebp + 0xc]
push esi
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100054c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x10005494
push 1
lea eax, [ebp - 0x14]
push eax
lea eax, [edi + 0x2c]
push eax
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x100054c9
mov eax, dword [edi]
lea ecx, [ebp + 0x1c]
push str.Read_thread___timeout_error
mov esi, dword [eax + 0xc]
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__13]
lea eax, [ebp + 0x1c]
mov byte [ebp - 4], 3
push eax
push SysReAllocString
mov ecx, edi
call esi
lea ecx, [ebp + 0x1c]
mov byte [ebp - 4], bl
call dword [sym.imp.mfc140u.dll_Ordinal_1045]
mov eax, dword [ebp + 0x18]
mov esi, dword [ebp + 8]
jmp 0x100054d1
push eax
lea eax, [ebp + 0x1c]
mov dword [edi + 0x2068], 1
push str.Error__d_on_COM_line
push eax
call fcn.1000477e
add esp, 0xc
mov eax, dword [edi]
lea ecx, [ebp + 0x1c]
push ecx
push 0x4000000
mov ecx, edi
mov byte [ebp - 4], 4
call dword [eax + 0xc]
jmp 0x1000536a
mov eax, dword [ebp + 0x18]
jmp 0x100054d1
mov eax, dword [ebp + 0x1c]
test eax, eax
jne 0x100054dd
mov dword [edi + 0x2068], ebx
jmp 0x10005539
push eax
push dword [edi + 0x58]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x10005540
cmp dword [ebp + 0x10], eax
je 0x1000551d
mov esi, dword [ebp + 0x14]
test esi, esi
je 0x1000551d
mov ecx, dword [edi + 0x205c]
lea eax, [edi + 0x105c]
cmp ecx, dword [esi]
cmovg ecx, dword [esi]
push ecx
push eax
push dword [ebp + 0x10]
call sub.VCRUNTIME140.dll_memmove
mov eax, dword [edi + 0x205c]
add esp, 0xc
mov dword [esi], eax
push dword [edi + 0x205c]
lea eax, [edi + 0x105c]
mov dword [edi + 0x2068], ebx
push eax
push 1
mov ecx, edi
call fcn.10005b20
mov bl, 1
jmp 0x1000560b
push 0x100232f0
lea ecx, [ebp - 0x10]
mov dword [edi + 0x2068], 2
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__13]
lea ecx, [ebp + 0x1c]
call dword [sym.imp.mfc140u.dll_Ordinal_296]
push 0x10023318
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 6
call dword [sym.imp.mfc140u.dll_ATL::CSimpleStringT_wchar_t_1_::operator_1]
cmp dword [ebp + 0xc], 0
mov dword [ebp + 0x18], ebx
jle 0x100055d1
movzx eax, byte [ebx + esi]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isprint]
pop ecx
test eax, eax
je 0x100055a5
cmp byte [edi + 0x2090], 0
je 0x100055a5
movzx eax, byte [ebx + esi]
lea ecx, [ebp - 0x10]
push eax
call dword [0x1002156c]
jmp 0x100055c9
movzx eax, byte [ebx + esi]
push eax
lea eax, [ebp + 0x1c]
push str.__.2X_
push eax
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__9]
add esp, 0xc
lea eax, [ebp + 0x1c]
lea ecx, [ebp - 0x10]
push eax
call dword [sym.imp.mfc140u.dll_ATL::CSimpleStringT_wchar_t_1_::operator_2]
inc ebx
cmp ebx, dword [ebp + 0xc]
jl 0x1000557c
xor ebx, ebx
push 0x10023330
lea ecx, [ebp - 0x10]
call dword [sym.imp.mfc140u.dll_ATL::CSimpleStringT_wchar_t_1_::operator_1]
lea ecx, [ebp + 0x1c]
mov byte [ebp - 4], 5
call dword [sym.imp.mfc140u.dll_Ordinal_1045]
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
push eax
call dword [sym.imp.mfc140u.dll_ATL::CStringT_wchar_t_StrTraitMFC_DLL_wchar_t_ATL::ChTraitsCRT_wchar_t__14]
push 2
mov ecx, edi
call fcn.10005998
lea ecx, [ebp - 0x10]
call dword [sym.imp.mfc140u.dll_Ordinal_1045]
lea ecx, [ebp - 0x1c]
call fcn.10004257
mov al, bl
call fcn.1001cff9
ret 0x18