Function at 0x4090f0
Capabilities:
Clear file content
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x41e7c0
push 0x40c930
mov eax, dword fs:[0]
push eax
sub esp, 8
mov eax, 0x21cc
call fcn.00415af0
mov eax, dword [section..data]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x20], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x2194], edx
mov esi, ecx
mov dword [ebp - 0x21a8], esi
mov dword [ebp - 0x21e0], esi
mov dword [ebp - 0x21cc], edx
xor eax, eax
mov dword [ebp - 0x2198], eax
mov dword [ebp - 0x21ac], eax
mov dword [ebp - 0x218c], eax
mov dword [ebp - 4], eax
push edx
push 0x41e584
call fcn.0040a8ec
add esp, 8
push 0
push 0x80
push 3
push 0
push 0
push 0x80010000
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
call esi
mov edi, eax
mov dword [ebp - 0x21d8], edi
cmp edi, 0xffffffff
jne 0x4091a6
push str.open_file_error__n
call fcn.0040a8ec
add esp, 4
jmp 0x409737
push 0x422070
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x409737
mov ecx, dword [0x422074]
test ecx, ecx
jl 0x409737
mov eax, dword [0x422070]
jg 0x4091d8
cmp eax, 1
jb 0x409737
add eax, 0xfffffc50
mov dword [0x422070], eax
adc ecx, 0xffffffff
mov dword [0x422074], ecx
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp - 0x2194]
call esi
mov esi, eax
mov dword [ebp - 0x218c], esi
cmp esi, 0xffffffff
je 0x409737
mov byte [ebp - 0x50], 0
xorps xmm0, xmm0
movdqu xmmword [ebp - 0x4f], xmm0
movq qword [ebp - 0x3f], xmm0
mov dword [ebp - 0x37], 0
mov word [ebp - 0x33], 0
mov byte [ebp - 0x31], 0
mov byte [ebp - 0x70], 0
movdqu xmmword [ebp - 0x6f], xmm0
movq qword [ebp - 0x5f], xmm0
mov dword [ebp - 0x57], 0
mov word [ebp - 0x53], 0
mov byte [ebp - 0x51], 0
mov byte [ebp - 0x30], 0
movq qword [ebp - 0x2f], xmm0
mov dword [ebp - 0x27], 0
mov word [ebp - 0x23], 0
mov byte [ebp - 0x21], 0
mov byte [ebp - 0x2184], 0
push 0x1fff
push 0
lea eax, [ebp - 0x2183]
push eax
call fcn.00410240
add esp, 0xc
push 0x118
push 0
push 0x422080
call fcn.00410240
xorps xmm0, xmm0
movq qword [0x422064], xmm0
mov dword [0x42206c], 0
mov dword [ebp - 0x21e4], 0x41e12c
add esp, 8
mov edx, 0x41e12c
call fcn.00406b90
add esp, 4
test eax, eax
jne 0x409737
mov dword [ebp - 0x2190], eax
mov dword [ebp - 0x2188], eax
mov byte [ebp - 0x184], al
push 0x80
push eax
lea eax, [ebp - 0x183]
push eax
call fcn.00410240
add esp, 0xc
mov byte [ebp - 0xfc], 0
push 0x80
push 0
lea eax, [ebp - 0xfb]
push eax
call fcn.00410240
add esp, 0xc
push 0xffffffffffffffff
push 0xfffffc50
mov edx, 2
mov ecx, edi
call fcn.004090a0
add esp, 8
push 0
lea eax, [ebp - 0x2188]
push eax
push 0x20
lea eax, [ebp - 0x70]
push eax
push edi
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
call esi
test eax, eax
jne 0x409364
push dword [ebp - 0x2188]
push str.File_read___d_bytes__failed_n
call fcn.0040a8ec
add esp, 8
jmp 0x409737
push 0
lea eax, [ebp - 0x2188]
push eax
push 0x10
lea eax, [ebp - 0x30]
push eax
push edi
call esi
test eax, eax
je 0x40934c
push 0
lea eax, [ebp - 0x2188]
push eax
push 0x80
lea eax, [ebp - 0x184]
push eax
push edi
call esi
test eax, eax
je 0x40934c
lea eax, [ebp - 0xfc]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0x21bc], eax
cmp dword [0x4258a4], 0
jne 0x4093d3
push ecx
lea eax, [ebp - 0xfc]
push eax
lea eax, [ebp - 0x184]
push eax
lea eax, [ebp - 0x21bc]
push eax
sub esp, 8
call fcn.00407b90
add esp, 0x18
push 0
push 0
xor edx, edx
mov ecx, edi
call fcn.004090a0
add esp, 8
movzx eax, byte [ebp - 0x21]
mov dword [ebp - 0x21dc], eax
movdqu xmm0, xmmword [ebp - 0x30]
movdqu xmmword [ebp - 0x50], xmm0
xor esi, esi
mov eax, dword [0x422064]
mov dword [ebp - 0x21c4], esi
cmp esi, 0x2000
jge 0x409462
test eax, eax
je 0x40941e
push dword [0x422068]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
push 0x20
lea edx, [ebp - 0x50]
call fcn.00406bf0
add esp, 4
push dword [ebp - 0x21bc]
lea edx, [ebp - 0xfc]
call fcn.00406bf0
add esp, 4
mov eax, dword [0x422064]
test eax, eax
je 0x40945f
lea ecx, [ebp - 0x50]
push ecx
push dword [0x422068]
mov eax, dword [eax + 0x18]
call eax
add esp, 8
mov eax, dword [0x422064]
inc esi
jmp 0x4093fe
push ecx
lea edx, [ebp - 0x50]
call fcn.004020d0
lea edx, [ebp - 0x50]
call fcn.00406c20
add esp, 4
mov esi, dword [0x422070]
mov dword [ebp - 0x21d0], esi
mov eax, dword [0x422074]
mov dword [ebp - 0x21c0], eax
xor ecx, ecx
jne 0x4094b1
test eax, eax
jl 0x4094b1
jg 0x40949f
cmp esi, 0x500000
jbe 0x4094b1
mov esi, 0x500000
mov dword [0x422070], esi
xor eax, eax
mov dword [0x422074], eax
push 0
push 0x2000
push eax
push esi
call fcn.004197f0
mov dword [ebp - 0x21b8], eax
mov dword [ebp - 0x21c8], edx
push 0
push 0x2000
push dword [0x422074]
push esi
call fcn.004198a0
mov dword [ebp - 0x21a4], eax
mov dword [ebp - 0x21a0], edx
push 0
lea eax, [ebp - 0x2188]
push eax
push 0x2000
lea eax, [ebp - 0x2184]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x409737
xorps xmm0, xmm0
movlpd qword [ebp - 0x21b4], xmm0
mov esi, dword [ebp - 0x21b0]
mov eax, dword [ebp - 0x21b4]
jmp 0x409530
mov edx, dword [ebp - 0x21c8]
cmp esi, edx
jg 0x4095df
jl 0x40954e
mov ecx, dword [ebp - 0x21b8]
cmp eax, ecx
jae 0x4095e5
push 0
push 2
push esi
push eax
call fcn.004198a0
or eax, edx
jne 0x409574
push dword [ebp - 0x2188]
lea edx, [ebp - 0x2184]
lea ecx, [ebp - 0x30]
call fcn.00408fd0
add esp, 4
push 0
lea eax, [ebp - 0x2190]
push eax
push dword [ebp - 0x2188]
lea eax, [ebp - 0x2184]
push eax
push dword [ebp - 0x218c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409737
push 0
lea eax, [ebp - 0x2188]
push eax
push 0x2000
lea eax, [ebp - 0x2184]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x409737
mov eax, dword [ebp - 0x21b4]
add eax, 1
mov dword [ebp - 0x21b4], eax
adc esi, 0
mov dword [ebp - 0x21b0], esi
jmp 0x409530
mov ecx, dword [ebp - 0x21b8]
cmp dword [ebp - 0x21a0], 0
jl 0x409655
mov esi, dword [ebp - 0x21a4]
jg 0x4095fa
test esi, esi
je 0x409655
push 0
push 2
push edx
push ecx
call fcn.004198a0
or eax, edx
jne 0x409635
push esi
lea edx, [ebp - 0x2184]
lea ecx, [ebp - 0x30]
call fcn.00408fd0
add esp, 4
mov eax, dword [ebp - 0x21dc]
neg eax
and eax, 0xf
cdq
sub esi, eax
mov dword [ebp - 0x21a4], esi
sbb dword [ebp - 0x21a0], edx
push 0
lea eax, [ebp - 0x2190]
push eax
push esi
lea eax, [ebp - 0x2184]
push eax
mov esi, dword [ebp - 0x218c]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40965b
mov esi, dword [ebp - 0x218c]
lea edx, [ebp - 0x50]
call fcn.00406e20
xor dl, dl
xor ecx, ecx
mov dword [ebp - 0x21d4], ecx
cmp ecx, 0x20
jge 0x40967f
mov al, byte [ebp + ecx - 0x70]
xor al, byte [ebp + ecx - 0x50]
or dl, al
inc ecx
jmp 0x409667
test dl, dl
je 0x409695
push str.HMAC_check_failed:_wrong_key__or_file_corrupted._n
call fcn.0040a8ec
add esp, 4
jmp 0x409737
mov ecx, dword [0x422074]
cmp dword [ebp - 0x21c0], ecx
jl 0x409726
mov eax, dword [0x422070]
jg 0x4096b6
cmp dword [ebp - 0x21d0], eax
jbe 0x409726
push ecx
push eax
xor edx, edx
mov ecx, edi
call fcn.004090a0
add esp, 8
push 0
lea eax, [ebp - 0x2188]
push eax
push 0x2000
lea eax, [ebp - 0x2184]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea eax, [ebp - 0x2190]
push eax
push dword [ebp - 0x2188]
lea eax, [ebp - 0x2184]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 0x2188], 0x2000
je 0x4096c4
push 0xffffffffffffffff
push 0xfffffc50
mov edx, 2
mov ecx, esi
call fcn.004090a0
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, 1
mov dword [ebp - 0x2198], eax
mov dword [ebp - 0x21ac], eax
mov dword [ebp - 4], 0xfffffffe
call fcn.0040978b
mov eax, esi
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x20]
xor ecx, ebp
call fcn.0040a5bf
mov esp, ebp
pop ebp
ret