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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x57a769
mov eax, dword fs:[0]
push eax
sub esp, 0x2b8
mov eax, dword [0x5d52e0]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
push 0x80
mov ecx, 0x5dd980
mov dword [ebp - 0x2b0], eax
call fcn.00408b30
mov edi, dword [sym.imp.WINSPOOL.DRV_Ordinal_203]
lea ecx, [ebp - 0x2a4]
xor ebx, ebx
push ecx
push ebx
mov dword [ebp - 0x2a4], ebx
call edi
mov eax, dword [ebp - 0x2a4]
cmp eax, ebx
je 0x54b653
lea esi, [ebp - 0x2c0]
mov dword [ebp - 0x2c0], ebx
mov dword [ebp - 0x2bc], ebx
mov dword [ebp - 0x2b8], ebx
call fcn.00408eb0
lea edx, [ebp - 0x2a4]
mov dword [ebp - 4], ebx
mov esi, dword [ebp - 0x2c0]
push edx
push esi
call edi
mov eax, dword [ebp - 0x2a4]
push eax
push esi
call fcn.004ff818
xor ecx, ecx
add esp, 8
mov word [ebp - 0x254], cx
push eax
mov eax, esi
lea ecx, [ebp - 0x254]
mov dword [ebp - 0x240], 7
mov dword [ebp - 0x244], ebx
call fcn.00407a20
lea edx, [ebp - 0x2a8]
push edx
lea eax, [ebp - 0x2ac]
push eax
push ebx
push ebx
push 4
mov byte [ebp - 4], 1
mov edi, dword [sym.imp.WINSPOOL.DRV_EnumPrintersW]
push ebx
push 2
mov dword [ebp - 0x2ac], ebx
mov dword [ebp - 0x2a8], ebx
call edi
mov ecx, dword [ebp - 0x2ac]
push ecx
call fcn.0040c6f7
mov ecx, dword [ebp - 0x2ac]
add esp, 4
mov ebx, eax
lea edx, [ebp - 0x2a8]
push edx
lea eax, [ebp - 0x2ac]
push eax
push ecx
push ebx
push 4
push 0
push 2
mov dword [ebp - 0x29c], ebx
call edi
xor esi, esi
cmp dword [ebp - 0x2a8], esi
jbe 0x54b178
mov dword [ebp - 0x294], ebx
mov edx, dword [ebp - 0x294]
mov eax, dword [edx]
xor ecx, ecx
mov word [ebp - 0x270], cx
mov ecx, eax
mov dword [ebp - 0x25c], 7
mov dword [ebp - 0x260], 0
lea edi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x54b113
sub ecx, edi
sar ecx, 1
push ecx
lea ecx, [ebp - 0x270]
call fcn.00407a20
lea ecx, [ebp - 0x270]
mov ebx, 0x5dd980
mov byte [ebp - 4], 2
call fcn.00408a50
mov byte [ebp - 4], 1
cmp dword [ebp - 0x25c], 8
jb 0x54b15e
mov edx, dword [ebp - 0x270]
push edx
call fcn.0040c6ec
add esp, 4
add dword [ebp - 0x294], 0xc
inc esi
cmp esi, dword [ebp - 0x2a8]
jb 0x54b0e9
mov ebx, dword [ebp - 0x29c]
push ebx
call fcn.0040c6ec
mov eax, dword [0x5dd5b8]
xor edi, edi
add esp, 4
cmp eax, edi
je 0x54b19b
push eax
call fcn.0040c6ec
add esp, 4
mov dword [0x5dd5b8], edi
xor eax, eax
mov dword [ebp - 0x224], 7
mov dword [ebp - 0x228], edi
mov word [ebp - 0x238], ax
push 0x104
lea ecx, [ebp - 0x21c]
push ecx
push str._APPDATA_CanonIJ_Scan_Utility
mov byte [ebp - 4], 3
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, dword [ebp - 0x2b0]
xor eax, eax
cmp esi, 0x9fbf1
jne 0x54b1e4
mov eax, 1
mov ecx, dword [0x5dd530]
cmp ecx, edi
jne 0x54b1f2
xor eax, eax
jmp 0x54b201
mov edx, dword [eax*4 + 0x5dd9a0]
push 0x2000000
push edx
call ecx
push esi
mov ecx, eax
lea edi, [ebp - 0x29c]
call fcn.00530ca0
add esp, 4
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x29c]
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push eax
lea ecx, [ebp - 0x21c]
push ecx
call edi
push str.PRINTER.DAT
lea edx, [ebp - 0x21c]
push edx
call edi
push 0x5aaec8
lea eax, [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x290]
xor esi, esi
push ecx
mov dword [ebp - 0x290], esi
call fcn.005000ef
mov eax, dword [ebp - 0x290]
add esp, 0xc
cmp eax, esi
je 0x54b455
push eax
push 1
lea edx, [ebp - 0x2a0]
push 4
push edx
mov dword [ebp - 0x2a0], esi
mov dword [ebp - 0x298], esi
mov dword [ebp - 0x294], esi
call fcn.00501005
mov eax, dword [ebp - 0x290]
push eax
push 1
lea ecx, [ebp - 0x298]
push 4
push ecx
call fcn.00501005
mov edx, dword [ebp - 0x290]
push edx
push 1
lea eax, [ebp - 0x294]
push 4
push eax
call fcn.00501005
add esp, 0x30
cmp dword [ebp - 0x2a0], 0x100
jne 0x54b39e
mov eax, dword [ebp - 0x298]
cmp eax, 0xffff
jae 0x54b39e
cmp dword [ebp - 0x294], 1
jne 0x54b39e
mov dword [ebp - 0x264], esi
mov dword [ebp - 0x260], esi
mov dword [ebp - 0x25c], esi
lea esi, [ebp - 0x264]
call fcn.00408eb0
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x290]
mov edx, dword [ebp - 0x298]
mov ebx, dword [ebp - 0x264]
push ecx
push edx
push 2
push ebx
call fcn.00501005
mov ecx, dword [ebp - 0x298]
xor eax, eax
add esp, 0x10
mov word [ebp - 0x28c], ax
push ecx
mov eax, ebx
lea ecx, [ebp - 0x28c]
mov dword [ebp - 0x278], 7
mov dword [ebp - 0x27c], 0
call fcn.00407a20
lea edi, [ebp - 0x28c]
lea esi, [ebp - 0x238]
mov byte [ebp - 4], 6
call fcn.00407900
cmp dword [ebp - 0x278], 8
jb 0x54b38b
mov edx, dword [ebp - 0x28c]
push edx
call fcn.0040c6ec
add esp, 4
mov byte [ebp - 4], 4
test ebx, ebx
je 0x54b39c
push ebx
call fcn.0040c6ec
add esp, 4
xor esi, esi
mov eax, dword [ebp - 0x290]
push eax
push 1
lea ecx, [ebp - 0x2a0]
push 4
push ecx
call fcn.00501005
mov edx, dword [ebp - 0x290]
push edx
push 1
lea eax, [ebp - 0x298]
push 4
push eax
call fcn.00501005
mov ecx, dword [ebp - 0x290]
push ecx
push 1
lea edx, [ebp - 0x294]
push 4
push edx
call fcn.00501005
add esp, 0x30
cmp dword [ebp - 0x2a0], 0x200
jne 0x54b446
mov eax, dword [ebp - 0x298]
cmp eax, 0xffff
jae 0x54b446
cmp dword [ebp - 0x294], 0x64
jne 0x54b446
push eax
mov dword [0x5dd5bc], eax
call fcn.0040c6f7
mov ecx, dword [ebp - 0x290]
mov edx, dword [ebp - 0x298]
push ecx
push edx
push 1
push eax
mov dword [0x5dd5b8], eax
call fcn.00501005
add esp, 0x14
push esi
lea eax, [ebp - 0x238]
push eax
or eax, 0xffffffff
mov edi, 0x5d6a38
call fcn.00407970
mov ecx, dword [ebp - 0x290]
push ecx
call fcn.00500347
add esp, 4
mov edi, dword [0x5dd980]
cmp edi, dword [0x5dd984]
je 0x54b508
mov ebx, dword [ebp - 0x244]
lea ecx, [ecx]
mov esi, dword [edi + 0x10]
mov ecx, 8
cmp dword [edi + 0x14], ecx
jb 0x54b481
mov eax, dword [edi]
jmp 0x54b483
mov eax, edi
mov edx, ebx
cmp ebx, esi
jb 0x54b48b
mov edx, esi
cmp dword [ebp - 0x240], ecx
mov ecx, dword [ebp - 0x254]
jae 0x54b49f
lea ecx, [ebp - 0x254]
test edx, edx
je 0x54b4ba
mov bx, word [ecx]
cmp bx, word [eax]
jne 0x54b4d6
add ecx, 2
add eax, 2
dec edx
jne 0x54b4a3
mov ebx, dword [ebp - 0x244]
cmp ebx, esi
jb 0x54b4c9
xor eax, eax
cmp ebx, esi
setne al
test eax, eax
je 0x54b4e6
add edi, 0x1c
cmp edi, dword [0x5dd984]
jne 0x54b470
jmp 0x54b506
sbb eax, eax
and eax, 0xfffffffe
inc eax
je 0x54b4b4
mov ebx, dword [ebp - 0x244]
jmp 0x54b4c5
sub edi, dword [0x5dd980]
mov eax, 0x92492493
mov ecx, edi
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [0x5d69ec], eax
xor esi, esi
mov edi, dword [0x5dd980]
cmp edi, dword [0x5dd984]
je 0x54b5b8
mov esi, dword [ebp - 0x228]
mov ebx, dword [edi + 0x10]
mov ecx, 8
cmp dword [edi + 0x14], ecx
jb 0x54b531
mov eax, dword [edi]
jmp 0x54b533
mov eax, edi
mov edx, esi
cmp esi, ebx
jb 0x54b53b
mov edx, ebx
cmp dword [ebp - 0x224], ecx
mov ecx, dword [ebp - 0x238]
jae 0x54b54f
lea ecx, [ebp - 0x238]
test edx, edx
je 0x54b56a
mov si, word [ecx]
cmp si, word [eax]
jne 0x54b586
add ecx, 2
add eax, 2
dec edx
jne 0x54b553
mov esi, dword [ebp - 0x228]
cmp esi, ebx
jb 0x54b579
xor eax, eax
cmp esi, ebx
setne al
test eax, eax
je 0x54b596
add edi, 0x1c
cmp edi, dword [0x5dd984]
jne 0x54b520
jmp 0x54b5b6
sbb eax, eax
and eax, 0xfffffffe
inc eax
je 0x54b564
mov esi, dword [ebp - 0x228]
jmp 0x54b575
sub edi, dword [0x5dd980]
mov eax, 0x92492493
mov ecx, edi
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [0x5d69ec], eax
xor esi, esi
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x29c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x54b5de
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, 8
cmp dword [ebp - 0x224], edi
jb 0x54b5fa
mov ecx, dword [ebp - 0x238]
push ecx
call fcn.0040c6ec
add esp, 4
xor edx, edx
mov ebx, 7
mov dword [ebp - 0x224], ebx
mov dword [ebp - 0x228], esi
mov word [ebp - 0x238], dx
cmp dword [ebp - 0x240], edi
jb 0x54b62b
mov eax, dword [ebp - 0x254]
push eax
call fcn.0040c6ec
add esp, 4
mov eax, dword [ebp - 0x2c0]
xor ecx, ecx
mov dword [ebp - 0x240], ebx
mov dword [ebp - 0x244], esi
mov word [ebp - 0x254], cx
cmp eax, esi
je 0x54b653
push eax
call fcn.0040c6ec
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004ff57c
mov esp, ebp
pop ebp
ret