Function at 0x406500
Capabilities:
Copy file
Move file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
lea eax, [ebp - 4]
mov esi, ecx
push eax
mov edx, 0x2b
mov dword [ebp - 8], esi
call fcn.00407f40
lea esp, [esp]
test eax, eax
js 0x4067a5
mov edi, dword [ebp - 4]
movzx eax, word [edi]
mov dword [ebp - 4], eax
test ax, ax
jne 0x40653f
call fcn.0040a520
mov ebx, eax
jmp 0x406580
mov ecx, dword [edi + 4]
mov edx, dword [0x453ac4]
movzx eax, ax
mov dword [ebp - 0xc], ecx
lea ecx, [eax + 0xa]
call fcn.00409c00
mov ebx, eax
xor edx, edx
mov eax, dword [ebp - 4]
movzx ecx, ax
lea eax, [ebx + 8]
mov dword [ebx + 4], eax
mov dword [ebx], ecx
mov word [eax + ecx], dx
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x406580
push ecx
push eax
push dword [ebx + 4]
call fcn.00415e30
add esp, 0xc
push edi
push 0
push dword [0x453afc]
call dword [sym.imp.ntdll.dll_RtlFreeHeap]
mov edx, dword [esi + 0x18]
test edx, edx
je 0x40659b
mov edx, dword [edx + 4]
jmp 0x40659d
xor edx, edx
mov ecx, edx
lea edi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4065a2
mov eax, dword [ebx + 4]
sub ecx, edi
sar ecx, 1
add ecx, ecx
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], ecx
cmp dword [ebx], ecx
jb 0x4065e8
push 1
lea edx, [ebp - 0x18]
lea ecx, [ebp - 0x10]
call fcn.0040a140
test al, al
je 0x4065e8
lea ecx, [ebx - 8]
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
dec eax
jmp 0x406795
mov eax, dword [esi + 0x18]
test eax, eax
je 0x4065f4
mov ecx, dword [eax + 4]
jmp 0x4065f6
xor ecx, ecx
mov edx, 0x433ff0
jmp 0x406600
call fcn.0040a7c0
mov ecx, dword [esi + 0x18]
mov edi, eax
mov dword [ebp - 0xc], edi
test ecx, ecx
je 0x406616
mov ecx, dword [ecx + 4]
jmp 0x406618
xor ecx, ecx
mov edx, 0x434024
lea ecx, [ecx]
call fcn.0040a7c0
mov ecx, dword [edi + 4]
mov dword [ebp - 4], eax
call fcn.00409560
or esi, 0xffffffff
test al, al
je 0x4066cb
mov edx, dword [0x453ac4]
lea ecx, [esi + 0x39]
call fcn.00409c00
xor edx, edx
mov dword [ebp - 0x14], eax
mov esi, str.processhacker_setup.bak
lea ecx, [eax + 8]
mov dword [eax], 0x2e
mov dword [eax + 4], ecx
mov word [ecx + 0x2e], dx
mov ecx, 0xb
mov edi, dword [eax + 4]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
movsw word es:[edi], word [esi]
call fcn.0040c180
mov esi, eax
mov eax, dword [ebp - 0xc]
push dword [esi + 4]
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x4066a1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword ds:[ebp - 8]
mov dword [ecx + 0x1c], eax
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esi - 8]
or esi, 0xffffffff
mov eax, esi
lock xadd dword [ecx + 4], eax
dec eax
jne 0x4066b6
call fcn.00409ce0
mov ecx, dword [ebp - 0x14]
mov eax, esi
add ecx, 0xfffffff8
lock xadd dword [ecx + 4], eax
dec eax
jne 0x4066cb
call fcn.00409ce0
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + 4]
call fcn.00409560
test al, al
je 0x40675e
mov edx, dword [0x453ac4]
mov ecx, 0x38
call fcn.00409c00
xor esi, esi
mov dword [ebp - 0x14], eax
mov ecx, 0xb
lea edx, [eax + 8]
mov dword [eax], 0x2e
mov dword [eax + 4], edx
mov word [edx + 0x2e], si
mov esi, str.processhacker_setup.exe
mov edi, dword [eax + 4]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
movsw word es:[edi], word [esi]
call fcn.0040c180
mov esi, eax
mov eax, dword [ebp - 4]
push dword [esi + 4]
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
je 0x40668b
lea ecx, [esi - 8]
or esi, 0xffffffff
mov eax, esi
lock xadd dword [ecx + 4], eax
dec eax
jne 0x406749
call fcn.00409ce0
mov ecx, dword [ebp - 0x14]
mov eax, esi
add ecx, 0xfffffff8
lock xadd dword [ecx + 4], eax
dec eax
jne 0x40675e
call fcn.00409ce0
mov eax, dword [ebp - 4]
push 1
push dword [eax + 4]
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x40668b
mov ecx, dword [ebp - 4]
mov eax, esi
add ecx, 0xfffffff8
lock xadd dword [ecx + 4], eax
dec eax
jne 0x40678c
call fcn.00409ce0
lea ecx, [ebx - 8]
lock xadd dword [ecx + 4], esi
dec esi
jne 0x40679c
call fcn.00409ce0
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movzx eax, ax
pop edi
mov dword [esi + 0x1c], eax
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret