Function at 0x402680
Capabilities:
Create directory
Enumerate files on windows
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x374
mov eax, dword [0x406004]
xor eax, esp
mov dword [esp + 0x370], eax
cmp dword [ebp + 8], 3
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
je 0x4026cc
push dword [edi]
push str.Usage:__s__old_installer_id___new_installer_id__n
call fcn.004029d0
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x370]
xor ecx, esp
call fcn.00402a06
mov esp, ebp
pop ebp
ret
push dword [edi + 4]
mov esi, dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
call esi
add esp, 4
mov dword [esp + 0x18], eax
push dword [edi + 8]
call esi
add esp, 4
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x270]
push str..hkc
push eax
call fcn.00402980
add esp, 8
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x274]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
je 0x40295b
push 0
push str.converted
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
nop dword [eax]
test byte [esp + 0x28], 0x10
jne 0x40289d
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea eax, [esp + 0x6c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x402938
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
je 0x40291d
lea ecx, [edi + 1]
push ecx
call fcn.00402a14
add esp, 4
mov ebx, eax
lea eax, [esp + 0x20]
push 0
push eax
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4028f2
cmp dword [esp + 0x20], edi
jne 0x4028f2
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0xc]
push eax
mov edx, ebx
mov byte [ebx + edi], 0
mov dword [esp + 0x10], 0
call fcn.00401b20
add esp, 4
test al, al
je 0x4028de
mov edx, dword [esp + 0xc]
lea eax, [esp + 0x10]
mov ecx, dword [esp + 0x1c]
push eax
mov dword [esp + 0x14], 0
call fcn.00401750
add esp, 4
test al, al
lea eax, [esp + 0x54]
push eax
je 0x4028cf
lea eax, [esp + 0x16c]
push str.converted_s
push eax
call fcn.00402980
add esp, 0xc
lea eax, [esp + 0x168]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x4028b9
mov esi, dword [esp + 0x10]
mov ecx, esi
mov dword [esp + 0x24], 0
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402850
push 0
lea eax, [esp + 0x28]
sub ecx, edx
push eax
push ecx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.00402a1d
add esp, 4
lea eax, [esp + 0x54]
push eax
push str._s___Ok_n
call fcn.004029d0
push dword [esp + 0x14]
call fcn.00402a1d
add esp, 0xc
push ebx
call fcn.00402a1d
add esp, 4
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x402730
jmp 0x402951
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x16c]
push eax
push str.Unable_to_open_file:___s___error_u_n
jmp 0x402949
push str._s___Unable_to_encrypt_n
call fcn.004029d0
add esp, 8
jmp 0x402951
lea eax, [esp + 0x54]
push eax
push str._s___Unable_to_decrypt_n
call fcn.004029d0
add esp, 8
jmp 0x402951
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x58]
push eax
push str.Unable_to_read_file__file__s___error_d__n
call fcn.004029d0
add esp, 0xc
push ebx
call fcn.00402a1d
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402951
lea eax, [esp + 0x54]
push eax
push str.Invalid_file_size__file__s___n
call fcn.004029d0
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402951
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x58]
push eax
push str.Unable_to_open_file__file__s___error_u__n
call fcn.004029d0
add esp, 0xc
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, dword [esp + 0x37c]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00402a06
mov esp, ebp
pop ebp
ret