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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5b0aef
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 0x56ace9
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 0x56b39c
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.00528e42
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.0040d503
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 0x56af14
mov edi, ebx
mov dword [esp + 0x1c], ebx
jmp 0x56ade0
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 0x56ae05
xor ecx, ecx
jmp 0x56ae1f
mov ecx, edx
lea esi, [ecx + 2]
lea ebx, [ebx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x56ae10
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 0x56ae9c
mov ebx, dword [0x621ea4]
cmp ebx, eax
ja 0x56ae9c
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 0x56ae7e
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 0x56ae96
push eax
mov ecx, esi
call fcn.00408640
mov esi, dword [0x621ea8]
mov edi, dword [esp + 0x1c]
jmp 0x56aecb
cmp esi, dword [0x621eac]
jne 0x56aeb5
push ecx
mov ecx, 0x621ea4
call fcn.00409a20
mov esi, dword [0x621ea8]
test esi, esi
je 0x56aecb
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 0x56aef2
push dword [esp + 0x6c]
call fcn.0040d50c
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 0x56ade0
mov ebx, dword [esp + 0x14]
mov edi, dword [esp + 0x2c]
push ebx
call fcn.0040d50c
mov eax, dword [0x621aa0]
add esp, 4
test eax, eax
je 0x56af39
push eax
call fcn.0040d50c
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 0x56af7f
mov ecx, 1
mov eax, dword [0x621a6c]
test eax, eax
je 0x56af96
push 0x2000000
push dword [ecx*4 + 0x621ebc]
call eax
push eax
mov edx, edi
lea ecx, [esp + 0x30]
call fcn.0058f590
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.005291b2
mov eax, dword [esp + 0x1c]
add esp, 0xc
test eax, eax
je 0x56b1cf
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.0052a263
push dword [esp + 0x20]
lea eax, [esp + 0x28]
push 1
push 4
push eax
call fcn.0052a263
push dword [esp + 0x30]
lea eax, [esp + 0x3c]
push 1
push 4
push eax
call fcn.0052a263
add esp, 0x30
cmp dword [esp + 0x1c], 0x100
jne 0x56b138
mov eax, dword [esp + 0x14]
cmp eax, 0xffff
jae 0x56b138
cmp dword [esp + 0x18], 1
jne 0x56b138
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.0052a263
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 0x56b0e2
push dword [esp + 0x3c]
call fcn.0040d50c
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 0x56b123
push dword [esp + 0x84]
call fcn.0040d50c
add esp, 4
mov byte [esp + 0x2b8], 4
test edi, edi
je 0x56b138
push edi
call fcn.0040d50c
add esp, 4
push dword [esp + 0x10]
lea eax, [esp + 0x20]
push 1
push 4
push eax
call fcn.0052a263
push dword [esp + 0x20]
lea eax, [esp + 0x28]
push 1
push 4
push eax
call fcn.0052a263
push dword [esp + 0x30]
lea eax, [esp + 0x3c]
push 1
push 4
push eax
call fcn.0052a263
add esp, 0x30
cmp dword [esp + 0x1c], 0x200
jne 0x56b1c3
mov eax, dword [esp + 0x14]
cmp eax, 0xffff
jae 0x56b1c3
cmp dword [esp + 0x18], 0x64
jne 0x56b1c3
push eax
mov dword [0x621a9c], eax
call fcn.0040d503
push dword [esp + 0x14]
mov dword [0x621aa0], eax
push dword [esp + 0x1c]
push 1
push eax
call fcn.0052a263
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.005294d1
add esp, 4
mov ecx, dword [0x621ea4]
mov eax, dword [0x621ea8]
cmp ecx, eax
je 0x56b230
mov ebx, dword [esp + 0x64]
cmp dword [ecx + 0x14], 8
mov eax, dword [ecx + 0x10]
jb 0x56b1ef
mov edi, dword [ecx]
jmp 0x56b1f1
mov edi, ecx
cmp ebx, eax
jb 0x56b1f7
mov ebx, eax
cmp dword [esp + 0x68], 8
mov edx, dword [esp + 0x54]
jae 0x56b206
lea edx, [esp + 0x54]
test ebx, ebx
jne 0x56b251
xor eax, eax
mov ebx, dword [esp + 0x64]
test eax, eax
jne 0x56b224
mov edx, dword [ecx + 0x10]
cmp ebx, edx
jb 0x56b224
cmp ebx, edx
setne al
test eax, eax
je 0x56b270
mov eax, dword [0x621ea8]
add ecx, 0x18
cmp ecx, eax
jne 0x56b1e2
mov edi, dword [0x621ea4]
mov ecx, edi
cmp ecx, eax
je 0x56b315
mov ebx, dword [esp + 0x4c]
cmp dword [ecx + 0x14], 8
mov eax, dword [ecx + 0x10]
jb 0x56b295
mov edi, dword [ecx]
jmp 0x56b297
mov ax, word [edx]
cmp ax, word [edi]
jne 0x56b262
add edx, 2
add edi, 2
dec ebx
jmp 0x56b208
movzx eax, word [edx]
cmp ax, word [edi]
sbb eax, eax
and eax, 0xfffffffe
inc eax
jmp 0x56b20c
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 0x56b236
mov edi, ecx
cmp ebx, eax
jb 0x56b29d
mov ebx, eax
cmp dword [esp + 0x50], 8
mov edx, dword [esp + 0x3c]
jae 0x56b2ac
lea edx, [esp + 0x3c]
test ebx, ebx
jne 0x56b2e0
xor eax, eax
mov ebx, dword [esp + 0x4c]
test eax, eax
jne 0x56b2ca
mov edx, dword [ecx + 0x10]
cmp ebx, edx
jb 0x56b2ca
cmp ebx, edx
setne al
test eax, eax
je 0x56b2f9
add ecx, 0x18
cmp ecx, dword [0x621ea8]
jne 0x56b244
jmp 0x56b315
mov ax, word [edx]
cmp ax, word [edi]
jne 0x56b2f1
add edx, 2
add edi, 2
dec ebx
jmp 0x56b2ae
sbb eax, eax
and eax, 0xfffffffe
inc eax
jmp 0x56b2b2
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 0x56b337
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
cmp dword [esp + 0x50], 8
jb 0x56b34a
push dword [esp + 0x3c]
call fcn.0040d50c
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 0x56b374
push dword [esp + 0x54]
call fcn.0040d50c
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 0x56b39c
push eax
call fcn.0040d50c
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.00527e2c
mov esp, ebp
pop ebp
ret