Function at 0x4cb04c
Capabilities:
Connect network resource

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x564
mov eax, dword [0x5c4e68]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 7
pop ecx
xor ebx, ebx
xor eax, eax
mov esi, 0x103
lea edi, [ebp - 0x560]
push esi
mov dword [ebp - 0x564], ebx
rep stosd dword es:[edi], eax
mov byte [ebp - 0x320], al
lea eax, [ebp - 0x31f]
push ebx
push eax
mov dword [ebp - 0x534], ebx
call fcn.005117f0
add esp, 0xc
push esi
lea eax, [ebp - 0x427]
push ebx
push eax
mov byte [ebp - 0x428], bl
call fcn.005117f0
add esp, 0xc
push esi
lea eax, [ebp - 0x52f]
push ebx
push eax
mov byte [ebp - 0x530], bl
call fcn.005117f0
add esp, 0xc
push esi
lea eax, [ebp - 0x217]
push ebx
push eax
mov byte [ebp - 0x218], bl
call fcn.005117f0
add esp, 0xc
push esi
lea eax, [ebp - 0x10f]
push ebx
push eax
mov byte [ebp - 0x110], bl
call fcn.005117f0
add esp, 0xc
push str.TmsNetPrn.num
push ebx
mov dword [ebp - 0x540], ebx
call fcn.00489f49
pop ecx
pop ecx
lea edx, [ebp - 0x534]
mov ecx, eax
call fcn.0042c27f
cmp dword [ebp - 0x534], ebx
jne 0x4cb131
push ebx
push str.:8:ConnectMappedPrinterTAMS___was_called_but_no_printer_has_been_defined____d
call fcn.004265da
pop ecx
pop ecx
xor eax, eax
jmp 0x4cb470
lea eax, [ebp - 0x530]
push eax
lea eax, [ebp - 0x428]
push eax
lea ecx, [ebp - 0x320]
call fcn.0046255a
cmp dword [ebp - 0x534], ebx
pop ecx
pop ecx
mov dword [ebp - 0x538], 1
jge 0x4cb17a
neg dword [ebp - 0x534]
mov dword [ebp - 0x53c], str.WINPRINTER
mov dword [ebp - 0x544], 0x55c7c4
jmp 0x4cb18e
mov dword [ebp - 0x53c], 0x55c7c4
mov dword [ebp - 0x544], str.WINPRINTER
push 0x20
lea eax, [ebp - 0x564]
push ebx
push eax
call fcn.005117f0
lea eax, [ebp - 0x218]
mov dword [ebp - 0x550], eax
add esp, 0xc
lea eax, [ebp - 0x540]
push eax
lea eax, [ebp - 0x110]
push eax
mov dword [ebp - 0x560], 2
mov dword [ebp - 0x554], str.LPT1:
mov dword [ebp - 0x548], ebx
mov dword [ebp - 0x540], esi
call sub.WINSPOOL.DRV_Ordinal_201
test eax, eax
mov edi, str._GetLastError_
jne 0x4cb206
push edi
push str.:2:ConnectMappedPrinterTAMS__:_There_is_no_default_printer_so_the_newly_assigned_one_will_be_set_as_default:__s
call fcn.00426c01
pop ecx
pop ecx
lea eax, [ebp - 0x110]
call fcn.004c3ab2
mov dword [ebp - 0x540], ebx
push dword [ebp - 0x534]
lea eax, [ebp - 0x320]
push dword [ebp - 0x53c]
mov ebx, str._s_s_d
push eax
push ebx
mov esi, 0x104
lea eax, [ebp - 0x218]
push esi
push eax
call fcn.004c53b7
add esp, 0x18
push 0x81
lea eax, [ebp - 0x428]
push eax
lea eax, [ebp - 0x530]
push eax
lea eax, [ebp - 0x564]
push eax
call sub.MPR.dll_WNetAddConnection2A
test eax, eax
je 0x4cb371
cmp eax, 0x55
je 0x4cb371
push edi
push str.:2:ConnectMappedPrinterTAMS__:_WNetAddConnection2A___failed_1_of_4:__s
call fcn.00426c01
push dword [ebp - 0x534]
lea eax, [ebp - 0x320]
push dword [ebp - 0x544]
push eax
push ebx
lea eax, [ebp - 0x218]
push esi
push eax
call fcn.004c53b7
add esp, 0x20
push 0x81
lea eax, [ebp - 0x428]
push eax
lea eax, [ebp - 0x530]
push eax
lea eax, [ebp - 0x564]
push eax
call sub.MPR.dll_WNetAddConnection2A
test eax, eax
je 0x4cb371
cmp eax, 0x55
je 0x4cb371
push edi
push str.:2:ConnectMappedPrinterTAMS__:_WNetAddConnection2A___failed_2_of_4:__s
call fcn.00426c01
push dword [ebp - 0x534]
lea eax, [ebp - 0x320]
push dword [ebp - 0x53c]
push eax
push ebx
lea eax, [ebp - 0x218]
push esi
push eax
call fcn.004c53b7
add esp, 0x20
push 0x81
push 0
push 0
lea eax, [ebp - 0x564]
push eax
call sub.MPR.dll_WNetAddConnection2A
test eax, eax
je 0x4cb371
cmp eax, 0x55
je 0x4cb371
push edi
push str.:2:ConnectMappedPrinterTAMS__:_WNetAddConnection2A___failed_3_of_4:__s
call fcn.00426c01
push dword [ebp - 0x534]
lea eax, [ebp - 0x320]
push dword [ebp - 0x544]
push eax
push ebx
lea eax, [ebp - 0x218]
push esi
push eax
call fcn.004c53b7
add esp, 0x20
push 0x81
push 0
push 0
lea eax, [ebp - 0x564]
push eax
call sub.MPR.dll_WNetAddConnection2A
test eax, eax
je 0x4cb371
cmp eax, 0x55
je 0x4cb371
push edi
push str.:5:ConnectMappedPrinterTAMS__:_WNetAddConnection2A___COMPLETELY_FAILED_4_of_4:__s
call fcn.004265da
and dword [ebp - 0x538], 0
pop ecx
pop ecx
lea edx, [ebp - 0x110]
call fcn.004c3b34
test eax, eax
je 0x4cb3a9
cmp dword [ebp - 0x538], 0
je 0x4cb3a9
push dword [ebp - 0x534]
lea eax, [ebp - 0x110]
push str.TAMS_Printer_
push str._s_d
push esi
push eax
call fcn.004c53b7
add esp, 0x14
lea edx, [ebp - 0x110]
call fcn.004c3b34
test eax, eax
jne 0x4cb46a
lea eax, [ebp - 0x110]
push eax
call sub.WINSPOOL.DRV_Ordinal_202
test eax, eax
jne 0x4cb46a
push edi
lea eax, [ebp - 0x110]
push eax
push str.:4a:ConnectMappedPrinterTAMS___FAILED_to_set_the_default_printer_to___s_:__s
call fcn.004265da
add esp, 0xc
push dword [ebp - 0x534]
lea eax, [ebp - 0x320]
push str.TAMS_Printer_
push eax
push ebx
lea eax, [ebp - 0x110]
push esi
push eax
call fcn.004c53b7
add esp, 0x18
lea eax, [ebp - 0x110]
push eax
call sub.WINSPOOL.DRV_Ordinal_202
test eax, eax
jne 0x4cb46a
push edi
lea eax, [ebp - 0x110]
push eax
push str.:4b:ConnectMappedPrinterTAMS___FAILED_to_set_the_default_printer_to___s_:__s
call fcn.004265da
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
call sub.WINSPOOL.DRV_Ordinal_202
test eax, eax
jne 0x4cb46a
push edi
lea eax, [ebp - 0x218]
push eax
push str.:4c:ConnectMappedPrinterTAMS___FAILED_to_set_the_default_printer_to___s_:__s
call fcn.004265da
add esp, 0xc
push 0
call sub.WINSPOOL.DRV_Ordinal_202
test eax, eax
jne 0x4cb46a
push edi
push str.:5:ConnectMappedPrinterTAMS___FAILED:_SetDefaultPrinter_NULL__FAILED:__s
call fcn.004265da
pop ecx
pop ecx
mov eax, dword [ebp - 0x538]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0051291c
leave
ret