Function at 0x406240
Capabilities:
Check if file exists
Enumerate files on windows
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x41ea6b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x57c
push esi
mov esi, ecx
mov dword [esp + 0xc], esi
call fcn.004060f0
test eax, eax
je 0x406285
xor eax, eax
pop esi
mov ecx, dword [esp + 0x57c]
mov dword fs:[0], ecx
add esp, 0x588
ret 4
mov eax, dword [esi + 0x1c]
push ebx
mov ebx, 0x10
cmp eax, ebx
jb 0x406297
mov eax, dword [esi + 8]
jmp 0x40629a
lea eax, [esi + 8]
push edi
push eax
lea ecx, [esp + 0x10]
call fcn.004035a0
push 0xc
push 0x420cb0
lea ecx, [esp + 0x14]
mov dword [esp + 0x598], 0
call fcn.00403420
xor eax, eax
mov byte [esp + 0x48], 0
mov ecx, 0xff
lea edi, [esp + 0x49]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
cmp dword [esi + 0x1c], ebx
jb 0x4062df
mov ecx, dword [esi + 8]
jmp 0x4062e2
lea ecx, [esi + 8]
lea edx, [esp + 0x48]
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x4062e6
lea edi, [esp + 0x48]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4062f5
mov eax, dword [0x420cb0]
mov ecx, dword [0x420cb4]
mov edx, dword [0x420cb8]
mov dword [edi], eax
mov al, byte [0x420cbc]
mov dword [edi + 4], ecx
lea ecx, [esp + 0x48]
mov dword [edi + 8], edx
push ecx
mov byte [edi + 0xc], al
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x40635d
mov eax, dword [esp + 0xc]
add eax, 0xfffffff0
mov dword [esp + 0x590], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x406356
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
xor eax, eax
jmp 0x406620
cmp dword [esi + 0x1c], ebx
jb 0x406367
mov ecx, dword [esi + 8]
jmp 0x40636a
lea ecx, [esi + 8]
lea edx, [esp + 0x48]
mov edi, edi
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x406370
push ebp
mov ebp, dword [sym.imp.SHLWAPI.dll_PathCombineA]
push 0x420d2c
lea eax, [esp + 0x50]
push eax
mov ecx, eax
push ecx
call ebp
lea edx, [esp + 0x44c]
push edx
lea eax, [esp + 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov ebx, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
mov dword [esp + 0x14], eax
lea ecx, [ecx]
test byte [esp + 0x44c], 0x10
je 0x4065cf
cmp byte [esp + 0x478], 0x2e
je 0x4065cf
mov eax, dword [esi + 0x1c]
mov edi, 0x10
cmp eax, edi
jb 0x4063dd
mov ecx, dword [esi + 8]
jmp 0x4063e0
lea ecx, [esi + 8]
lea edx, [esp + 0x4c]
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x4063e4
lea ecx, [esp + 0x478]
push ecx
lea edx, [esp + 0x50]
push edx
mov eax, edx
push eax
call ebp
push str.ConfigConfig.ini
lea ecx, [esp + 0x50]
push ecx
mov edx, ecx
push edx
call ebp
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x406448
mov al, byte [esp + 0x59c]
test al, al
je 0x406435
lea ecx, [esp + 0x4c]
push ecx
push str.ThunderAgent.Agent.1
jmp 0x40643c
lea edx, [esp + 0x4c]
push edx
push 0
push str.Downloader
push str.Download
call ebx
cmp dword [esi + 0x1c], edi
jb 0x406452
mov ecx, dword [esi + 8]
jmp 0x406455
lea ecx, [esi + 8]
lea edx, [esp + 0x4c]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x406460
lea eax, [esp + 0x478]
push eax
lea ecx, [esp + 0x50]
push ecx
mov edx, ecx
push edx
call ebp
push str.ConfigPlugins.ini
lea eax, [esp + 0x50]
push eax
mov ecx, eax
push ecx
call ebp
lea edx, [esp + 0x4c]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x4065cf
push 0
push 0x80
push 3
push 0
push 3
push 0xc0000000
lea eax, [esp + 0x64]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x406576
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
lea ecx, [ebp + 1]
push ecx
call fcn.004186e2
add esp, 4
mov esi, eax
xor edx, edx
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x28], edx
lea ecx, [esp + 0x24]
push ecx
mov dword [esp + 0x30], edx
push ebp
mov dword [esp + 0x38], edx
push esi
mov dword [esp + 0x40], edx
push edi
mov dword [esp + 0x34], 0
mov dword [esp + 0x48], edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov byte [esi + ebp], 0
cmp byte [esi], 0xef
jne 0x40655c
cmp byte [esi + 1], 0xbb
jne 0x40655c
cmp byte [esi + 2], 0xbf
jne 0x40655c
xor edx, edx
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x40], edx
lea eax, [esp + 0x38]
push eax
mov dword [esp + 0x48], edx
lea ecx, [esp + 0x20]
push ecx
add ebp, 0xfffffffe
mov dword [esp + 0x50], edx
push ebp
lea edx, [esi + 3]
push edx
push edi
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call fcn.004186e7
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [sym.imp.SHLWAPI.dll_PathCombineA]
mov esi, dword [esp + 0x18]
mov al, byte [esp + 0x59c]
test al, al
je 0x4065a3
lea eax, [esp + 0x4c]
push eax
push 0x42067c
push str.Thunder
push str.Paths
call ebx
lea ecx, [esp + 0x4c]
push ecx
push 0x42067c
jmp 0x4065c3
lea edx, [esp + 0x4c]
push edx
push 0x42070c
push str.Thunder
push str.Paths
call ebx
lea eax, [esp + 0x4c]
push eax
push 0x42070c
push str.ThunderAtOnce
push str.Paths
call ebx
mov edi, dword [esp + 0x14]
lea ecx, [esp + 0x44c]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x4063b0
push edi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
mov dword [esp + 0x594], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
pop ebp
jg 0x40661b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, 1
mov ecx, dword [esp + 0x588]
pop edi
pop ebx
pop esi
mov dword fs:[0], ecx
add esp, 0x588
ret 4