Function at 0x405988
Capabilities:
Copy file

Disassembly:
push 0x54
mov eax, 0x53fb9c
call fcn.0051e9c3
mov edi, dword [ebp + 0xc]
xor ebx, ebx
movzx edx, word [ebp + 8]
mov esi, dword [ebp + 0x10]
cmp dword [edi], ebx
jne 0x4059e1
mov ecx, dword [esi]
mov eax, ecx
sub eax, 1
je 0x4059dc
sub eax, 1
je 0x405ac1
dec eax
sub eax, 1
je 0x405aaa
sub eax, 4
je 0x405a93
sub eax, 8
je 0x405a88
sub eax, 0x10
je 0x405a33
sub eax, 0x20
jne 0x405a42
mov dword [edi], ecx
mov dword [edi + 4], ebx
mov eax, dword [esi]
sub eax, 1
je 0x405be4
sub eax, 1
je 0x405b92
dec eax
sub eax, 1
je 0x405b29
sub eax, 4
je 0x405b10
sub eax, 8
je 0x405a12
sub eax, 0x30
jne 0x405a42
cmp dword [edi + 4], ebx
jne 0x405a42
push ebx
push edx
push dword [esi + 4]
call dword [sym.imp.ole32.dll_OleDuplicateData]
xor ecx, ecx
mov dword [edi + 4], eax
test eax, eax
setne cl
mov eax, ecx
jmp 0x405bfd
push dword [esi + 4]
push ebx
call fcn.0040590d
mov ebx, eax
test ebx, ebx
jne 0x405a49
xor eax, eax
jmp 0x405bfd
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov esi, eax
push 0
push dword [esi + 0xc]
call dword [sym.imp.GDI32.dll_CopyMetaFileW]
mov dword [esi + 0xc], eax
push ebx
test eax, eax
jne 0x405a74
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x405a42
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov dword [edi + 4], ebx
mov dword [edi], 0x20
jmp 0x405bfa
mov dword [edi], 0x10
jmp 0x4059de
mov ecx, dword [esi + 4]
mov dword [edi + 4], ecx
push ecx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [edi], 8
jmp 0x405bfa
mov ecx, dword [esi + 4]
mov dword [edi + 4], ecx
push ecx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [edi], 4
jmp 0x405bfa
mov dword [edi], 2
cmp dword [esi + 4], ebx
jne 0x405ad1
call fcn.004052aa
push dword [esi + 4]
call fcn.005245cb
mov ebx, eax
push 2
lea ecx, [ebx + 1]
push ecx
call fcn.004057ea
mov ecx, eax
add esp, 0xc
mov dword [edi + 4], ecx
test ecx, ecx
je 0x405a42
lea eax, [ebx*2 + 2]
push eax
push dword [esi + 4]
push eax
push ecx
call fcn.00403fb2
add esp, 0x10
jmp 0x405bfa
push dword [edi + 4]
mov eax, dword [esi + 4]
push ebx
push ebx
push ebx
mov ecx, dword [eax]
push eax
call dword [ecx + 0x1c]
neg eax
sbb eax, eax
inc eax
jmp 0x405bfd
mov eax, dword [esi + 4]
lea edx, [ebp - 0x58]
push 1
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x30]
test eax, eax
jne 0x405a42
mov eax, dword [edi + 4]
push ebx
push ebx
push ebx
mov ecx, dword [eax]
push ebx
push eax
call dword [ecx + 0x14]
mov eax, dword [esi + 4]
push ebx
push ebx
push ebx
mov ecx, dword [eax]
push ebx
push eax
call dword [ecx + 0x14]
mov eax, dword [esi + 4]
push ebx
push ebx
push dword [ebp - 0x4c]
mov ecx, dword [eax]
push dword [ebp - 0x50]
push dword [edi + 4]
push eax
call dword [ecx + 0x1c]
test eax, eax
jne 0x405a42
mov eax, dword [edi + 4]
push ebx
push ebx
push ebx
mov ecx, dword [eax]
push ebx
push eax
call dword [ecx + 0x14]
mov ecx, dword [esi + 4]
push ebx
push ebx
push ebx
mov edx, dword [ecx]
push ebx
push ecx
call dword [edx + 0x14]
jmp 0x405bfa
push dword [esi + 4]
lea ecx, [ebp - 0x60]
call fcn.004021d4
push dword [edi + 4]
lea ecx, [ebp - 0x5c]
mov dword [ebp - 4], ebx
call fcn.004021d4
mov ecx, dword [edi + 4]
mov eax, dword [esi + 4]
neg ecx
push ebx
sbb ecx, ecx
and ecx, dword [ebp - 0x5c]
neg eax
push ecx
sbb eax, eax
and eax, dword [ebp - 0x60]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
mov ecx, dword [ebp - 0x5c]
mov esi, eax
add ecx, 0xfffffff0
call fcn.00403953
mov ecx, dword [ebp - 0x60]
add ecx, 0xfffffff0
call fcn.00403953
mov eax, esi
jmp 0x405bfd
push dword [esi + 4]
push dword [edi + 4]
call fcn.0040590d
test eax, eax
je 0x405a42
mov dword [edi + 4], eax
xor eax, eax
inc eax
call fcn.0051e96d
ret 0xc