Function at 0x401160
Capabilities:
Access pe header
Copy file
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x428
push ebx
push 0x103
lea eax, [ebp - 0x11b]
push 0
push eax
mov byte [ebp - 0x11c], 0
call sub.ntdll.dll_memset
push 0x103
lea ecx, [ebp - 0x21f]
push 0
push ecx
mov byte [ebp - 0x220], 0
call sub.ntdll.dll_memset
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
add esp, 0x18
push 0x104
lea edx, [ebp - 0x220]
push edx
push 0
call ebx
push 0x5c
push 0
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.SHLWAPI.dll_StrRChrA]
test eax, eax
je 0x4011cf
mov byte [eax], 0
lea ecx, [ebp - 0x11c]
push ecx
push 0
push 0
push 0x23
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
test eax, eax
js 0x401544
push esi
mov esi, dword [sym.imp.SHLWAPI.dll_PathIsDirectoryA]
lea edx, [ebp - 0x11c]
push edx
call esi
test eax, eax
je 0x401279
lea eax, [ebp - 0x220]
push eax
call esi
test eax, eax
je 0x401279
mov esi, dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
lea ecx, [ebp - 0x11c]
push ecx
call esi
lea edx, [ebp - 0x220]
push edx
call esi
mov esi, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
push 0x104
lea eax, [ebp - 0x428]
push eax
lea ecx, [ebp - 0x11c]
push ecx
call esi
test eax, eax
je 0x401279
push 0x104
lea edx, [ebp - 0x324]
push edx
lea eax, [ebp - 0x220]
push eax
call esi
test eax, eax
je 0x401279
lea ecx, [ebp - 0x324]
push ecx
lea edx, [ebp - 0x428]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x401543
push edi
lea edi, [ebp - 0x11c]
call fcn.00403406
test eax, eax
je 0x401542
push 0x104
lea eax, [ebp - 0x324]
push eax
push 0
call ebx
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push 3
push 0x80000000
lea ecx, [ebp - 0x324]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40149c
lea edx, [ebp - 0x14]
push edx
xor edi, edi
push esi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov eax, dword [ebp - 0x14]
mov dword [ebp - 4], eax
cmp eax, edi
je 0x401388
cmp dword [0x420b78], edi
jne 0x401305
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov dword [0x420660], eax
mov dword [0x420b78], 1
mov ebx, dword [ebp - 4]
mov ecx, dword [0x420660]
lea eax, [ebx + 0xc]
push eax
push 8
push ecx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
je 0x401330
mov ecx, 0xabbabaab
mov dword [eax], ebx
mov dword [eax + 4], ecx
mov dword [eax + ebx + 8], ecx
lea edi, [eax + 8]
mov ebx, edi
test edi, edi
je 0x401388
mov eax, dword [ebp - 4]
push 0
lea edx, [ebp - 0x18]
push edx
push eax
push edi
push esi
mov dword [ebp - 0x18], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401388
cmp dword [0x420b78], eax
je 0x401386
push edi
call fcn.00403ac0
test eax, eax
je 0x401386
mov edx, dword [edi - 8]
lea eax, [edi - 8]
mov ecx, 0xbeefdead
push eax
mov dword [eax + 4], ecx
mov dword [edx + eax + 8], ecx
mov eax, dword [0x420660]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor ebx, ebx
mov dword [ebp - 8], 0
test esi, esi
je 0x4013af
lea ecx, [ebp - 8]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x4013af
test byte [ebp - 8], 2
jne 0x4013af
push esi
call dword [sym.imp.ntdll.dll_ZwClose]
test ebx, ebx
je 0x40149c
cmp dword [ebp - 4], 0
je 0x40149c
push ebx
call dword [sym.imp.ntdll.dll_RtlImageNtHeader]
mov esi, eax
test esi, esi
je 0x40149c
rdtsc
xor dword [section..data], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [section..data]
xor ecx, eax
xor edx, edx
mov eax, ecx
or edi, 0xffffffff
div edi
xor edi, edi
push edi
push 0x80
push 3
push edi
push 3
push 0x40000000
lea edx, [ebp - 0x11c]
push edx
mov dword [section..data], ecx
add eax, ecx
mov dword [esi + 0x58], eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x401446
push edi
push 0x80
push 2
push edi
push 3
push 0xc0000000
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x401498
mov edx, dword [ebp - 4]
push 0
lea ecx, [ebp - 0xc]
push ecx
push edx
push ebx
push esi
mov dword [ebp - 0xc], edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40146c
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0xc]
jne 0x40146c
mov edi, 1
cmp esi, 0xffffffff
je 0x401498
mov dword [ebp - 4], 0
test esi, esi
je 0x401498
lea ecx, [ebp - 4]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x401498
test byte [ebp - 4], 2
jne 0x401498
push esi
call dword [sym.imp.ntdll.dll_ZwClose]
test edi, edi
jne 0x4014b4
push 1
lea edx, [ebp - 0x11c]
push edx
lea eax, [ebp - 0x324]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
mov edi, eax
test ebx, ebx
je 0x4014ec
cmp dword [0x420b78], 0
je 0x4014ec
push ebx
call fcn.00403ac0
test eax, eax
je 0x4014ec
mov edx, dword [ebx - 8]
lea eax, [ebx - 8]
mov ecx, 0xbeefdead
push eax
mov dword [eax + 4], ecx
mov dword [edx + eax + 8], ecx
mov eax, dword [0x420660]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push 0x104
test edi, edi
jne 0x40151c
push 0x4206a0
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
pop edi
pop esi
mov dword [0x420690], 1
mov dword [0x42068c], 1
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x11c]
push ecx
push 0x4206a0
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
mov dword [0x420690], 0
mov dword [0x42068c], 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret