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

Disassembly:
mov eax, 0x14c8
call fcn.0040a320
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x14dc]
xor ebx, ebx
cmp edi, ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x28], ebx
je 0x4054b1
push 0x5c
push edi
call dword [sym.imp.msvcrt.dll_strchr]
add esp, 8
test eax, eax
je 0x4054b1
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0xd4]
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 0x4054c5
lea ecx, [esp + 0xd4]
push 0xff
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x4c]
push ebx
lea eax, [esp + 0xd8]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_OpenFile]
mov esi, eax
cmp esi, ebx
je 0x4054fc
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x3c]
push ecx
lea eax, [esp + 0x38]
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [sym.imp.msvcrt.dll_fopen]
lea ecx, [esp + 0xd4]
push 0x40d164
push ecx
call ebp
add esp, 8
cmp eax, ebx
mov dword [esp + 0x44], eax
je 0x405a6e
push 1
push ebx
push ebx
mov ebx, dword [esp + 0x14ec]
push 0x40d238
push ebx
call fcn.00402500
add esp, 0x14
test eax, eax
je 0x40555b
push 0
push 0xffffffffffffffff
push 0
push ebx
call fcn.00404ed0
add esp, 0x10
test eax, eax
je 0x40555b
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x80
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov eax, dword [esp + 0x14ec]
lea edx, [esp + 0xd4]
test eax, eax
mov edi, 0x40d438
jne 0x405583
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 + 0xd4]
push ecx
push ebx
call ebp
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x405a51
or ecx, 0xffffffff
mov edi, 0x40d434
xor eax, eax
lea edx, [esp + 0x20]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x20]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40d430
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x20]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40d430
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor edi, edi
mov eax, dword [esp + 0x44]
lea ecx, [esp + 0xd4]
push eax
push 0x1400
push 1
push ecx
call dword [sym.imp.msvcrt.dll_fread]
mov esi, eax
add esp, 0x10
test esi, esi
je 0x4056ed
push 1
push 0
push 0
push 0x40d238
push ebx
call fcn.00402500
add esp, 0x14
test eax, eax
jne 0x40568f
push 1
push eax
push eax
push 0x40d428
push ebx
call fcn.00402500
add esp, 0x14
test eax, eax
je 0x4056ba
push 1
push 0
lea edx, [esp + 0x28]
push esi
lea eax, [esp + 0xe0]
push edx
push eax
call fcn.00402500
mov edi, eax
add esp, 0x14
test edi, edi
je 0x4056ba
mov esi, edi
lea ecx, [esp + 0xd4]
sub esi, ecx
push ebp
push esi
lea edx, [esp + 0xdc]
push 1
push edx
call dword [sym.imp.msvcrt.dll_fwrite]
add esp, 0x10
test eax, eax
je 0x4056e5
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x48], 1
add ecx, eax
mov dword [esp + 0x28], ecx
test edi, edi
je 0x40563a
mov esi, dword [esp + 0x28]
test esi, esi
je 0x40583d
mov eax, dword [esp + 0x14e4]
test eax, eax
je 0x40583d
push 1
push 0
push 0
push 0x40d238
push ebx
call fcn.00402500
add esp, 0x14
test eax, eax
jne 0x40573a
push 1
push eax
push eax
push 0x40d428
push ebx
call fcn.00402500
add esp, 0x14
test eax, eax
je 0x40583d
call fcn.00402320
mov ecx, eax
mov eax, 0xaaaaaaab
shr esi, 0xa
mul esi
mov esi, edx
mov eax, ecx
shr esi, 1
xor edx, edx
mov ecx, 0x64
div esi
lea edi, [esp + 0x20]
push ebp
mov eax, edx
xor edx, edx
div ecx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edi, dword [sym.imp.msvcrt.dll_fwrite]
not ecx
dec ecx
push ecx
push 1
mov esi, edx
lea edx, [esp + 0x2c]
push edx
call edi
add esp, 0x10
mov eax, esi
dec esi
test eax, eax
je 0x40583d
inc esi
call fcn.00402320
cdq
mov ecx, 0xff
idiv ecx
mov ebx, edx
call fcn.00402320
and eax, 0x800003ff
jns 0x4057b2
dec eax
or eax, 0xfffffc00
inc eax
mov byte [esp + eax + 0xd4], bl
call fcn.00402320
cdq
mov ecx, 0xff
idiv ecx
mov ebx, edx
call fcn.00402320
and eax, 0x800003ff
jns 0x4057db
dec eax
or eax, 0xfffffc00
inc eax
mov byte [esp + eax + 0xd4], bl
call fcn.00402320
cdq
mov ecx, 0xff
idiv ecx
mov ebx, edx
call fcn.00402320
and eax, 0x800003ff
jns 0x405804
dec eax
or eax, 0xfffffc00
inc eax
push ebp
mov byte [esp + eax + 0xd8], bl
call fcn.00402320
and eax, 0x800003ff
jns 0x40581f
dec eax
or eax, 0xfffffc00
inc eax
push eax
lea edx, [esp + 0xdc]
push 1
push edx
call edi
add esp, 0x10
dec esi
jne 0x405790
mov ebx, dword [esp + 0x14e0]
push ebp
call dword [sym.imp.msvcrt.dll_fclose]
mov eax, dword [esp + 0x38]
add esp, 4
test eax, eax
je 0x405a32
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x405a32
lea eax, [esp + 0x4c]
push 1
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_OpenFile]
mov ebp, eax
test ebp, ebp
je 0x405a32
mov eax, dword [esp + 0x14e8]
test eax, eax
je 0x405a15
mov edi, dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
lea ecx, [esp + 0x10]
lea edx, [esp + 0x34]
push ecx
push edx
call edi
mov esi, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
test eax, eax
je 0x405913
call fcn.00402320
and eax, 0x80000003
jns 0x4058b3
dec eax
or eax, 0xfffffffc
inc eax
sub eax, 4
add word [esp + 0x10], ax
call fcn.00402320
cdq
mov ecx, 0xc
idiv ecx
inc edx
mov word [esp + 0x12], dx
call fcn.00402320
cdq
mov ecx, 0x1c
idiv ecx
inc edx
mov word [esp + 0x16], dx
call fcn.00402320
cdq
mov ecx, 0x3c
idiv ecx
inc edx
mov word [esp + 0x18], dx
call fcn.00402320
cdq
mov ecx, 0x3c
idiv ecx
lea eax, [esp + 0x10]
inc edx
mov word [esp + 0x1a], dx
lea edx, [esp + 0x34]
push edx
push eax
call esi
lea ecx, [esp + 0x10]
lea edx, [esp + 0x3c]
push ecx
push edx
call edi
test eax, eax
je 0x405994
call fcn.00402320
and eax, 0x80000003
jns 0x405934
dec eax
or eax, 0xfffffffc
inc eax
sub eax, 4
add word [esp + 0x10], ax
call fcn.00402320
cdq
mov ecx, 0xc
idiv ecx
inc edx
mov word [esp + 0x12], dx
call fcn.00402320
cdq
mov ecx, 0x1c
idiv ecx
inc edx
mov word [esp + 0x16], dx
call fcn.00402320
cdq
mov ecx, 0x3c
idiv ecx
inc edx
mov word [esp + 0x18], dx
call fcn.00402320
cdq
mov ecx, 0x3c
idiv ecx
lea eax, [esp + 0x10]
inc edx
mov word [esp + 0x1a], dx
lea edx, [esp + 0x3c]
push edx
push eax
call esi
lea ecx, [esp + 0x10]
lea edx, [esp + 0x2c]
push ecx
push edx
call edi
test eax, eax
je 0x405a15
call fcn.00402320
and eax, 0x80000003
jns 0x4059b5
dec eax
or eax, 0xfffffffc
inc eax
sub eax, 4
add word [esp + 0x10], ax
call fcn.00402320
cdq
mov ecx, 0xc
idiv ecx
inc edx
mov word [esp + 0x12], dx
call fcn.00402320
cdq
mov ecx, 0x1c
idiv ecx
inc edx
mov word [esp + 0x16], dx
call fcn.00402320
cdq
mov ecx, 0x3c
idiv ecx
inc edx
mov word [esp + 0x18], dx
call fcn.00402320
cdq
mov ecx, 0x3c
idiv ecx
lea eax, [esp + 0x10]
inc edx
mov word [esp + 0x1a], dx
lea edx, [esp + 0x2c]
push edx
push eax
call esi
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x3c]
push ecx
lea eax, [esp + 0x38]
push edx
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14e4]
test eax, eax
jne 0x405a48
mov eax, dword [esp + 0x14e8]
test eax, eax
je 0x405a51
push 2
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov ecx, dword [esp + 0x44]
push ecx
call dword [sym.imp.msvcrt.dll_fclose]
mov eax, dword [esp + 0x4c]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14c8
ret
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x14c8
ret