Function at 0x403360
Capabilities:
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x20a8
call fcn.00404070
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, ecx
mov dword [ebp - 0x20a0], eax
mov ecx, dword [ebp + 0xc]
mov eax, ecx
push esi
shr eax, 8
push edi
cmp cl, 0xc0
jne 0x4033b2
cmp al, 0xa8
jne 0x4033c8
cmp byte [0x406380], 0
je 0x4033de
mov ecx, 0x406390
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4033a7
sub ecx, edx
jmp 0x4033ec
cmp cl, 0xac
jne 0x4033bf
sub al, 0x10
cmp al, 0xf
ja 0x4033c8
jmp 0x403396
test cl, cl
je 0x403396
cmp cl, 0xa
je 0x403396
mov eax, 0x80040201
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040374c
mov esp, ebp
pop ebp
ret
mov byte [0x406380], 1
call fcn.004024f0
test al, al
jne 0x403404
mov eax, 0x80040202
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040374c
mov esp, ebp
pop ebp
ret
lea eax, [ebx + 0x14]
push eax
lea eax, [ebp - 0x8c]
push 0x4056b0
push eax
call dword [sym.imp.MSVCR120.dll_sprintf]
xor eax, eax
add esp, 0xc
cmp ax, word [ebx + 2]
jne 0x40342c
mov ax, word [ebx]
mov word [ebx + 2], ax
push dword [ebp + 0xc]
call dword [sym.imp.WS2_32.dll_inet_ntoa]
lea ecx, [ebx + 0x34]
mov edx, ecx
sub edx, eax
lea esp, [esp]
mov cl, byte [eax]
lea eax, [eax + 1]
mov byte [edx + eax - 1], cl
test cl, cl
jne 0x403440
xor eax, eax
mov dword [ebp - 0x2090], 1
push str.KGUPnP_UDP_TCP_PORT
push eax
push 0xf001f
mov dword [ebp - 0x2094], eax
call dword [sym.imp.KERNEL32.dll_OpenFileMappingW]
mov dword [ebp - 0x209c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor eax, eax
push eax
mov dword [ebp - 0x20a4], eax
call dword [sym.imp.MSVCR120.dll__time64]
add esp, 4
push eax
call dword [sym.imp.MSVCR120.dll_srand]
add esp, 4
xor edi, edi
mov dword [ebp - 0x2098], edi
lea esi, [ebx + 4]
test edi, edi
je 0x4034b3
mov ax, word [ebp + 0x18]
mov dword [esi], 0x504354
jmp 0x4034bd
mov ax, word [ebp + 0x14]
mov dword [esi], 0x504455
mov word [ebx + 2], ax
xor edi, edi
mov word [ebx], ax
jmp 0x4034d0
mov dx, word [ebx + 2]
lea eax, [ebp - 0x8c]
sub esp, 8
push eax
lea eax, [ebx + 0x34]
push eax
movzx eax, word [ebx]
push eax
push esi
call fcn.00402ee0
add esp, 0x18
cmp eax, 0x80040203
je 0x403608
cmp eax, 0x80040211
je 0x40350d
test eax, eax
je 0x40356b
mov dword [ebp - 0x2090], eax
jmp 0x40353d
cmp edi, 9
jge 0x403601
call dword [sym.imp.MSVCR120.dll_rand]
imul eax, eax, 0xf7fe
cdq
and edx, 0x7fff
add eax, edx
sar eax, 0xf
add eax, 0x801
mov word [ebx + 2], ax
mov eax, dword [ebp - 0x2090]
inc edi
cmp edi, 0xa
jl 0x4034d0
mov esi, dword [ebp - 0x2090]
test eax, eax
jne 0x403648
mov edi, dword [ebp - 0x2098]
test edi, edi
jne 0x403658
movzx eax, word [ebx + 2]
shl eax, 0x10
jmp 0x40365c
mov dx, word [ebx + 2]
lea eax, [ebp - 0x208c]
sub esp, 0xc
push eax
push ecx
push esi
call fcn.00402d30
add esp, 0x18
test eax, eax
js 0x4035fa
lea ecx, [ebx + 0x34]
lea eax, [ebp - 0x208c]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4035b0
test dl, dl
je 0x4035ac
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4035b0
add eax, 2
add ecx, 2
test dl, dl
jne 0x403590
xor eax, eax
jmp 0x4035b5
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4035fa
mov ecx, dword [ebp - 0x20a0]
test ecx, ecx
je 0x4035ed
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
mov ax, word [ebx + 2]
mov word [ecx + 0x10], ax
sub ecx, esi
add ecx, 0x12
jmp 0x4035e0
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [ecx + esi - 1], al
test al, al
jne 0x4035e0
xor esi, esi
mov dword [ebp - 0x2090], esi
jmp 0x403551
mov esi, 0x80040205
jmp 0x403642
mov esi, 0x80040211
jmp 0x403642
mov ecx, dword [ebp - 0x20a0]
test ecx, ecx
je 0x40363d
xor eax, eax
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
mov ax, word [ebx + 2]
mov word [ecx + 0x10], ax
sub ecx, esi
add ecx, 0x12
lea esp, [esp]
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [ecx + esi - 1], al
test al, al
jne 0x403630
mov esi, 0x80040203
mov dword [ebp - 0x2090], esi
mov edi, dword [ebp - 0x2098]
xor eax, eax
mov word [ebx + 2], ax
test edi, edi
je 0x4036a2
movzx eax, word [ebx + 2]
add dword [ebp - 0x2094], eax
mov eax, dword [ebp - 0x209c]
test eax, eax
je 0x403692
push 4
push 0
push 0
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ecx, eax
mov dword [ebp - 0x20a4], ecx
test ecx, ecx
je 0x403692
mov eax, dword [ebp - 0x2094]
mov dword [ecx], eax
inc edi
mov dword [ebp - 0x2098], edi
cmp edi, 2
jl 0x4034a0
mov eax, dword [ebp - 0x20a4]
test eax, eax
je 0x4036b3
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [ebp - 0x209c]
test eax, eax
je 0x4036c4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 8]
cmp esi, 1
mov eax, 0x80040207
cmove esi, eax
xor ecx, ebp
pop edi
mov eax, esi
pop esi
pop ebx
call fcn.0040374c
mov esp, ebp
pop ebp
ret