Function at 0x56ac30
Capabilities:
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5b0ebf
mov eax, dword fs:[0]
push eax
sub esp, 0x2a0
mov eax, dword [0x616040]
xor eax, esp
mov dword [esp + 0x298], eax
push ebx
push esi
push edi
mov eax, dword [0x616040]
xor eax, esp
push eax
lea eax, [esp + 0x2b0]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x2c], edi
mov ecx, dword [0x621eac]
mov eax, 0x2aaaaaab
sub ecx, dword [0x621ea4]
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 0x80
jae 0x56aca9
push 0x80
mov ecx, 0x621ea4
call fcn.00409980
mov esi, dword [sym.imp.WINSPOOL.DRV_Ordinal_203]
lea eax, [esp + 0x24]
push eax
push 0
mov dword [esp + 0x2c], 0
call esi
mov eax, dword [esp + 0x24]
test eax, eax
je 0x56b35c
push eax
lea ecx, [esp + 0x34]
call fcn.00409880
lea eax, [esp + 0x24]
mov dword [esp + 0x2b8], 0
mov ebx, dword [esp + 0x30]
push eax
push ebx
call esi
push dword [esp + 0x24]
push ebx
call fcn.00528e72
add esp, 8
mov dword [esp + 0x68], 7
xor ecx, ecx
mov dword [esp + 0x64], 0
mov word [esp + 0x54], cx
lea ecx, [esp + 0x54]
push eax
push ebx
call fcn.00408830
lea eax, [esp + 0x28]
mov byte [esp + 0x2b8], 1
mov esi, dword [sym.imp.WINSPOOL.DRV_EnumPrintersW]
push eax
lea eax, [esp + 0x24]
mov dword [esp + 0x24], 0
push eax
push 0
push 0
push 4
push 0
push 2
mov dword [esp + 0x44], 0
call esi
push dword [esp + 0x20]
call fcn.0040d538
add esp, 4
mov ebx, eax
lea eax, [esp + 0x28]
mov dword [esp + 0x14], ebx
push eax
lea eax, [esp + 0x24]
push eax
push dword [esp + 0x28]
push ebx
push 4
push 0
push 2
call esi
cmp dword [esp + 0x28], 0
mov dword [esp + 0x18], 0
jbe 0x56aed4
mov edi, ebx
mov dword [esp + 0x1c], ebx
jmp 0x56ada0
mov edx, dword [edi]
xor eax, eax
mov dword [esp + 0x80], 7
mov dword [esp + 0x7c], 0
mov word [esp + 0x6c], ax
cmp word [edx], ax
jne 0x56adc5
xor ecx, ecx
jmp 0x56addf
mov ecx, edx
lea esi, [ecx + 2]
lea ebx, [ebx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x56add0
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [esp + 0x74]
call fcn.00408830
mov byte [esp + 0x2b8], 2
lea eax, [esp + 0x6c]
mov esi, dword [0x621ea8]
cmp eax, esi
jae 0x56ae5c
mov ebx, dword [0x621ea4]
cmp ebx, eax
ja 0x56ae5c
mov ecx, eax
mov eax, 0x2aaaaaab
sub ecx, ebx
imul ecx
sar edx, 2
mov edi, edx
shr edi, 0x1f
add edi, edx
cmp esi, dword [0x621eac]
jne 0x56ae3e
push ecx
mov ecx, 0x621ea4
call fcn.00409a20
mov esi, dword [0x621ea8]
mov ebx, dword [0x621ea4]
lea eax, [edi + edi*2]
lea eax, [ebx + eax*8]
test esi, esi
je 0x56ae56
push eax
mov ecx, esi
call fcn.00408640
mov esi, dword [0x621ea8]
mov edi, dword [esp + 0x1c]
jmp 0x56ae8b
cmp esi, dword [0x621eac]
jne 0x56ae75
push ecx
mov ecx, 0x621ea4
call fcn.00409a20
mov esi, dword [0x621ea8]
test esi, esi
je 0x56ae8b
lea eax, [esp + 0x6c]
mov ecx, esi
push eax
call fcn.00408640
mov esi, dword [0x621ea8]
add esi, 0x18
mov byte [esp + 0x2b8], 1
cmp dword [esp + 0x80], 8
mov dword [0x621ea8], esi
jb 0x56aeb2
push dword [esp + 0x6c]
call fcn.0040d533
add esp, 4
mov eax, dword [esp + 0x18]
add edi, 0xc
inc eax
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], eax
cmp eax, dword [esp + 0x28]
jb 0x56ada0
mov ebx, dword [esp + 0x14]
mov edi, dword [esp + 0x2c]
push ebx
call fcn.0040d533
mov eax, dword [0x621aa0]
add esp, 4
test eax, eax
je 0x56aef9
push eax
call fcn.0040d533
add esp, 4
mov dword [0x621aa0], 0
xor eax, eax
mov dword [esp + 0x50], 7
mov dword [esp + 0x4c], 0
mov word [esp + 0x3c], ax
push 0x104
lea eax, [esp + 0xa0]
mov byte [esp + 0x2bc], 3
push eax
push str._APPDATA_CanonIJ_Scan_Utility
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
xor ecx, ecx
cmp edi, 0x9fbf1
jne 0x56af3f
mov ecx, 1
mov eax, dword [0x621a6c]
test eax, eax
je 0x56af56
push 0x2000000
push dword [ecx*4 + 0x621ebc]
call eax
push eax
mov edx, edi
lea ecx, [esp + 0x30]
call fcn.0058f8e0
add esp, 4
mov byte [esp + 0x2b8], 4
lea eax, [esp + 0x9c]
mov esi, dword [esp + 0x2c]
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push esi
push eax
call edi
push str.PRINTER.DAT
lea eax, [esp + 0xa0]
push eax
call edi
push 0x5eb3b4
lea eax, [esp + 0xa0]
mov dword [esp + 0x14], 0
push eax
lea eax, [esp + 0x18]
push eax
call fcn.005291e2
mov eax, dword [esp + 0x1c]
add esp, 0xc
test eax, eax
je 0x56b18f
push eax
push 1
lea eax, [esp + 0x24]
mov dword [esp + 0x24], 0
push 4
push eax
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0
call fcn.0052a293
push dword [esp + 0x20]
lea eax, [esp + 0x28]
push 1
push 4
push eax
call fcn.0052a293
push dword [esp + 0x30]
lea eax, [esp + 0x3c]
push 1
push 4
push eax
call fcn.0052a293
add esp, 0x30
cmp dword [esp + 0x1c], 0x100
jne 0x56b0f8
mov eax, dword [esp + 0x14]
cmp eax, 0xffff
jae 0x56b0f8
cmp dword [esp + 0x18], 1
jne 0x56b0f8
push eax
lea ecx, [esp + 0x70]
call fcn.00409880
mov byte [esp + 0x2b8], 5
push dword [esp + 0x10]
mov edi, dword [esp + 0x70]
push dword [esp + 0x18]
push 2
push edi
call fcn.0052a293
add esp, 0x10
mov dword [esp + 0x98], 7
xor eax, eax
mov dword [esp + 0x94], 0
lea ecx, [esp + 0x84]
mov word [esp + 0x84], ax
push dword [esp + 0x14]
push edi
call fcn.00408830
cmp dword [esp + 0x50], 8
jb 0x56b0a2
push dword [esp + 0x3c]
call fcn.0040d533
add esp, 4
xor eax, eax
mov dword [esp + 0x50], 7
mov word [esp + 0x3c], ax
lea ecx, [esp + 0x3c]
lea eax, [esp + 0x84]
mov dword [esp + 0x4c], 0
push eax
call fcn.004087d0
cmp dword [esp + 0x98], 8
jb 0x56b0e3
push dword [esp + 0x84]
call fcn.0040d533
add esp, 4
mov byte [esp + 0x2b8], 4
test edi, edi
je 0x56b0f8
push edi
call fcn.0040d533
add esp, 4
push dword [esp + 0x10]
lea eax, [esp + 0x20]
push 1
push 4
push eax
call fcn.0052a293
push dword [esp + 0x20]
lea eax, [esp + 0x28]
push 1
push 4
push eax
call fcn.0052a293
push dword [esp + 0x30]
lea eax, [esp + 0x3c]
push 1
push 4
push eax
call fcn.0052a293
add esp, 0x30
cmp dword [esp + 0x1c], 0x200
jne 0x56b183
mov eax, dword [esp + 0x14]
cmp eax, 0xffff
jae 0x56b183
cmp dword [esp + 0x18], 0x64
jne 0x56b183
push eax
mov dword [0x621a9c], eax
call fcn.0040d538
push dword [esp + 0x14]
mov dword [0x621aa0], eax
push dword [esp + 0x1c]
push 1
push eax
call fcn.0052a293
add esp, 0x14
lea eax, [esp + 0x3c]
mov ecx, 0x6174a0
push 0xffffffffffffffff
push 0
push eax
call fcn.004089c0
push dword [esp + 0x10]
call fcn.00529501
add esp, 4
mov ecx, dword [0x621ea4]
mov eax, dword [0x621ea8]
cmp ecx, eax
je 0x56b1f0
mov ebx, dword [esp + 0x64]
cmp dword [ecx + 0x14], 8
mov eax, dword [ecx + 0x10]
jb 0x56b1af
mov edi, dword [ecx]
jmp 0x56b1b1
mov edi, ecx
cmp ebx, eax
jb 0x56b1b7
mov ebx, eax
cmp dword [esp + 0x68], 8
mov edx, dword [esp + 0x54]
jae 0x56b1c6
lea edx, [esp + 0x54]
test ebx, ebx
jne 0x56b211
xor eax, eax
mov ebx, dword [esp + 0x64]
test eax, eax
jne 0x56b1e4
mov edx, dword [ecx + 0x10]
cmp ebx, edx
jb 0x56b1e4
cmp ebx, edx
setne al
test eax, eax
je 0x56b230
mov eax, dword [0x621ea8]
add ecx, 0x18
cmp ecx, eax
jne 0x56b1a2
mov edi, dword [0x621ea4]
mov ecx, edi
cmp ecx, eax
je 0x56b2d5
mov ebx, dword [esp + 0x4c]
cmp dword [ecx + 0x14], 8
mov eax, dword [ecx + 0x10]
jb 0x56b255
mov edi, dword [ecx]
jmp 0x56b257
mov ax, word [edx]
cmp ax, word [edi]
jne 0x56b222
add edx, 2
add edi, 2
dec ebx
jmp 0x56b1c8
movzx eax, word [edx]
cmp ax, word [edi]
sbb eax, eax
and eax, 0xfffffffe
inc eax
jmp 0x56b1cc
mov edi, dword [0x621ea4]
mov eax, 0x2aaaaaab
sub ecx, edi
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [0x617470], eax
mov eax, dword [0x621ea8]
jmp 0x56b1f6
mov edi, ecx
cmp ebx, eax
jb 0x56b25d
mov ebx, eax
cmp dword [esp + 0x50], 8
mov edx, dword [esp + 0x3c]
jae 0x56b26c
lea edx, [esp + 0x3c]
test ebx, ebx
jne 0x56b2a0
xor eax, eax
mov ebx, dword [esp + 0x4c]
test eax, eax
jne 0x56b28a
mov edx, dword [ecx + 0x10]
cmp ebx, edx
jb 0x56b28a
cmp ebx, edx
setne al
test eax, eax
je 0x56b2b9
add ecx, 0x18
cmp ecx, dword [0x621ea8]
jne 0x56b204
jmp 0x56b2d5
mov ax, word [edx]
cmp ax, word [edi]
jne 0x56b2b1
add edx, 2
add edi, 2
dec ebx
jmp 0x56b26e
sbb eax, eax
and eax, 0xfffffffe
inc eax
jmp 0x56b272
sub ecx, dword [0x621ea4]
mov eax, 0x2aaaaaab
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [0x617470], eax
add esi, 0xfffffff0
mov byte [esp + 0x2b8], 3
or ecx, 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x56b2f7
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
cmp dword [esp + 0x50], 8
jb 0x56b30a
push dword [esp + 0x3c]
call fcn.0040d533
add esp, 4
xor eax, eax
mov dword [esp + 0x50], 7
cmp dword [esp + 0x68], 8
mov dword [esp + 0x4c], 0
mov word [esp + 0x3c], ax
jb 0x56b334
push dword [esp + 0x54]
call fcn.0040d533
add esp, 4
xor eax, eax
mov dword [esp + 0x68], 7
mov word [esp + 0x54], ax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x64], 0
test eax, eax
je 0x56b35c
push eax
call fcn.0040d533
add esp, 4
mov ecx, dword [esp + 0x2b0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x298]
xor ecx, esp
call fcn.00527e5c
mov esp, ebp
pop ebp
ret