Function at 0x412970
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x418
mov eax, dword [0x43b010]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, ecx
cmp dword [esi + 0x20], 0
jne 0x412bdb
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push edi
push str.HPProfiler.dll
mov dword [esi + 0x20], 1
call ebx
mov dword [esi + 4], eax
test eax, eax
jne 0x412b16
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push str.HPProfiler.dll
call ebx
mov dword [esi + 4], eax
test eax, eax
jne 0x412b10
mov dword [ebp - 0x418], eax
lea eax, [ebp - 0x414]
push 0x208
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x412aa4
lea eax, [ebp - 0x414]
push eax
call fcn.00418718
push str.spoolsv.exe
push eax
call fcn.00417e59
add esp, 0xc
test eax, eax
jne 0x412aa4
lea eax, [ebp - 0x418]
push eax
push 0x410
lea eax, [ebp - 0x414]
push eax
push 1
push 0
push 0
call dword [sym.imp.WINSPOOL.DRV_GetPrinterDriverDirectoryW]
test eax, eax
je 0x412b10
lea ecx, [ebp - 0x414]
lea edx, [ecx + 2]
lea ecx, [ecx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x412a40
sub ecx, edx
sar ecx, 1
cmp word [ebp + ecx*2 - 0x416], 0x5c
je 0x412a73
push 0x436248
lea eax, [ebp - 0x414]
push 0x208
push eax
call fcn.0041810e
add esp, 0xc
push 0x43624c
lea eax, [ebp - 0x414]
push 0x208
push eax
call fcn.0041810e
push str.HPProfiler.dll
lea eax, [ebp - 0x414]
push 0x208
push eax
call fcn.0041810e
add esp, 0x18
jmp 0x412b04
push 1
call fcn.00412760
mov edi, eax
add esp, 4
test edi, edi
je 0x412ad0
push edi
lea eax, [ebp - 0x414]
push 0x208
push eax
call fcn.004181fb
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
lea eax, [ebp - 0x414]
push 0x5c
push eax
call fcn.00417db3
add esp, 8
test eax, eax
je 0x412b10
xor ecx, ecx
push str.HPProfiler.dll
mov word [eax + 2], cx
lea eax, [ebp - 0x414]
push 0x208
push eax
call fcn.0041810e
add esp, 0xc
lea eax, [ebp - 0x414]
push eax
call ebx
mov dword [esi + 4], eax
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov eax, dword [esi + 4]
test eax, eax
je 0x412bd9
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.UseLogger
push eax
call edi
test eax, eax
je 0x412bd9
call eax
test eax, eax
je 0x412bd9
push str.LogTrace
push dword [esi + 4]
call edi
push str.ProfileScopeBegin
push dword [esi + 4]
mov dword [esi + 8], eax
call edi
push str.ProfileScopeEnd
push dword [esi + 4]
mov dword [esi + 0xc], eax
call edi
push str.AttachLogger
push dword [esi + 4]
mov dword [esi + 0x10], eax
call edi
push str.DetachLogger
push dword [esi + 4]
mov dword [esi + 0x18], eax
call edi
cmp dword [esi + 8], 0
mov dword [esi + 0x14], eax
je 0x412bd9
cmp dword [esi + 0xc], 0
je 0x412bd9
cmp dword [esi + 0x10], 0
je 0x412bd9
cmp dword [esi + 0x18], 0
je 0x412bd9
test eax, eax
je 0x412bd9
push 0
call fcn.00412760
add esp, 4
mov dword [esi + 0x2c], eax
test eax, eax
je 0x412bd2
push eax
call ebx
mov dword [esi + 0x28], eax
test eax, eax
je 0x412bc2
push eax
mov eax, dword [esi + 0x18]
call eax
mov dword [esi + 0x24], eax
push dword [esi + 0x2c]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [esi + 0x2c], 0
mov dword [esi + 0x1c], 1
pop edi
pop ebx
mov ecx, dword [ebp - 4]
mov eax, dword [esi + 0x1c]
xor ecx, ebp
pop esi
call fcn.0041729b
mov esp, ebp
pop ebp
ret