Function at 0x56a970
Capabilities:
Query environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b0e55
mov eax, dword fs:[0]
push eax
sub esp, 0x224
mov eax, dword [0x616040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov ecx, dword [0x621ea8]
mov eax, 0x2aaaaaab
sub ecx, dword [0x621ea4]
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x56ac14
cmp eax, dword [0x617470]
jle 0x56ac14
push 0x104
lea eax, [ebp - 0x218]
push eax
push str._APPDATA_CanonIJ_Scan_Utility
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
xor eax, eax
cmp esi, 0x9fbf1
jne 0x56a9f4
mov eax, 1
mov ecx, dword [0x621a6c]
test ecx, ecx
jne 0x56aa02
xor eax, eax
jmp 0x56aa10
push 0x2000000
push dword [eax*4 + 0x621ebc]
call ecx
push eax
mov edx, esi
lea ecx, [ebp - 0x22c]
call fcn.0058f8e0
add esp, 4
mov dword [ebp - 4], 0
lea eax, [ebp - 0x218]
mov edi, dword [ebp - 0x22c]
mov esi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push edi
push eax
call esi
push str.PRINTER.DAT
lea eax, [ebp - 0x218]
push eax
call esi
call fcn.0041505f
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x56aa68
push 0x80004005
call fcn.00402740
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x230], esi
push 0x5eb3bc
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 1
push eax
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x21c], 0
push eax
call fcn.005291e2
add esp, 0xc
cmp dword [ebp - 0x21c], 0
je 0x56abd6
push ecx
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x224], 0
mov dword [ebp - 0x228], pe_nt_image_headers32
call fcn.00409830
push dword [ebp - 0x21c]
push 1
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x220], eax
lea eax, [ebp - 0x228]
push 4
push eax
mov dword [ebp - 0x224], 1
call fcn.0052a498
push dword [ebp - 0x21c]
lea eax, [ebp - 0x220]
push 1
push 4
push eax
call fcn.0052a498
push dword [ebp - 0x21c]
lea eax, [ebp - 0x224]
push 1
push 4
push eax
call fcn.0052a498
add esp, 0x2c
call fcn.00409830
cmp dword [eax + 0x14], 8
jb 0x56ab37
mov eax, dword [eax]
push dword [ebp - 0x21c]
push dword [ebp - 0x220]
push 2
push eax
call fcn.0052a498
push dword [ebp - 0x21c]
mov eax, dword [0x621a9c]
push 1
mov dword [ebp - 0x220], eax
lea eax, [ebp - 0x228]
push 4
push eax
mov dword [ebp - 0x228], 0x200
mov dword [ebp - 0x224], 0x64
call fcn.0052a498
push dword [ebp - 0x21c]
lea eax, [ebp - 0x220]
push 1
push 4
push eax
call fcn.0052a498
push dword [ebp - 0x21c]
lea eax, [ebp - 0x224]
push 1
push 4
push eax
call fcn.0052a498
add esp, 0x40
push dword [ebp - 0x21c]
push dword [ebp - 0x220]
push 1
push dword [0x621aa0]
call fcn.0052a498
push dword [ebp - 0x21c]
call fcn.00529501
add esp, 0x14
lea edx, [esi - 0x10]
mov byte [ebp - 4], 0
or esi, 0xffffffff
lea ecx, [edx + 0xc]
mov eax, esi
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x56abf6
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea eax, [edi + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x56ac14
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00527e5c
mov esp, ebp
pop ebp
ret