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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b0a85
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 0x56ac54
cmp eax, dword [0x617470]
jle 0x56ac54
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 0x56aa34
mov eax, 1
mov ecx, dword [0x621a6c]
test ecx, ecx
jne 0x56aa42
xor eax, eax
jmp 0x56aa50
push 0x2000000
push dword [eax*4 + 0x621ebc]
call ecx
push eax
mov edx, esi
lea ecx, [ebp - 0x22c]
call fcn.0058f590
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.00414e1f
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x56aaa8
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.005291b2
add esp, 0xc
cmp dword [ebp - 0x21c], 0
je 0x56ac16
push ecx
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x224], 0
mov dword [ebp - 0x228], 0x100
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.0052a468
push dword [ebp - 0x21c]
lea eax, [ebp - 0x220]
push 1
push 4
push eax
call fcn.0052a468
push dword [ebp - 0x21c]
lea eax, [ebp - 0x224]
push 1
push 4
push eax
call fcn.0052a468
add esp, 0x2c
call fcn.00409830
cmp dword [eax + 0x14], 8
jb 0x56ab77
mov eax, dword [eax]
push dword [ebp - 0x21c]
push dword [ebp - 0x220]
push 2
push eax
call fcn.0052a468
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.0052a468
push dword [ebp - 0x21c]
lea eax, [ebp - 0x220]
push 1
push 4
push eax
call fcn.0052a468
push dword [ebp - 0x21c]
lea eax, [ebp - 0x224]
push 1
push 4
push eax
call fcn.0052a468
add esp, 0x40
push dword [ebp - 0x21c]
push dword [ebp - 0x220]
push 1
push dword [0x621aa0]
call fcn.0052a468
push dword [ebp - 0x21c]
call fcn.005294d1
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 0x56ac36
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 0x56ac54
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.00527e2c
mov esp, ebp
pop ebp
ret