Function at 0x40d050
Capabilities:
Check if file exists
Delete file
Get file attributes
Link many functions at runtime
Move file

Disassembly:
sub esp, 0x410
push ebx
push ebp
mov ebp, ecx
xor ebx, ebx
push esi
cmp dword [ebp], ebx
jne 0x40d48b
push edi
push str.XLNet.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
cmp eax, ebx
mov dword [ebp], eax
jne 0x40d265
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x31d]
mov byte [esp + 0x31c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x115]
mov byte [esp + 0x114], bl
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x424]
push 0x104
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x118]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x114]
push 0x5c
push edx
call dword [sym.imp.MSVCRT.dll__mbsrchr]
add esp, 8
cmp eax, ebx
je 0x40d0e6
mov byte [eax + 1], bl
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
or ecx, 0xffffffff
lea edi, [esp + 0x114]
xor eax, eax
lea edx, [esp + 0x10]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x218], bl
mov eax, ecx
mov esi, edi
shr ecx, 2
mov edi, edx
lea edx, [esp + 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, str.XLNet.dll
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x218]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x40
lea edi, [esp + 0x219]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea edi, [esp + 0x114]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x218]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.XLNet.dll.new
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
lea eax, [esp + 0x218]
push eax
call esi
cmp eax, 0xffffffff
je 0x40d20f
lea ecx, [esp + 0x10]
push ecx
call esi
cmp eax, 0xffffffff
je 0x40d1fc
lea edx, [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x40d1fc
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40d20f
lea eax, [esp + 0x10]
lea ecx, [esp + 0x218]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_MoveFileA]
lea edx, [esp + 0x10]
push edx
call esi
cmp eax, 0xffffffff
je 0x40d273
lea edi, [esp + 0x10]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0x103
jae 0x40d23f
lea edi, [esp + 0x10]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
jmp 0x40d244
mov ecx, 0x103
push ecx
lea eax, [esp + 0x14]
lea ecx, [esp + 0x320]
push eax
push ecx
call dword [sym.imp.MSVCRT.dll__mbsnbcpy]
add esp, 0xc
lea edx, [esp + 0x31c]
push edx
jmp 0x40d26a
push str.XLNet.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp], eax
mov eax, dword [ebp]
pop edi
cmp eax, ebx
je 0x40d48b
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.XLSktSocket
push eax
call esi
mov dword [ebp + 4], eax
mov eax, dword [ebp]
push str.XLSktAttach
push eax
call esi
mov ecx, dword [ebp]
push str.XLSktConnect
push ecx
mov dword [ebp + 8], eax
call esi
mov edx, dword [ebp]
push str.XLSktConnectEx
push edx
mov dword [ebp + 0xc], eax
call esi
mov dword [ebp + 0x10], eax
mov eax, dword [ebp]
push str.XLSktSend
push eax
call esi
mov ecx, dword [ebp]
push str.XLSktRecv
push ecx
mov dword [ebp + 0x14], eax
call esi
mov edx, dword [ebp]
push str.XLSktClose
push edx
mov dword [ebp + 0x18], eax
call esi
mov dword [ebp + 0x1c], eax
mov eax, dword [ebp]
push str.XLSktSetProxy
push eax
call esi
mov ecx, dword [ebp]
push str.XLGetHostByName
push ecx
mov dword [ebp + 0x20], eax
call esi
mov edx, dword [ebp]
push str.XLGetHostByNameEx
push edx
mov dword [ebp + 0x24], eax
call esi
mov dword [ebp + 0x28], eax
mov eax, dword [ebp]
push str.XLSktGetOpt
push eax
call esi
mov ecx, dword [ebp]
push str.XLSktSetOpt
push ecx
mov dword [ebp + 0x2c], eax
call esi
mov edx, dword [ebp]
push str.XLNetOpen
push edx
mov dword [ebp + 0x30], eax
call esi
mov dword [ebp + 0x34], eax
mov eax, dword [ebp]
push str.XLNetOpenUrl
push eax
call esi
mov ecx, dword [ebp]
push str.XLNetConnect
push ecx
mov dword [ebp + 0x38], eax
call esi
mov edx, dword [ebp]
push str.XLHttpOpenRequest
push edx
mov dword [ebp + 0x3c], eax
call esi
mov dword [ebp + 0x40], eax
push str.XLHttpAddRequestHeaders
mov eax, dword [ebp]
push eax
call esi
mov ecx, dword [ebp]
push str.XLHttpSendRequest
push ecx
mov dword [ebp + 0x48], eax
call esi
mov edx, dword [ebp]
push str.XLHttpEndRequest
push edx
mov dword [ebp + 0x4c], eax
call esi
mov dword [ebp + 0x50], eax
mov eax, dword [ebp]
push str.XLHttpQueryInfo
push eax
call esi
mov ecx, dword [ebp]
push str.XLNetWriteFile
push ecx
mov dword [ebp + 0x44], eax
call esi
mov edx, dword [ebp]
push str.XLNetReadFile
push edx
mov dword [ebp + 0x54], eax
call esi
mov dword [ebp + 0x58], eax
mov eax, dword [ebp]
push str.XLNetQueryOption
push eax
call esi
mov ecx, dword [ebp]
push str.XLNetSetOption
push ecx
mov dword [ebp + 0x5c], eax
call esi
mov edx, dword [ebp]
push str.XLNetCloseHandle
push edx
mov dword [ebp + 0x60], eax
call esi
mov dword [ebp + 0x64], eax
mov eax, dword [ebp]
push str.XLZip
push eax
call esi
mov ecx, dword [ebp]
push str.XLUnZip
push ecx
mov dword [ebp + 0x68], eax
call esi
mov ecx, dword [ebp + 4]
mov dword [ebp + 0x6c], eax
cmp ecx, ebx
je 0x40d47a
cmp dword [ebp + 8], ebx
je 0x40d47a
cmp dword [ebp + 0xc], ebx
je 0x40d47a
cmp dword [ebp + 0x10], ebx
je 0x40d47a
cmp dword [ebp + 0x14], ebx
je 0x40d47a
cmp dword [ebp + 0x18], ebx
je 0x40d47a
cmp dword [ebp + 0x1c], ebx
je 0x40d47a
cmp dword [ebp + 0x20], ebx
je 0x40d47a
cmp dword [ebp + 0x24], ebx
je 0x40d47a
cmp dword [ebp + 0x28], ebx
je 0x40d47a
cmp dword [ebp + 0x34], ebx
je 0x40d47a
cmp dword [ebp + 0x38], ebx
je 0x40d47a
cmp dword [ebp + 0x3c], ebx
je 0x40d47a
cmp dword [ebp + 0x40], ebx
je 0x40d47a
cmp dword [ebp + 0x44], ebx
je 0x40d47a
cmp dword [ebp + 0x48], ebx
je 0x40d47a
cmp dword [ebp + 0x4c], ebx
je 0x40d47a
cmp dword [ebp + 0x50], ebx
je 0x40d47a
cmp dword [ebp + 0x54], ebx
je 0x40d47a
cmp dword [ebp + 0x58], ebx
je 0x40d47a
cmp dword [ebp + 0x5c], ebx
je 0x40d47a
cmp dword [ebp + 0x60], ebx
je 0x40d47a
cmp dword [ebp + 0x64], ebx
je 0x40d47a
cmp dword [ebp + 0x68], ebx
je 0x40d47a
cmp eax, ebx
jne 0x40d48b
mov eax, dword [ebp]
cmp eax, ebx
je 0x40d48b
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [ebp], ebx
pop esi
pop ebp
pop ebx
add esp, 0x410
ret 4