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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5d3edf
mov eax, dword fs:[0]
push eax
sub esp, 0x29c
mov eax, dword [0x638fe4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x284], ecx
mov ecx, dword [0x644060]
mov eax, 0x2aaaaaab
sub ecx, dword [0x644058]
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 0x80
jae 0x58fc17
push 0x80
mov ecx, 0x644058
call fcn.0040aa90
mov esi, dword [sym.imp.WINSPOOL.DRV_Ordinal_203]
lea eax, [ebp - 0x28c]
push eax
push 0
mov dword [ebp - 0x28c], 0
call esi
mov eax, dword [ebp - 0x28c]
test eax, eax
je 0x5903bc
push eax
lea ecx, [ebp - 0x2a4]
call fcn.0040a6c0
lea eax, [ebp - 0x28c]
mov dword [ebp - 4], 0
mov edi, dword [ebp - 0x2a4]
push eax
push edi
call esi
push dword [ebp - 0x28c]
push edi
call fcn.0054c667
add esp, 8
mov dword [ebp - 0x234], 7
xor ecx, ecx
mov dword [ebp - 0x238], 0
mov word [ebp - 0x248], cx
lea ecx, [ebp - 0x248]
push eax
push edi
call fcn.00409660
lea eax, [ebp - 0x294]
mov byte [ebp - 4], 1
mov esi, dword [sym.imp.WINSPOOL.DRV_EnumPrintersW]
push eax
lea eax, [ebp - 0x290]
mov dword [ebp - 0x290], 0
push eax
push 0
push 0
push 4
push 0
push 6
mov dword [ebp - 0x294], 0
call esi
push dword [ebp - 0x290]
call fcn.0040e5a7
add esp, 4
mov ebx, eax
lea eax, [ebp - 0x294]
mov dword [ebp - 0x288], ebx
push eax
lea eax, [ebp - 0x290]
push eax
push dword [ebp - 0x290]
push ebx
push 4
push 0
push 6
call esi
xor edi, edi
cmp dword [ebp - 0x294], edi
jbe 0x58fdf4
mov esi, ebx
jmp 0x58fd20
mov edx, dword [esi]
xor eax, eax
mov dword [ebp - 0x24c], 7
mov dword [ebp - 0x250], 0
mov word [ebp - 0x260], ax
cmp word [edx], ax
jne 0x58fd48
xor ecx, ecx
jmp 0x58fd5f
mov ecx, edx
lea ebx, [ecx + 2]
lea ecx, [ecx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x58fd50
sub ecx, ebx
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x260]
call fcn.00409660
lea eax, [ebp - 0x260]
mov byte [ebp - 4], 2
push eax
mov ecx, 0x644058
call fcn.0040a7e0
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x24c]
cmp eax, 8
jb 0x58fdde
mov ecx, dword [ebp - 0x260]
inc eax
cmp eax, 0x7fffffff
ja 0x590277
add eax, eax
cmp eax, 0x1000
jb 0x58fdd5
test cl, 0x1f
jne 0x590277
mov eax, dword [ecx - 4]
cmp eax, ecx
jae 0x590277
sub ecx, eax
cmp ecx, 4
jb 0x590277
cmp ecx, 0x23
ja 0x590277
mov ecx, eax
push ecx
call fcn.0040e5b0
add esp, 4
inc edi
add esi, 0xc
cmp edi, dword [ebp - 0x294]
jb 0x58fd20
mov ebx, dword [ebp - 0x288]
push ebx
call fcn.0040e5b0
mov eax, dword [0x643c8c]
add esp, 4
test eax, eax
je 0x58fe19
push eax
call fcn.0040e5b0
add esp, 4
mov dword [0x643c8c], 0
xor eax, eax
mov dword [ebp - 0x21c], 7
mov dword [ebp - 0x220], 0
mov word [ebp - 0x230], ax
push 0x104
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 3
push eax
push str._APPDATA_CanonIJ_Scan_Utility
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ecx, dword [0x643bf0]
xor eax, eax
mov esi, dword [ebp - 0x284]
test ecx, ecx
je 0x58fe7d
cmp esi, 0x9fbf1
push 0x2000000
setne al
dec eax
and eax, 4
push dword [eax + 0x644028]
call ecx
push eax
mov edx, esi
lea ecx, [ebp - 0x298]
call fcn.005b5f80
add esp, 4
mov byte [ebp - 4], 4
lea eax, [ebp - 0x218]
mov esi, dword [ebp - 0x298]
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push esi
push eax
call edi
push str.PRINTER.DAT
lea eax, [ebp - 0x218]
push eax
call edi
push 0x60e810
lea eax, [ebp - 0x218]
mov dword [ebp - 0x27c], 0
push eax
lea eax, [ebp - 0x27c]
push eax
call fcn.0054ca3b
mov eax, dword [ebp - 0x27c]
add esp, 0xc
test eax, eax
je 0x5900c5
push eax
push 1
lea eax, [ebp - 0x288]
mov dword [ebp - 0x288], 0
push 4
push eax
mov dword [ebp - 0x280], 0
mov dword [ebp - 0x284], 0
call fcn.0054e6d6
push dword [ebp - 0x27c]
lea eax, [ebp - 0x280]
push 1
push 4
push eax
call fcn.0054e6d6
push dword [ebp - 0x27c]
lea eax, [ebp - 0x284]
push 1
push 4
push eax
call fcn.0054e6d6
add esp, 0x30
cmp dword [ebp - 0x288], 0x100
jne 0x590014
mov eax, dword [ebp - 0x280]
cmp eax, 0xffff
jae 0x590014
cmp dword [ebp - 0x284], 1
jne 0x590014
push eax
lea ecx, [ebp - 0x254]
call fcn.0040a6c0
mov byte [ebp - 4], 5
push dword [ebp - 0x27c]
mov edi, dword [ebp - 0x254]
push dword [ebp - 0x280]
push 2
push edi
call fcn.0054e6d6
add esp, 0x10
mov dword [ebp - 0x264], 7
xor eax, eax
mov dword [ebp - 0x268], 0
lea ecx, [ebp - 0x278]
mov word [ebp - 0x278], ax
push dword [ebp - 0x280]
push edi
call fcn.00409660
lea eax, [ebp - 0x278]
push eax
lea ecx, [ebp - 0x230]
call fcn.00409580
mov eax, dword [ebp - 0x264]
cmp eax, 8
jb 0x58fffb
inc eax
push eax
push dword [ebp - 0x278]
call fcn.00402320
mov byte [ebp - 4], 4
test edi, edi
je 0x590014
mov eax, dword [ebp - 0x24c]
sub eax, edi
sar eax, 1
push eax
push edi
call fcn.00402320
push dword [ebp - 0x27c]
lea eax, [ebp - 0x288]
push 1
push 4
push eax
call fcn.0054e6d6
push dword [ebp - 0x27c]
lea eax, [ebp - 0x280]
push 1
push 4
push eax
call fcn.0054e6d6
push dword [ebp - 0x27c]
lea eax, [ebp - 0x284]
push 1
push 4
push eax
call fcn.0054e6d6
add esp, 0x30
cmp dword [ebp - 0x288], 0x200
jne 0x5900b7
mov eax, dword [ebp - 0x280]
cmp eax, 0xffff
jae 0x5900b7
cmp dword [ebp - 0x284], 0x64
jne 0x5900b7
push eax
mov dword [0x643c90], eax
call fcn.0040e5a7
push dword [ebp - 0x27c]
mov dword [0x643c8c], eax
push dword [ebp - 0x280]
push 1
push eax
call fcn.0054e6d6
add esp, 0x14
lea eax, [ebp - 0x230]
mov ecx, 0x644040
push 0xffffffffffffffff
push 0
push eax
call fcn.004098c0
push dword [ebp - 0x27c]
call fcn.0054caf8
add esp, 4
mov ecx, dword [0x644058]
mov eax, dword [0x64405c]
cmp ecx, eax
je 0x59012f
mov ebx, dword [ebp - 0x238]
lea ebx, [ebx]
cmp dword [ecx + 0x14], 8
jb 0x5900ea
mov edi, dword [ecx]
jmp 0x5900ec
mov edi, ecx
cmp dword [ebp - 0x234], 8
mov edx, dword [ebp - 0x248]
jae 0x590101
lea edx, [ebp - 0x248]
mov eax, dword [ecx + 0x10]
cmp ebx, eax
jb 0x59010a
mov ebx, eax
test ebx, ebx
jne 0x590150
xor eax, eax
mov ebx, dword [ebp - 0x238]
test eax, eax
jne 0x590123
mov eax, dword [ecx + 0x10]
cmp ebx, eax
jb 0x590123
jbe 0x590171
mov eax, dword [0x64405c]
add ecx, 0x18
cmp ecx, eax
jne 0x5900e0
mov edi, dword [0x644058]
mov ecx, edi
cmp ecx, eax
je 0x59021d
mov ebx, dword [ebp - 0x220]
cmp dword [ecx + 0x14], 8
jb 0x590196
mov edi, dword [ecx]
jmp 0x590198
mov ax, word [edx]
cmp ax, word [edi]
jne 0x590163
add edx, 2
add edi, 2
sub ebx, 1
jmp 0x59010c
movzx eax, word [edx]
cmp ax, word [edi]
sbb eax, eax
and eax, 0xfffffffe
inc eax
jmp 0x590110
mov edi, dword [0x644058]
mov eax, 0x2aaaaaab
sub ecx, edi
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [0x639940], eax
mov eax, dword [0x64405c]
jmp 0x590135
mov edi, ecx
cmp dword [ebp - 0x21c], 8
mov edx, dword [ebp - 0x230]
jae 0x5901ad
lea edx, [ebp - 0x230]
mov eax, dword [ecx + 0x10]
cmp ebx, eax
jb 0x5901b6
mov ebx, eax
test ebx, ebx
jne 0x5901e0
xor eax, eax
mov ebx, dword [ebp - 0x220]
test eax, eax
jne 0x5901cf
mov eax, dword [ecx + 0x10]
cmp ebx, eax
jb 0x5901cf
jbe 0x590201
add ecx, 0x18
cmp ecx, dword [0x64405c]
jne 0x590145
jmp 0x59021d
mov ax, word [edx]
cmp ax, word [edi]
jne 0x5901f3
add edx, 2
add edi, 2
sub ebx, 1
jmp 0x5901b8
movzx eax, word [edx]
cmp ax, word [edi]
sbb eax, eax
and eax, 0xfffffffe
inc eax
jmp 0x5901bc
sub ecx, dword [0x644058]
mov eax, 0x2aaaaaab
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [0x639940], eax
mov byte [ebp - 4], 3
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x59025e
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x59025c
mov ecx, dword [ecx + 4]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CWin32Heap.0
jne 0x59025c
push 0
push dword [ecx + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x59025e
call edx
mov eax, dword [ebp - 0x21c]
cmp eax, 8
jb 0x5902c0
mov ecx, dword [ebp - 0x230]
inc eax
cmp eax, 0x7fffffff
jbe 0x59027c
call fcn.0054a598
add eax, eax
cmp eax, 0x1000
jb 0x5902b7
test byte [ebp - 0x230], 0x1f
je 0x590293
call fcn.0054a598
mov eax, dword [ecx - 4]
cmp eax, ecx
jb 0x59029f
call fcn.0054a598
sub ecx, eax
cmp ecx, 4
jae 0x5902ab
call fcn.0054a598
cmp ecx, 0x23
jbe 0x5902b5
call fcn.0054a598
mov ecx, eax
push ecx
call fcn.0040e5b0
add esp, 4
xor eax, eax
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov eax, dword [ebp - 0x234]
mov dword [ebp - 0x220], 0
cmp eax, 8
jb 0x59033f
mov ecx, dword [ebp - 0x248]
inc eax
cmp eax, 0x7fffffff
jbe 0x5902fb
call fcn.0054a598
add eax, eax
cmp eax, 0x1000
jb 0x590336
test byte [ebp - 0x248], 0x1f
je 0x590312
call fcn.0054a598
mov eax, dword [ecx - 4]
cmp eax, ecx
jb 0x59031e
call fcn.0054a598
sub ecx, eax
cmp ecx, 4
jae 0x59032a
call fcn.0054a598
cmp ecx, 0x23
jbe 0x590334
call fcn.0054a598
mov ecx, eax
push ecx
call fcn.0040e5b0
add esp, 4
mov ecx, dword [ebp - 0x2a4]
xor eax, eax
mov dword [ebp - 0x234], 7
mov dword [ebp - 0x238], 0
mov word [ebp - 0x248], ax
test ecx, ecx
je 0x5903bc
mov eax, dword [ebp - 0x29c]
sub eax, ecx
sar eax, 1
cmp eax, 0x7fffffff
jbe 0x59037c
call fcn.0054a598
add eax, eax
cmp eax, 0x1000
jb 0x5903b3
test cl, 0x1f
je 0x59038f
call fcn.0054a598
mov eax, dword [ecx - 4]
cmp eax, ecx
jb 0x59039b
call fcn.0054a598
sub ecx, eax
cmp ecx, 4
jae 0x5903a7
call fcn.0054a598
cmp ecx, 0x23
jbe 0x5903b1
call fcn.0054a598
mov ecx, eax
push ecx
call fcn.0040e5b0
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 - 0x10]
xor ecx, ebp
call fcn.00544774
mov esp, ebp
pop ebp
ret