Function at 0x402140
Capabilities:
Enumerate files on windows
Enumerate files recursively
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa84
lea eax, [ebp - 0xa84]
push ebx
push esi
push edi
push 0x830
xor esi, esi
push esi
push eax
call fcn.0040f640
mov edx, dword [ebp + 8]
add esp, 0xc
movzx ecx, word [edx]
test cx, cx
je 0x402185
xor eax, eax
inc esi
mov word [ebp + eax - 0xa84], cx
lea eax, [esi + esi]
movzx ecx, word [eax + edx]
test cx, cx
jne 0x402170
lea edi, [ebp - 0xa84]
cmp word [edi + esi*2 - 2], 0x5c
lea edi, [edi + esi*2]
je 0x4021ad
mov eax, 0x5c
inc esi
mov word [edi], ax
lea edi, [ebp - 0xa84]
lea edi, [edi + esi*2]
xor eax, eax
mov word [edi], ax
call fcn.00407630
cmp dword [ebp + 0xc], 0
mov ebx, eax
je 0x4021d8
lea ecx, [ebx + 0x190]
push ecx
lea eax, [ebp - 0xa84]
push eax
call fcn.00407520
add esp, 8
test eax, eax
jne 0x402417
mov eax, 0x2a
mov word [edi], ax
lea eax, [ebp - 0x254]
push eax
lea eax, [ebp - 0xa84]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
xor ecx, ecx
mov dword [ebp - 4], eax
mov dword [ebp + 8], ecx
cmp eax, 0xffffffff
jne 0x402223
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0xa84]
push eax
push str.____FindFirstFileW__ws__call_error__code:__d_n
call fcn.00406020
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 0x10]
nop word [eax + eax]
test byte [ebp - 0x254], 0x10
je 0x4022ca
cmp word [ebp - 0x228], 0x2e
jne 0x40226b
mov ax, word [ebp - 0x226]
test ax, ax
je 0x402354
cmp ax, 0x2e
jne 0x40226b
cmp word [ebp - 0x224], 0
je 0x402354
lea eax, [ebp - 0x228]
push eax
push str.Find_dir:__ws_n
call fcn.00406020
lea eax, [ebp - 0x228]
push eax
call fcn.004020e0
add esp, 0xc
test eax, eax
je 0x402354
lea ecx, [ebp - 0x228]
mov edx, edi
mov eax, ecx
sub edx, eax
nop
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x4022a0
mov eax, dword [ebp + 0xc]
inc eax
push esi
push eax
lea eax, [ebp - 0xa84]
push eax
call fcn.00402140
add esp, 0xc
jmp 0x402354
lea eax, [ebp - 0x228]
push eax
call fcn.00401ee0
add esp, 4
test eax, eax
je 0x402354
lea ecx, [ebp - 0x228]
mov edx, edi
mov eax, ecx
sub edx, eax
nop dword [eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x4022f0
lea eax, [ebp - 0xa84]
push eax
push str.Find_file:__ws_n
call fcn.00406020
add esp, 8
cmp dword [ebp - 0x238], 0
jne 0x402326
cmp dword [ebp - 0x234], 0
je 0x402354
cmp byte [ebx + 0x190], 0
lea eax, [ebp - 0xa84]
je 0x402341
push eax
push ebx
call fcn.00401df0
add esp, 8
jmp 0x40234d
push 1
push esi
push eax
call fcn.00402420
add esp, 0xc
mov dword [ebp + 8], 1
lea eax, [ebp - 0x254]
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x402230
mov ecx, dword [ebp + 8]
test ecx, ecx
je 0x402417
lea ecx, [ebx + 0x3d4]
sub edi, ecx
nop
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edi + ecx - 2], ax
test ax, ax
jne 0x402380
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0xa84]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4023fc
push 0
lea eax, [ebp + 0xc]
mov dword [ebp + 0xc], 0
push eax
push dword [ebx + 0x5e0]
push dword [ebx + 0x5dc]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4023ee
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.____WriteFile_Note__failed__erorr_code__d_n
call fcn.00406020
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0xa84]
push eax
push str.____Error_create_Note_file__s__error_code__d_n
call fcn.00406020
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret