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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x578426
mov eax, dword fs:[0]
push eax
sub esp, 0x224
mov eax, dword [0x5d52e0]
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 esi, ecx
mov ecx, dword [0x5dd984]
sub ecx, dword [0x5dd980]
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x54ac35
cmp eax, dword [0x5d69ec]
jle 0x54ac35
push 0x104
lea eax, [ebp - 0x218]
push eax
push str._APPDATA_CanonIJ_Scan_Utility
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
xor ebx, ebx
xor eax, eax
cmp esi, 0x9fbf1
jne 0x54aa17
lea eax, [ebx + 1]
mov ecx, dword [0x5dd530]
cmp ecx, ebx
jne 0x54aa25
xor eax, eax
jmp 0x54aa34
mov edx, dword [eax*4 + 0x5dd9a0]
push 0x2000000
push edx
call ecx
push esi
mov ecx, eax
lea edi, [ebp - 0x22c]
call fcn.00530ca0
add esp, 4
mov dword [ebp - 4], ebx
mov edi, dword [ebp - 0x22c]
mov esi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push edi
lea eax, [ebp - 0x218]
push eax
call esi
push str.PRINTER.DAT
lea ecx, [ebp - 0x218]
push ecx
call esi
call fcn.0040c84f
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x54aa86
push 0x80004005
call fcn.004010a0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [ebp - 0x230], esi
push 0x5aaed0
lea ecx, [ebp - 0x218]
push ecx
lea edx, [ebp - 0x21c]
mov byte [ebp - 4], 1
push edx
mov dword [ebp - 0x21c], ebx
call fcn.005000ef
add esp, 0xc
cmp dword [ebp - 0x21c], ebx
je 0x54abf3
mov dword [ebp - 0x220], ebx
mov dword [ebp - 0x224], ebx
mov dword [ebp - 0x228], 0x100
call fcn.00408c40
mov ecx, dword [ebp - 0x21c]
mov eax, dword [eax + 0x10]
push ecx
push 1
lea edx, [ebp - 0x228]
push 4
push edx
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x224], 1
call fcn.00501179
mov eax, dword [ebp - 0x21c]
push eax
push 1
lea ecx, [ebp - 0x220]
push 4
push ecx
call fcn.00501179
mov edx, dword [ebp - 0x21c]
push edx
push 1
lea eax, [ebp - 0x224]
push 4
push eax
call fcn.00501179
add esp, 0x30
call fcn.00408c40
cmp dword [eax + 0x14], 8
jb 0x54ab4c
mov eax, dword [eax]
mov ecx, dword [ebp - 0x21c]
mov edx, dword [ebp - 0x220]
push ecx
push edx
push 2
push eax
call fcn.00501179
mov ecx, dword [ebp - 0x21c]
mov eax, dword [0x5dd5bc]
push ecx
push 1
lea edx, [ebp - 0x228]
push 4
push edx
mov dword [ebp - 0x228], 0x200
mov dword [ebp - 0x220], eax
mov dword [ebp - 0x224], 0x64
call fcn.00501179
mov eax, dword [ebp - 0x21c]
push eax
push 1
lea ecx, [ebp - 0x220]
push 4
push ecx
call fcn.00501179
mov edx, dword [ebp - 0x21c]
push edx
push 1
lea eax, [ebp - 0x224]
push 4
push eax
call fcn.00501179
mov ecx, dword [ebp - 0x21c]
mov edx, dword [ebp - 0x220]
mov eax, dword [0x5dd5b8]
add esp, 0x40
push ecx
push edx
push 1
push eax
call fcn.00501179
mov ecx, dword [ebp - 0x21c]
push ecx
call fcn.00500347
add esp, 0x14
lea eax, [esi - 0x10]
mov byte [ebp - 4], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x54ac12
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [edi - 0x10]
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x54ac35
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
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.004ff57c
mov esp, ebp
pop ebp
ret