Function at 0x499870
Capabilities:
Copy file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51b3dd
mov eax, dword fs:[0]
push eax
sub esp, 0x7c
mov eax, dword [0x565300]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, edx
mov esi, dword [ebp + 8]
movzx edx, cx
mov ecx, dword [edi]
mov dword [edi + 8], 0
mov dword [edi + 4], 0
test ecx, ecx
jne 0x4998d5
mov ecx, dword [esi]
lea eax, [ecx - 1]
cmp eax, 0x3f
ja case.0x4998f0.3
movzx eax, byte [eax + 0x499b84]
jmp dword [eax*4 + 0x499b68]
mov dword [edi], ecx
mov eax, dword [esi]
cmp ecx, eax
je 0x4998dd
mov dword [edi], eax
mov eax, dword [esi]
dec eax
cmp eax, 0x3f
ja case.0x4998f0.3
movzx eax, byte [eax + 0x499bdc]
jmp dword [eax*4 + 0x499bc4]
mov ecx, dword [esi + 4]
mov dword [edi + 4], ecx
push ecx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [edi], 4
mov eax, 1
jmp 0x499b4a
mov ecx, dword [esi + 4]
mov dword [edi + 4], ecx
push ecx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [edi], 8
mov eax, 1
jmp 0x499b4a
mov edx, dword [esi + 4]
xor ecx, ecx
call fcn.00499780
mov ebx, eax
test ebx, ebx
je case.0x4998f0.3
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 0x499971
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp case.0x4998f0.3
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov dword [edi + 4], ebx
mov eax, 1
mov dword [edi], 0x20
jmp 0x499b4a
mov dword [edi], 0x10
mov ecx, 0x10
jmp 0x4998d5
mov dword [edi], 2
mov eax, dword [esi + 4]
test eax, eax
je case.0x4998f0.3
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebx, eax
mov ecx, 2
lea eax, [ebx + 1]
mul ecx
test edx, edx
ja 0x4999fa
jb 0x4999c9
cmp eax, 0xffffffff
ja 0x4999fa
push eax
call dword [sym.imp.ole32.dll_CoTaskMemAlloc]
mov dword [edi + 4], eax
test eax, eax
je case.0x4998f0.3
lea ecx, [ebx*2 + 2]
push ecx
push dword [esi + 4]
push ecx
push eax
call fcn.004219e0
add esp, 0x10
mov eax, 1
jmp 0x499b4a
mov dword [edi + 4], 0
jmp case.0x4998f0.3
mov edx, dword [esi + 4]
xor ecx, ecx
call fcn.00499780
test eax, eax
je case.0x4998f0.3
mov dword [edi + 4], eax
mov eax, 1
jmp 0x499b4a
mov eax, dword [esi + 4]
lea edx, [ebp - 0x88]
push 1
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x30]
test eax, eax
jne case.0x4998f0.3
mov eax, dword [edi + 4]
push 0
push 0
push 0
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x14]
mov eax, dword [esi + 4]
push 0
push 0
push 0
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x14]
mov eax, dword [esi + 4]
push 0
push 0
push dword [ebp - 0x7c]
mov ecx, dword [eax]
push dword [ebp - 0x80]
push dword [edi + 4]
push eax
call dword [ecx + 0x1c]
test eax, eax
jne case.0x4998f0.3
mov eax, dword [edi + 4]
push 0
push 0
push 0
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x14]
mov eax, dword [esi + 4]
push 0
push 0
push 0
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x14]
mov eax, 1
jmp 0x499b4a
mov eax, dword [esi + 4]
push 0
push 0
push 0
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x1c]
test eax, eax
jne case.0x4998f0.3
mov eax, 1
jmp 0x499b4a
push 0
lea ecx, [ebp - 0x40]
call fcn.00423150
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x28]
push dword [edi + 4]
call fcn.00423150
cmp dword [edi + 4], 0
je 0x499afa
cmp dword [ebp - 0x14], 7
lea ecx, [ebp - 0x28]
cmova ecx, dword [ebp - 0x28]
jmp 0x499afc
xor ecx, ecx
cmp dword [esi + 4], 0
je 0x499b0f
cmp dword [ebp - 0x2c], 7
lea eax, [ebp - 0x40]
cmova eax, dword [ebp - 0x40]
jmp 0x499b11
xor eax, eax
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
lea ecx, [ebp - 0x28]
mov esi, eax
call fcn.0040b300
lea ecx, [ebp - 0x40]
call fcn.0040b300
mov eax, esi
jmp 0x499b4a
push 0
push edx
push dword [esi + 4]
call dword [sym.imp.ole32.dll_OleDuplicateData]
mov dword [edi + 4], eax
test eax, eax
jne 0x499909
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0050ea5d
mov esp, ebp
pop ebp
ret