Function at 0x473170
Capabilities:
Check if file exists
Get common file path
Get file size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x954
mov eax, dword [0x4e412c]
xor eax, ebp
mov dword [ebp - 8], eax
push str.LTdelUnusedPort_P2P98___start_n
push 0
call fcn.004718a0
add esp, 8
mov dword [ebp - 0x414], str.IP___
mov dword [ebp - 0x530], 0
mov dword [ebp - 0x410], 0
mov dword [ebp - 0x948], 0
mov dword [ebp - 0x934], 0
cmp dword [ebp + 0xc], 0
je 0x4731d3
mov eax, dword [ebp + 0xc]
mov dword [eax], 0xffffffff
lea ecx, [ebp - 0x524]
push ecx
lea edx, [ebp - 0x93c]
push edx
call fcn.00462720
add esp, 8
mov dword [ebp - 0x944], eax
cmp dword [ebp - 0x524], 0
jne 0x473211
push str.LTdelUnusedPort_P2P98___failed_to_enumerate_printers_on_the_system_n
push 0
call fcn.004718a0
add esp, 8
jmp 0x4736cd
push 0x104
lea eax, [ebp - 0x520]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push 0x4cccd4
lea ecx, [ebp - 0x520]
push ecx
call fcn.00489af0
add esp, 8
cmp dword [ebp + 8], 0
je 0x473248
mov edx, dword [ebp + 8]
mov dword [ebp - 0x94c], edx
jmp 0x473252
mov dword [ebp - 0x94c], str.kmp_p2p.ini
mov eax, dword [ebp - 0x94c]
push eax
lea ecx, [ebp - 0x520]
push ecx
call fcn.00489af0
add esp, 8
lea edx, [ebp - 0x520]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x4732a1
push str.LTdelUnusedPort_P2P98___setting_ini_file_not_found_n
push 0
call fcn.004718a0
add esp, 8
cmp dword [ebp + 0xc], 0
je 0x473297
mov eax, dword [ebp + 0xc]
mov dword [eax], 0
jmp 0x4736cd
push 0
push 0x80
push 4
push 0
push 1
push bind
lea ecx, [ebp - 0x520]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x52c], eax
push 0
mov edx, dword [ebp - 0x52c]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x938], eax
mov eax, dword [ebp - 0x52c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x938], 0xffffffff
jne 0x473319
push str.LTdelUnusedPort_P2P98___cant_get_file_size_of_the_ini_n
push 0
call fcn.004718a0
add esp, 8
cmp dword [ebp + 0xc], 0
je 0x47330f
mov ecx, dword [ebp + 0xc]
mov dword [ecx], 0
jmp 0x4736cd
mov edx, dword [ebp - 0x938]
add edx, 1
push edx
call fcn.0048a9a4
add esp, 4
mov dword [ebp - 0x948], eax
cmp dword [ebp - 0x948], 0
je 0x473354
mov eax, dword [ebp - 0x938]
push eax
push 0
mov ecx, dword [ebp - 0x948]
push ecx
call fcn.004886d0
add esp, 0xc
jmp 0x47336d
push str.LTdelUnusedPort_P2P98___failed_to_malloc_buffer_n
push 0
call fcn.004718a0
add esp, 8
jmp 0x4736cd
push 0x4ccd84
lea edx, [ebp - 0x520]
push edx
call fcn.0048dd3f
add esp, 8
mov dword [ebp - 0x410], eax
cmp dword [ebp - 0x410], 0
jne 0x4733a9
push str.LTdelUnusedPort_P2P98___cant_open_setting_ini_file_n
push 0
call fcn.004718a0
add esp, 8
jmp 0x4736cd
mov eax, dword [ebp - 0x410]
push eax
push 0x400
lea ecx, [ebp - 0x930]
push ecx
call fcn.0048daf4
add esp, 0xc
test eax, eax
je 0x473452
mov edx, dword [ebp - 0x414]
push edx
call fcn.00489c70
add esp, 4
push eax
mov eax, dword [ebp - 0x414]
push eax
lea ecx, [ebp - 0x930]
push ecx
call fcn.00489fce
add esp, 0xc
test eax, eax
je 0x47340e
lea edx, [ebp - 0x930]
push edx
mov eax, dword [ebp - 0x948]
push eax
call fcn.00489af0
add esp, 8
jmp 0x47344d
mov ecx, dword [ebp - 0x948]
push ecx
call fcn.00489c70
add esp, 4
test eax, eax
je 0x473425
jmp 0x473452
push str.LTdelUnusedPort_P2P98___invalid_ini_file_n
push 0
call fcn.004718a0
add esp, 8
cmp dword [ebp + 0xc], 0
je 0x473443
mov edx, dword [ebp + 0xc]
mov dword [edx], 0
jmp 0x4736cd
jmp 0x4733a9
cmp dword [ebp - 0x944], 0
je 0x4735f5
mov eax, dword [ebp - 0x414]
push eax
call fcn.00489c70
add esp, 4
push eax
mov ecx, dword [ebp - 0x414]
push ecx
lea edx, [ebp - 0x930]
push edx
call fcn.00489fce
add esp, 0xc
test eax, eax
je 0x47348e
jmp 0x4735d2
push 0x24
lea eax, [ebp - 0x930]
push eax
call fcn.00418740
add esp, 8
test eax, eax
je 0x4734bf
push 0x24
lea ecx, [ebp - 0x930]
push ecx
call fcn.00418740
add esp, 8
add eax, 1
mov dword [ebp - 0x950], eax
jmp 0x4734c9
mov dword [ebp - 0x950], 0
mov edx, dword [ebp - 0x950]
mov dword [ebp - 4], edx
push 0x24
mov eax, dword [ebp - 4]
push eax
call fcn.00418740
add esp, 8
test eax, eax
je 0x4734fd
push 0x24
mov ecx, dword [ebp - 4]
push ecx
call fcn.00418740
add esp, 8
sub eax, 1
mov dword [ebp - 0x954], eax
jmp 0x473507
mov dword [ebp - 0x954], 0
mov edx, dword [ebp - 0x954]
mov dword [ebp - 0x528], edx
cmp dword [ebp - 4], 0
je 0x473522
cmp dword [ebp - 0x528], 0
jne 0x473527
jmp 0x4735d2
mov eax, dword [ebp - 4]
push eax
lea ecx, [ebp - 0x408]
push ecx
call fcn.00489ae0
add esp, 8
mov edx, dword [ebp - 0x528]
sub edx, dword [ebp - 4]
mov byte [ebp + edx - 0x408], 0
mov dword [ebp - 0x40c], 0
jmp 0x473566
mov eax, dword [ebp - 0x40c]
add eax, 1
mov dword [ebp - 0x40c], eax
mov ecx, dword [ebp - 0x40c]
cmp ecx, dword [ebp - 0x944]
jge 0x47359f
lea edx, [ebp - 0x408]
push edx
mov eax, dword [ebp - 0x40c]
shl eax, 4
mov ecx, dword [ebp - 0x93c]
mov edx, dword [ecx + eax + 4]
push edx
call fcn.0048a3e0
add esp, 8
test eax, eax
jne 0x47359d
jmp 0x47359f
jmp 0x473557
mov eax, dword [ebp - 0x40c]
cmp eax, dword [ebp - 0x944]
jge 0x4735d2
lea ecx, [ebp - 0x930]
push ecx
mov edx, dword [ebp - 0x948]
push edx
call fcn.00489af0
add esp, 8
mov eax, dword [ebp - 0x530]
add eax, 1
mov dword [ebp - 0x530], eax
mov ecx, dword [ebp - 0x410]
push ecx
push 0x400
lea edx, [ebp - 0x930]
push edx
call fcn.0048daf4
add esp, 0xc
test eax, eax
jne 0x47345f
mov eax, dword [ebp - 0x410]
push eax
call fcn.0048da78
add esp, 4
push 0x4ccdec
lea ecx, [ebp - 0x520]
push ecx
call fcn.0048dd3f
add esp, 8
mov dword [ebp - 0x410], eax
cmp dword [ebp - 0x410], 0
jne 0x473640
push str.LTdelUnusedPort_P2P98___cant_open_setting_ini_file_for_rewrite_n
push 0
call fcn.004718a0
add esp, 8
jmp 0x4736cd
mov edx, dword [ebp - 0x948]
push edx
mov eax, dword [ebp - 0x410]
push eax
call fcn.0048e7e1
add esp, 8
mov ecx, dword [ebp - 0x410]
push ecx
call fcn.0048da78
add esp, 4
mov edx, dword [ebp - 0x530]
push edx
push str.LTdelUnusedPort_P2P98___successfully_deleted_unused_ports_rest__d__n
push 0
call fcn.004718a0
add esp, 0xc
lea eax, [ebp - 0x940]
push eax
call fcn.004609e0
add esp, 4
mov ecx, dword [ebp - 0x940]
push ecx
call fcn.00460db0
add esp, 4
mov edx, dword [ebp - 0x93c]
push edx
call fcn.00462c00
add esp, 4
mov dword [ebp - 0x93c], 0
cmp dword [ebp + 0xc], 0
je 0x4736c3
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x530]
mov dword [eax], ecx
mov dword [ebp - 0x934], 1
cmp dword [ebp - 0x410], 0
je 0x4736e5
mov edx, dword [ebp - 0x410]
push edx
call fcn.0048da78
add esp, 4
cmp dword [ebp - 0x93c], 0
je 0x4736fd
mov eax, dword [ebp - 0x93c]
push eax
call fcn.00462c00
add esp, 4
cmp dword [ebp - 0x948], 0
je 0x473715
mov ecx, dword [ebp - 0x948]
push ecx
call fcn.00488f35
add esp, 4
xor eax, eax
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00488550
mov esp, ebp
pop ebp
ret