Function at 0x4089f9
Capabilities:
Check os version
Get common file path
Get file size
Move file
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x428fec
call fcn.00410ccc
sub esp, 0x454
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
xor ebx, ebx
cmp edi, ebx
jne 0x408a3a
mov eax, dword [ebp + 0xc]
push 1
push dword [ebp + 0x14]
mov dword [ebp - 0x2c], eax
push eax
push dword [ebp + 8]
call fcn.0040890a
mov esi, eax
add esp, 0x10
cmp esi, 2
jle 0x408a72
mov eax, esi
jmp 0x4094a7
push 1
mov dword [ebp - 0x2c], edi
push dword [ebp + 0x14]
push edi
push dword [ebp + 8]
call fcn.0040890a
mov esi, eax
add esp, 0x10
cmp esi, ebx
je 0x408a60
cmp esi, 2
jle 0x408a72
cmp esi, 4
jg 0x408a72
jmp 0x408a33
push edi
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
je 0x409435
xor eax, eax
cmp esi, ebx
sete al
mov esi, 0x94
mov dword [ebp - 0x34], eax
push esi
lea eax, [ebp - 0x204]
push ebx
push eax
call fcn.00410eb0
add esp, 0xc
lea eax, [ebp - 0x204]
mov dword [ebp - 0x204], esi
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
jne 0x408ac8
push ebx
push str.GetVersionEx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 1
push dword [ebp + 8]
call fcn.00409a6a
add esp, 0x14
jmp 0x4094a4
cmp dword [ebp - 0x1f4], 1
jne 0x409094
mov esi, str.WININIT.INI
lea edi, [ebp - 0x6c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov dword [ebp - 0x1c], ebx
mov eax, dword [0x436704]
mov dword [ebp - 4], 3
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], eax
mov esi, 0xf7
lea eax, [ebp - 0x170]
push esi
push eax
mov byte [ebp - 4], 5
mov dword [ebp - 0x30], ebx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
cmp eax, ebx
je 0x409055
cmp eax, esi
jae 0x40905d
cmp byte [ebp - 0x170], 0
je 0x408b3f
lea eax, [ebp - 0x170]
push eax
call fcn.00411260
cmp byte [ebp + eax - 0x171], 0x5c
pop ecx
je 0x408b52
lea eax, [ebp - 0x170]
push 0x434124
push eax
call fcn.00411120
pop ecx
pop ecx
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x170]
push eax
call fcn.00411120
push ebx
lea eax, [ebp - 0x170]
push dword [ebp + 0x14]
push eax
push dword [ebp + 8]
call fcn.0040890a
add esp, 0x18
cmp eax, 2
jg 0x409051
cmp eax, ebx
jne 0x408b8e
cmp dword [ebp - 0x34], ebx
jne 0x409051
push ebx
push 0x80
push 4
push ebx
push ebx
lea eax, [ebp - 0x170]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0x1c], esi
jne 0x408bc5
lea eax, [ebp - 0x170]
push eax
push str.CreateFile
jmp 0x409041
lea eax, [ebp - 0x30]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
jne 0x408bf2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
je 0x408bf2
lea ecx, [ebp - 0x170]
push ecx
push str.GetFileSize
jmp 0x408fed
cmp dword [ebp - 0x30], ebx
jne 0x408bff
cmp edi, 0x7fffffff
jb 0x408c04
call fcn.0041dc5c
lea eax, [edi + 1]
push eax
call fcn.0041f286
mov esi, eax
lea eax, [edi + 1]
mov byte [ebp - 4], 6
push eax
push ebx
push esi
mov dword [ebp - 0x38], esi
call fcn.00410eb0
add esp, 0x10
cmp edi, ebx
jbe 0x408c90
lea eax, [ebp - 0x44]
push ebx
push eax
push edi
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x408c90
lea eax, [ebp - 0x170]
push eax
push str.ReadFile
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 1
push dword [ebp + 8]
call fcn.00409a6a
add esp, 0x14
cmp esi, ebx
je 0x408c67
push esi
call fcn.00410dc4
pop ecx
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.0041ede8
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 3
call fcn.0041ede8
cmp dword [ebp - 0x1c], ebx
je 0x4094a4
push dword [ebp - 0x1c]
jmp 0x40901c
push esi
lea ecx, [ebp - 0x10]
call fcn.0041ef25
cmp esi, ebx
mov byte [ebp - 4], 5
je 0x408ca8
push esi
call fcn.00410dc4
pop ecx
push dword [ebp - 0x2c]
push dword [ebp - 0x10]
call fcn.0040889c
xor edi, edi
pop ecx
cmp eax, edi
pop ecx
mov dword [ebp - 0x18], eax
mov esi, 0x434b00
mov ebx, 0x434ccc
jl 0x408dd9
jmp 0x408cd0
xor edi, edi
mov eax, dword [ebp - 0x18]
cmp eax, edi
mov dword [ebp - 0x24], eax
jle 0x408cef
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x24]
cmp byte [eax + ecx - 1], 0xa
je 0x408cef
dec dword [ebp - 0x24]
cmp dword [ebp - 0x24], edi
jg 0x408cda
push dword [ebp - 0x18]
lea ecx, [ebp - 0x10]
push esi
call fcn.0041d732
mov edi, eax
inc edi
inc edi
cmp edi, 2
jge 0x408d0a
mov eax, dword [ebp - 0x10]
mov edi, dword [eax - 8]
push dword [ebp - 0x18]
lea ecx, [ebp - 0x10]
push ebx
call fcn.0041d732
inc eax
test eax, eax
jle 0x408db0
cmp eax, edi
jge 0x408db0
mov ecx, dword [0x436704]
mov dword [ebp - 0x18], ecx
mov ecx, edi
mov byte [ebp - 4], 7
sub ecx, eax
push ecx
push eax
lea eax, [ebp - 0x20]
lea ecx, [ebp - 0x10]
push eax
call fcn.0041d578
push eax
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 8
call fcn.0041eed5
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 7
call fcn.0041ede8
lea ecx, [ebp - 0x18]
call fcn.0041db9e
lea ecx, [ebp - 0x18]
call fcn.0041db52
mov eax, dword [ebp - 0x18]
cmp dword [eax - 8], 0
je 0x408da4
cmp dword [ebp + 0x10], 0
je 0x408d8d
push dword [ebp + 0xc]
push eax
call fcn.00411da0
pop ecx
test eax, eax
pop ecx
je 0x408da4
push 1
lea eax, [ebp - 0x460]
push dword [ebp + 0x14]
push dword [ebp - 0x18]
push eax
call fcn.0040890a
add esp, 0x10
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 5
call fcn.0041ede8
sub edi, dword [ebp - 0x24]
lea ecx, [ebp - 0x10]
push edi
push dword [ebp - 0x24]
call fcn.0041d284
push dword [ebp - 0x2c]
push dword [ebp - 0x10]
call fcn.0040889c
pop ecx
mov dword [ebp - 0x18], eax
test eax, eax
pop ecx
jge 0x408cce
xor edi, edi
cmp dword [ebp - 0x34], edi
jne 0x408f56
cmp dword [ebp + 0x10], edi
push str.NUL
jne 0x408e45
lea ecx, [ebp - 0x20]
call fcn.0041ee56
push dword [ebp + 0xc]
mov byte [ebp - 4], 9
push eax
lea eax, [ebp + 0x14]
push eax
call fcn.0041eff0
push esi
push eax
lea eax, [ebp + 0x10]
mov byte [ebp - 4], 0xa
push eax
call fcn.0041eff0
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0xb
call fcn.0041eed5
lea ecx, [ebp + 0x10]
mov byte [ebp - 4], 0xa
call fcn.0041ede8
lea ecx, [ebp + 0x14]
mov byte [ebp - 4], 9
call fcn.0041ede8
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x20]
jmp 0x408f10
lea ecx, [ebp - 0x28]
call fcn.0041ee56
push dword [ebp + 0x10]
mov byte [ebp - 4], 0xc
push eax
lea eax, [ebp - 0x20]
push eax
call fcn.0041eff0
push esi
push eax
lea eax, [ebp + 0x14]
mov byte [ebp - 4], 0xd
push eax
call fcn.0041eff0
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0xe
call fcn.0041eed5
lea ecx, [ebp + 0x14]
mov byte [ebp - 4], 0xd
call fcn.0041ede8
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 0xc
call fcn.0041ede8
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 5
call fcn.0041ede8
push dword [ebp + 0x10]
lea ecx, [ebp - 0x28]
call fcn.0041ee56
push ebx
push eax
lea eax, [ebp - 0x20]
mov byte [ebp - 4], 0xf
push eax
call fcn.0041eff0
push dword [ebp + 0xc]
mov byte [ebp - 4], 0x10
push eax
lea eax, [ebp + 0x14]
push eax
call fcn.0041eff0
push esi
push eax
lea eax, [ebp + 0x10]
mov byte [ebp - 4], 0x11
push eax
call fcn.0041eff0
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0x12
call fcn.0041f15e
lea ecx, [ebp + 0x10]
mov byte [ebp - 4], 0x11
call fcn.0041ede8
lea ecx, [ebp + 0x14]
mov byte [ebp - 4], 0x10
call fcn.0041ede8
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 0xf
call fcn.0041ede8
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x28]
call fcn.0041ede8
push str._rename_
push dword [ebp - 0x10]
call fcn.0040889c
pop ecx
cmp eax, edi
pop ecx
jl 0x408f36
push eax
push esi
lea ecx, [ebp - 0x10]
call fcn.0041d732
cmp eax, edi
jge 0x408f47
push str._rename__r_n
push edi
lea ecx, [ebp - 0x10]
call fcn.0041d360
push 8
pop eax
push dword [ebp - 0x14]
add eax, 2
lea ecx, [ebp - 0x10]
push eax
call fcn.0041d360
mov esi, dword [ebp - 0x1c]
push edi
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x408fa4
lea eax, [ebp - 0x170]
push eax
push str.SetFilePointer
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 1
push dword [ebp + 8]
call fcn.00409a6a
add esp, 0x14
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.0041ede8
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 3
call fcn.0041ede8
cmp esi, edi
jmp 0x409015
mov edi, dword [ebp - 0x10]
xor ebx, ebx
lea eax, [ebp - 0x40]
push ebx
push eax
push edi
call fcn.00411260
pop ecx
push eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408fd0
lea eax, [ebp - 0x170]
push eax
push str.WriteFile
jmp 0x408fe7
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x409027
lea eax, [ebp - 0x170]
push eax
push str.SetEndOfFile
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 1
push dword [ebp + 8]
call fcn.00409a6a
add esp, 0x14
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.0041ede8
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 3
call fcn.0041ede8
cmp esi, ebx
je 0x4094a4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4094a4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, ebx
mov dword [ebp - 0x1c], ebx
jne 0x409049
lea eax, [ebp - 0x170]
push eax
push str.CloseHandle
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x409066
xor eax, eax
cmp dword [ebp - 0x34], ebx
sete al
mov esi, eax
jmp 0x409077
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x409060
push 0x7a
pop eax
push ebx
push str.GetWindowsDirectory
push eax
push 1
push dword [ebp + 8]
call fcn.00409a6a
add esp, 0x14
push 4
pop esi
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.0041ede8
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 3
call fcn.0041ede8
jmp 0x408a33
push 7
mov esi, str.PendingFileRenameOperations
pop ecx
lea edi, [ebp - 0x60]
rep movsd dword es:[edi], dword [esi]
mov dword [ebp - 0x10], ebx
mov dword [ebp - 4], 0x13
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x38], ebx
push 0x100
lea eax, [ebp - 0x16c]
push ebx
push eax
mov byte [ebp - 4], 0x14
mov dword [ebp - 0x20], ebx
call fcn.00410eb0
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x10]
push eax
push 3
push str.SYSTEMCurrentControlSetControlSession_Manager
push 0x80000002
lea eax, [ebp - 0x16c]
push esi
push eax
call fcn.00409c02
add esp, 0x24
cmp dword [esi], ebx
jne 0x40932f
lea eax, [ebp - 0x14]
push 7
push eax
push ebx
lea eax, [ebp - 0x60]
push ebx
push eax
lea eax, [ebp - 0x16c]
push dword [ebp - 0x10]
push esi
push eax
call fcn.00409d26
mov eax, dword [esi]
add esp, 0x20
cmp eax, ebx
jne 0x40934d
cmp dword [ebp - 0x14], ebx
je 0x409344
push dword [ebp - 0x14]
call fcn.0041f286
mov ebx, eax
lea eax, [ebp - 0x14]
push 7
push eax
xor edi, edi
push ebx
lea eax, [ebp - 0x60]
push edi
push eax
lea eax, [ebp - 0x16c]
push dword [ebp - 0x10]
mov dword [ebp - 0x38], ebx
push esi
push eax
call fcn.00409d26
add esp, 0x24
cmp dword [esi], edi
jne 0x40935b
cmp dword [ebp - 0x14], 1
mov dword [ebp - 0x1c], edi
jbe 0x409361
mov eax, dword [ebp - 0x1c]
mov esi, 0x434c08
lea edi, [ebp - 0x40]
add eax, ebx
movsd dword es:[edi], dword [esi]
push eax
mov dword [ebp - 0x30], eax
movsb byte es:[edi], byte [esi]
call fcn.00411260
mov esi, eax
mov eax, dword [ebp - 0x1c]
inc esi
pop ecx
add eax, esi
lea ecx, [eax + 2]
cmp ecx, dword [ebp - 0x14]
ja 0x40929a
add eax, ebx
push eax
mov dword [ebp - 0x28], eax
call fcn.00411260
lea edi, [esi + eax + 1]
mov eax, dword [ebp - 0x1c]
pop ecx
lea esi, [edi + eax]
lea eax, [esi + 1]
cmp eax, dword [ebp - 0x14]
ja 0x40929a
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 0x30]
call fcn.004119e0
pop ecx
mov dword [ebp - 0x18], eax
test eax, eax
pop ecx
je 0x4091d4
add dword [ebp - 0x18], 4
jmp 0x4091da
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 0x28]
call fcn.004119e0
pop ecx
mov dword [ebp - 0x24], eax
test eax, eax
pop ecx
je 0x4091f5
add dword [ebp - 0x24], 4
jmp 0x409205
mov eax, dword [ebp - 0x28]
xor ecx, ecx
cmp byte [eax], 0x21
sete cl
add ecx, eax
mov dword [ebp - 0x24], ecx
push dword [ebp - 0x2c]
push dword [ebp - 0x18]
call fcn.00411da0
pop ecx
test eax, eax
pop ecx
je 0x40922c
push dword [ebp - 0x2c]
push dword [ebp - 0x24]
call fcn.00411da0
pop ecx
test eax, eax
pop ecx
je 0x40922c
mov dword [ebp - 0x1c], esi
jmp 0x40928d
push dword [ebp - 0x2c]
push dword [ebp - 0x18]
call fcn.00411da0
pop ecx
test eax, eax
pop ecx
je 0x40926b
cmp dword [ebp + 0x10], 0
je 0x409254
push dword [ebp + 0xc]
push dword [ebp - 0x18]
call fcn.00411da0
pop ecx
test eax, eax
pop ecx
je 0x40926b
push 1
lea eax, [ebp - 0x460]
push dword [ebp + 0x14]
push dword [ebp - 0x18]
push eax
call fcn.0040890a
add esp, 0x10
mov eax, dword [ebp - 0x14]
sub eax, edi
sub eax, dword [ebp - 0x1c]
push eax
lea eax, [ebx + esi]
push eax
push dword [ebp - 0x30]
call fcn.00411a60
add esp, 0xc
sub dword [ebp - 0x14], edi
mov dword [ebp - 0x20], 1
mov eax, dword [ebp - 0x1c]
inc eax
cmp eax, dword [ebp - 0x14]
jb 0x40916a
xor edi, edi
cmp dword [ebp - 0x20], edi
je 0x409361
cmp dword [ebp - 0x14], 1
jbe 0x4092cd
push dword [ebp - 0x14]
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x60]
push ebx
push 7
push eax
lea eax, [ebp - 0x16c]
push dword [ebp - 0x10]
push esi
push eax
call fcn.00409f62
add esp, 0x1c
jmp 0x4092e7
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x60]
push eax
lea eax, [ebp - 0x16c]
push dword [ebp - 0x10]
push esi
push eax
call fcn.00409fb4
add esp, 0x10
cmp dword [esi], edi
jne 0x40935b
push dword [ebp - 0x10]
lea eax, [ebp - 0x16c]
push esi
push eax
call fcn.0040a065
add esp, 0xc
cmp dword [esi], edi
mov dword [ebp - 0x10], edi
jne 0x409376
cmp ebx, edi
je 0x409310
push ebx
call fcn.00410dc4
pop ecx
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x10], edi
je 0x409322
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x34], 0
je 0x40939c
xor eax, eax
jmp 0x4094a7
mov eax, dword [ebp + 8]
cmp dword [eax + 4], 2
je 0x40933d
cmp dword [ebp - 0x10], ebx
jmp 0x409388
push eax
call fcn.0040992e
pop ecx
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x10], ebx
jmp 0x409317
cmp eax, 1
jne 0x409358
cmp dword [esi + 4], 2
jne 0x409338
push esi
jmp 0x40933e
cmp ebx, edi
je 0x409385
jmp 0x40937e
test ebx, ebx
je 0x40936c
push ebx
call fcn.00410dc4
pop ecx
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x10], 0
jmp 0x409317
cmp ebx, edi
je 0x4094a4
push ebx
call fcn.00410dc4
pop ecx
cmp dword [ebp - 0x10], edi
je 0x4094a4
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4094a4
mov esi, dword [ebp + 0x10]
xor eax, eax
test esi, esi
setne al
add eax, 4
push eax
push esi
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
test eax, eax
jne 0x409431
test esi, esi
jne 0x4093c1
mov esi, str.NULL
push dword [ebp + 0xc]
lea ecx, [ebp + 0x14]
call fcn.0041ee56
push 0x434298
push eax
lea eax, [ebp + 0x10]
mov dword [ebp - 4], 0x15
push eax
call fcn.0041eff0
push esi
push eax
lea eax, [ebp + 0xc]
mov byte [ebp - 4], 0x16
push eax
call fcn.0041eff0
push dword [eax]
mov byte [ebp - 4], 0x17
push str.MoveFileEx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 1
push dword [ebp + 8]
call fcn.00409a6a
add esp, 0x14
lea ecx, [ebp + 0xc]
mov byte [ebp - 4], 0x16
call fcn.0041ede8
lea ecx, [ebp + 0x10]
mov byte [ebp - 4], 0x15
call fcn.0041ede8
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x14]
jmp 0x40949f
push 1
jmp 0x4094a6
push dword [ebp + 0xc]
lea ecx, [ebp - 0x28]
call fcn.0041ee56
push 0x434298
push eax
lea eax, [ebp - 0x20]
mov dword [ebp - 4], ebx
push eax
call fcn.0041eff0
push edi
push eax
lea eax, [ebp - 0x38]
mov byte [ebp - 4], 1
push eax
call fcn.0041eff0
push dword [eax]
mov byte [ebp - 4], 2
push str.MoveFile
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 1
push dword [ebp + 8]
call fcn.00409a6a
add esp, 0x14
lea ecx, [ebp - 0x38]
mov byte [ebp - 4], 1
call fcn.0041ede8
and byte [ebp - 4], 0
lea ecx, [ebp - 0x20]
call fcn.0041ede8
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
call fcn.0041ede8
push 4
pop eax
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret