Function at 0x406d1b
Capabilities:
Copy file
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x11c
lea eax, [ebp - 0x11c]
push ebx
push esi
push edi
push 0x104
push eax
push dword [0x418060]
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov ebx, dword [ebp + 8]
test eax, eax
je 0x406f29
cmp dword [ebp + 0xc], esi
mov eax, 0x403bfc
mov edi, 0x403bf8
cmovne edi, eax
lea eax, [ebp - 0x11c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 0xfffffffd
add eax, ebx
push edi
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x406f29
push edi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x403c00
call fcn.00405e29
push 0x403c0c
call fcn.00405e29
push 0x403c1c
call fcn.00405e29
push 0x403c28
call fcn.00405e29
mov edi, 0x403c34
push edi
call fcn.00405e29
lea eax, [ebp - 4]
push eax
call fcn.0040bb9d
push 0x403c28
call fcn.00405e29
push edi
call fcn.00405e29
lea eax, [ebp - 4]
push eax
call fcn.0040b5e1
push 0x80
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push esi
push ebx
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x406f29
push esi
push esi
push 3
push esi
push 3
push 0xc0000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x406f29
mov ecx, dword [0x418060]
mov ebx, dword [ecx + 0x3c]
add ebx, ecx
mov dword [ebp - 0x10], esi
mov edx, ebx
sub edx, ecx
add edx, 0x16
lea ecx, [ebx + 0x9c]
mov dword [ebp - 4], edx
movzx eax, word [ebx + 0x16]
mov dword [ebp - 0x18], ecx
cmp dword [ebp + 0xc], esi
jne 0x406e73
or eax, 0x2000
mov dword [ebp - 0x14], eax
mov eax, dword [ebx + 0x98]
sub eax, dword [ecx]
mov dword [ebp - 0xc], eax
mov eax, dword [ecx]
mov dword [ebp - 8], eax
jmp 0x406e8f
and eax, 0xffffdfff
mov dword [ebp - 0x14], eax
mov eax, dword [ecx]
shr eax, 1
mov dword [ebp - 8], eax
mov eax, dword [ecx]
shr eax, 1
add eax, dword [ebx + 0x98]
mov dword [ebp - 0xc], eax
push esi
push esi
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
lea eax, [ebp - 4]
push eax
push 2
lea eax, [ebp - 0x14]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
mov eax, ebx
sub eax, dword [0x418060]
push esi
add eax, 0x58
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
lea eax, [ebp - 4]
push eax
push 4
lea eax, [ebp - 0x10]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub ebx, dword [0x418060]
push esi
push esi
add ebx, 0x98
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
lea eax, [ebp - 4]
push eax
push 8
lea eax, [ebp - 0xc]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp + 0xc], esi
jne 0x406f1d
mov eax, dword [ebp - 0x18]
push 2
push esi
mov eax, dword [eax]
neg eax
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x406f1d
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
xor esi, esi
push edi
inc esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406f42
push ebx
call fcn.0040be86
mov edx, dword [0x418060]
xor edi, edi
inc edi
mov ecx, dword [edx + 0x3c]
cmp eax, dword [ecx + edx + 8]
cmove esi, edi
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 8