Function at 0x410ca0
Capabilities:
Read file on windows
Read pipe
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x10014
call fcn.0043b2b0
push ebx
push esi
push edi
mov edi, ecx
mov eax, dword [edi + 4]
cmp eax, 3
je case.0x410dfe.4
cmp eax, 1
jne 0x4111a1
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
mov esi, dword [edi]
test esi, esi
je 0x41111c
mov eax, dword [esi + 4]
cmp eax, 0xffffffff
je 0x41112d
push 0
lea ecx, [esp + 0x20]
mov dword [esp + 0x20], 0
push ecx
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x411107
cmp dword [esp + 0x1c], 8
jb 0x41112d
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push 8
lea eax, [esp + 0x2c]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, 1
jne 0x411107
cmp dword [esp + 0x10], 8
je 0x410d51
push 0x74
push 0x44a840
push str.bytesToRead__bytesRead
call ebx
add esp, 0xc
mov ebx, dword [esp + 0x24]
test ebx, ebx
je 0x410df1
mov esi, dword [edi]
test esi, esi
je 0x410ece
mov eax, dword [esi + 4]
cmp eax, 0xffffffff
je 0x410ee4
push 0
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], 0
push ecx
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x410eb9
cmp dword [esp + 0x14], ebx
jb 0x410ee4
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push ebx
lea eax, [esp + 0x34]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, 1
jne 0x410eb9
cmp ebx, dword [esp + 0x10]
je 0x410de4
mov eax, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
push 0x74
push 0x44a840
push str.bytesToRead__bytesRead
call eax
add esp, 0xc
mov eax, dword [esp + 0x24]
mov byte [esp + eax + 0x28], 0
mov ebx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
cmp eax, 4
ja case.0x410dfe.0
jmp dword [eax*4 + 0x4111ac]
lea esi, [ebx + 8]
mov dword [esp + 0x20], 4
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
test esi, esi
je 0x410ccc
mov eax, dword [edi]
test eax, eax
jne 0x410e37
push 0x4f
push 0x44a840
push str.self
call ebx
add esp, 0xc
jmp 0x410e78
mov eax, dword [eax + 4]
cmp eax, 0xffffffff
je 0x410e72
push 0
lea ecx, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push ecx
push esi
lea ecx, [esp + 0x2c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
cmp eax, 1
jne 0x410e78
cmp dword [esp + 0x18], esi
je 0x410ccc
jmp 0x410e78
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
mov ecx, dword [edi + 0xc]
test ecx, ecx
je 0x410e98
mov eax, dword [edi + 4]
cmp eax, 3
je 0x410e8c
cmp eax, 1
jne 0x410e98
lea eax, [edi + 0x54]
push eax
push dword [edi + 0x50]
call ecx
add esp, 8
mov esi, dword [edi]
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 4], 0xffffffff
mov byte [esi], 0
mov dword [edi + 4], 0
jmp 0x410ccc
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 4], 0xffffffff
mov byte [esi], 0
jmp 0x410ee4
mov eax, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
push 0x67
push 0x44a840
push str.self
call eax
add esp, 0xc
mov ecx, str.Partial_data_in_frame
mov dword [edi + 0x50], 2
lea ebx, [edi + 0x54]
mov esi, 1
mov edx, ebx
sub esi, ecx
nop dword [eax]
lea eax, [esi + ecx]
cmp eax, 0x100
jae 0x411165
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
cmp byte [ecx], 0
jne 0x410f00
jmp 0x411165
mov esi, dword [ebp + 8]
lea eax, [esp + 0x28]
push eax
mov ecx, esi
call fcn.004111c0
test esi, esi
je 0x410fba
push str.code
lea eax, [esp + 0x18]
mov ecx, esi
push eax
call fcn.0040fc90
cmp word [esi + 0xe], 3
lea eax, [esi + 0xe]
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
mov dword [esp + 0x10], eax
je 0x410f6e
push 0x4b0
push 0x44a6a8
push str.IsObject__
call ebx
add esp, 0xc
mov eax, dword [esi]
lea ecx, [esi + 8]
mov esi, dword [esp + 0x14]
shl eax, 5
add eax, dword [ecx]
mov dword [esp + 0x18], ecx
cmp esi, eax
je 0x410fb7
mov al, byte [esi + 0x1e]
shr al, 5
test al, 1
je 0x410fb7
test byte [esi + 0x1e], 0x20
jne 0x410fa8
push 0x6e7
push 0x44a6a8
push str.data_.f.flags__kIntFlag
call ebx
add esp, 0xc
mov eax, dword [esi + 0x10]
mov esi, dword [esp + 0x10]
mov ecx, dword [ebp + 8]
mov dword [edi + 0x50], eax
jmp 0x410fd6
mov esi, dword [ebp + 8]
mov ecx, dword [ebp + 8]
lea eax, [esi + 8]
add esi, 0xe
mov dword [esp + 0x18], eax
mov dword [edi + 0x50], 0
test ecx, ecx
je 0x411064
push str.message
lea eax, [esp + 0x18]
push eax
call fcn.0040fc90
cmp word [esi], 3
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
je 0x411005
push 0x4b0
push 0x44a6a8
push str.IsObject__
call ebx
add esp, 0xc
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov eax, dword [esp + 0x18]
shl ecx, 5
add ecx, dword [eax]
mov eax, dword [esp + 0x14]
cmp eax, ecx
je 0x411064
mov cx, word [eax + 0x1e]
shr cx, 0xa
test cl, 1
je 0x411064
lea esi, [eax + 0x10]
mov ax, word [esi + 0xe]
shr ax, 0xa
test al, 1
jne 0x41104b
push 0x70b
push 0x44a6a8
push str.IsString__
call ebx
add esp, 0xc
mov eax, 0x1000
test word [esi + 0xe], ax
jne 0x411059
mov esi, dword [esi + 8]
lea ebx, [edi + 0x54]
mov eax, esi
test esi, esi
je 0x411098
jmp 0x41106e
mov eax, 0x43d72d
lea ebx, [edi + 0x54]
mov esi, eax
cmp byte [eax], 0
mov ecx, ebx
je 0x411095
mov edx, 1
sub edx, eax
nop dword [eax]
lea eax, [edx + esi]
cmp eax, 0x100
jae 0x411095
mov al, byte [esi]
inc esi
mov byte [ecx], al
inc ecx
cmp byte [esi], 0
jne 0x411080
mov byte [ecx], 0
mov eax, dword [edi + 0xc]
test eax, eax
je 0x411185
mov ecx, dword [edi + 4]
cmp ecx, 3
je 0x4110b4
cmp ecx, 1
jne 0x411185
push ebx
push dword [edi + 0x50]
call eax
jmp 0x411182
mov ecx, dword [ebp + 8]
lea eax, [esp + 0x28]
push eax
call fcn.004111c0
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, str.Bad_ipc_frame
mov dword [edi + 0x50], 2
lea ebx, [edi + 0x54]
mov esi, 1
mov edx, ebx
sub esi, ecx
nop
lea eax, [esi + ecx]
cmp eax, 0x100
jae 0x411165
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
cmp byte [ecx], 0
jne 0x4110f0
jmp 0x411165
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 4], 0xffffffff
mov byte [esi], 0
jmp 0x41112d
push 0x67
push 0x44a840
push str.self
call ebx
add esp, 0xc
mov eax, dword [edi]
cmp byte [eax], 0
jne 0x4111a1
lea ebx, [edi + 0x54]
mov dword [edi + 0x50], 1
mov ecx, str.Pipe_closed
mov esi, 1
mov edx, ebx
sub esi, ecx
nop dword [eax]
lea eax, [esi + ecx]
cmp eax, 0x100
jae 0x411165
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
cmp byte [ecx], 0
jne 0x411150
mov byte [edx], 0
mov ecx, dword [edi + 0xc]
test ecx, ecx
je 0x411185
mov eax, dword [edi + 4]
cmp eax, 3
je 0x41117c
cmp eax, 1
jne 0x411185
push ebx
push dword [edi + 0x50]
call ecx
add esp, 8
mov esi, dword [edi]
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 4], 0xffffffff
mov byte [esi], 0
mov dword [edi + 4], 0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4