Function at 0x1005a970
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ecx
push ebx
push ebp
mov ebp, dword [sym.imp.MSVCR90.dll_malloc]
xor ebx, ebx
push esi
push edi
cmp dword [0x100d3214], ebx
jne 0x1005a9cf
push 0x24
call ebp
mov esi, eax
add esp, 4
cmp esi, ebx
jne 0x1005a9a1
push 0x24
push str.unable_to_alloc__u_bytes
call sym.tcl85.dll_Tcl_Panic
add esp, 8
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x20], eax
mov ebx, 0x100d3214
mov dword [0x100d3214], esi
call fcn.1008f950
xor ebx, ebx
mov eax, dword [0x100d3214]
push 0x1c
mov dword [esp + 0x14], eax
call ebp
mov edi, eax
add esp, 4
cmp edi, ebx
jne 0x1005a9f4
push 0x1c
push str.unable_to_alloc__u_bytes
call sym.tcl85.dll_Tcl_Panic
add esp, 8
push 0x88
call ebp
mov esi, eax
add esp, 4
cmp esi, ebx
jne 0x1005aa16
push 0x88
push str.unable_to_alloc__u_bytes
call sym.tcl85.dll_Tcl_Panic
add esp, 8
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov dword [edi], esi
mov dword [edi + 4], ecx
mov dword [edi + 8], edx
cmp eax, ebx
je 0x1005aa7c
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x1005aa31
sub eax, edx
inc eax
push eax
mov dword [esp + 0x24], eax
call ebp
mov ebp, eax
add esp, 4
cmp ebp, ebx
jne 0x1005aa61
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x1005aa61
push eax
push str.unable_to_alloc__u_bytes
call sym.tcl85.dll_Tcl_Panic
add esp, 8
mov eax, dword [esp + 0x1c]
mov dword [esi], ebp
sub ebp, eax
lea esp, [esp]
mov cl, byte [eax]
mov byte [eax + ebp], cl
inc eax
cmp cl, bl
jne 0x1005aa70
jmp 0x1005aa89
push str.Tcl_CreateChannel:_NULL_channel_name
call sym.tcl85.dll_Tcl_Panic
add esp, 4
mov eax, dword [esp + 0x24]
mov ecx, dword [0x100d2fcc]
mov dword [esi + 4], eax
mov dword [esi + 8], ebx
mov edx, dword [ecx]
mov ebp, str.binary
mov eax, edx
mov cl, byte [eax]
cmp cl, byte [ebp]
jne 0x1005aac3
cmp cl, bl
je 0x1005aabf
mov cl, byte [eax + 1]
cmp cl, byte [ebp + 1]
jne 0x1005aac3
add eax, 2
add ebp, 2
cmp cl, bl
jne 0x1005aaa2
xor eax, eax
jmp 0x1005aac8
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x1005aad9
push edx
push ebx
call sym.tcl85.dll_Tcl_GetEncoding
add esp, 8
mov dword [esi + 8], eax
mov ebp, 1
mov dword [esi + 0xc], ebx
mov dword [esi + 0x10], ebp
mov dword [esi + 0x14], ebx
mov dword [esi + 0x18], ebp
mov dword [esi + 0x1c], ebx
mov dword [esi + 0x20], 3
mov dword [esi + 0x24], ebx
mov dword [esi + 0x28], ebx
mov dword [esi + 0x2c], ebx
mov dword [esi + 0x30], ebx
mov dword [esi + 0x34], ebx
mov dword [esi + 0x3c], ebx
mov dword [esi + 0x40], ebx
mov dword [esi + 0x44], ebx
mov dword [esi + 0x48], ebx
mov dword [esi + 0x4c], ebx
mov dword [esi + 0x50], ebx
mov dword [esi + 0x54], ebx
mov dword [esi + 0x58], ebx
mov dword [esi + 0x5c], ebx
mov dword [esi + 0x60], 0x1000
mov dword [esi + 0x64], ebx
mov dword [esi + 0x68], ebx
mov dword [esi + 0x6c], ebx
mov dword [esi + 0x38], ebx
cmp dword [esi + 8], ebx
je 0x1005ab6a
test byte [esi + 4], 4
je 0x1005ab6a
push 0x1002
call dword [sym.imp.MSVCR90.dll_malloc]
mov ebp, eax
add esp, 4
cmp ebp, ebx
jne 0x1005ab62
push 0x1002
push str.unable_to_alloc__u_bytes
call sym.tcl85.dll_Tcl_Panic
add esp, 8
mov dword [esi + 0x38], ebp
mov ebp, 1
mov dword [esi + 0x70], edi
mov dword [esi + 0x74], edi
mov dword [edi + 0xc], ebx
mov dword [edi + 0x10], ebx
mov dword [edi + 0x14], ebx
mov dword [edi + 0x18], ebx
push edi
mov dword [esi + 0x80], ebx
mov dword [esi + 0x84], ebx
mov dword [esi + 0x78], ebx
call fcn.1005bad0
mov eax, dword [esp + 0x14]
add esp, 4
cmp dword [eax + 8], ebx
jne 0x1005abb9
cmp dword [eax + 0xc], ebp
jne 0x1005abb9
push 2
push edi
call sym.tcl85.dll_Tcl_SetStdChannel
mov edx, dword [edi]
mov eax, dword [edx + 0x74]
mov esi, dword [eax]
add esp, 8
jmp 0x1005ac4e
cmp dword [eax + 0x10], ebx
jne 0x1005abd7
cmp dword [eax + 0x14], ebp
jne 0x1005abd7
push 4
push edi
call sym.tcl85.dll_Tcl_SetStdChannel
mov ecx, dword [edi]
mov edx, dword [ecx + 0x74]
mov esi, dword [edx]
add esp, 8
jmp 0x1005ac4e
cmp dword [eax + 0x18], ebx
jne 0x1005ac62
cmp dword [eax + 0x1c], ebp
jne 0x1005ac62
mov eax, dword [0x100d3214]
cmp eax, ebx
jne 0x1005ac41
push 0x24
call dword [sym.imp.MSVCR90.dll_malloc]
mov esi, eax
add esp, 4
cmp esi, ebx
jne 0x1005ac0e
push 0x24
push str.unable_to_alloc__u_bytes
call sym.tcl85.dll_Tcl_Panic
add esp, 8
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x20], eax
mov ebx, 0x100d3214
mov dword [0x100d3214], esi
call fcn.1008f950
mov eax, dword [0x100d3214]
xor ebx, ebx
mov dword [eax + 0x1c], ebp
mov dword [eax + 0x18], edi
mov eax, dword [edi]
mov ecx, dword [eax + 0x74]
mov esi, dword [ecx]
cmp dword [esi], ebx
jne 0x1005ac5f
push str.Tcl_RegisterChannel:_channel_without_name
call sym.tcl85.dll_Tcl_Panic
add esp, 4
add dword [esi + 0x30], ebp
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret