Function at 0x40a520
Capabilities:
Read .ini file
Set file attributes

Disassembly:
push 0xffffffffffffffff
push 0x456e9c
mov eax, dword fs:[0]
push eax
mov eax, 0x10128
call fcn.00441390
mov eax, dword [0x46be4c]
xor eax, esp
mov dword [esp + 0x10124], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x46be4c]
xor eax, esp
push eax
lea eax, [esp + 0x1013c]
mov dword fs:[0], eax
mov eax, dword [esp + 0x1014c]
xor ebp, ebp
push 0x7fff
lea ecx, [esp + 0x13c]
push ebp
push ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], ebp
call fcn.004413c0
push 0x7fff
lea edx, [esp + 0x8148]
push ebp
push edx
call fcn.004413c0
add esp, 0x18
call fcn.004316f5
mov ecx, dword [eax + 4]
call fcn.0041df90
push eax
lea eax, [esp + 0x38]
push 0x104
push eax
call fcn.004423ff
add esp, 0xc
push 0x20
lea ecx, [esp + 0x38]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea edx, [esp + 0x34]
push edx
push 0x7fff
lea eax, [esp + 0x140]
push eax
push str.DeviceDesc
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileSectionA]
lea esi, [esp + ebp + 0x138]
push esi
lea ecx, [esp + 0x18]
call fcn.004027b0
push 0x45d32c
lea ecx, [esp + 0x18]
mov dword [esp + 0x10148], 0
call fcn.00407740
push 1
lea ecx, [esp + 0x1c]
push ecx
lea ecx, [esp + 0x1c]
call fcn.00407350
mov eax, dword [eax]
push 0x45d328
push eax
call fcn.00442f25
add esp, 8
test eax, eax
mov eax, dword [esp + 0x18]
setne bl
add eax, 0xfffffff0
or edi, 0xffffffff
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40a654
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
je 0x40a904
mov ebx, dword [esp + 0x28]
push ebx
push esi
call fcn.00442610
add esp, 8
test eax, eax
jne 0x40a952
push ebx
lea ecx, [esp + 0x20]
call fcn.004027b0
mov eax, dword [esp + 0x14]
cmp dword [eax - 0xc], 0
mov byte [esp + 0x10144], 1
jg 0x40a692
mov eax, edi
jmp 0x40a6a9
push 0x20
push eax
call fcn.00442df6
add esp, 8
test eax, eax
jne 0x40a6a5
mov eax, edi
jmp 0x40a6a9
sub eax, dword [esp + 0x14]
add eax, 1
push eax
lea ecx, [esp + 0x30]
push ecx
lea ecx, [esp + 0x1c]
call fcn.00401ea0
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x10148], 2
call fcn.00402020
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
mov byte [esp + 0x10144], 1
lea edx, [eax + 0xc]
mov ecx, edi
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40a6f4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x14]
cmp dword [ecx - 0xc], 0
je 0x40a8dd
push 5
lea edx, [esp + 0x28]
push edx
lea ecx, [esp + 0x24]
call fcn.00407350
mov eax, dword [eax]
push str.Canon
push eax
call fcn.00442f25
add esp, 8
test eax, eax
mov eax, dword [esp + 0x24]
sete bl
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a746
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
je 0x40a8dd
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40a8dd
mov ecx, dword [esp + 0x1c]
cmp dword [ecx - 0xc], 0
jl 0x40a8e1
push eax
push ecx
call fcn.00442d29
add esp, 8
test eax, eax
je 0x40a8dd
mov ecx, dword [esp + 0x1c]
sub eax, ecx
js 0x40a8e1
lea eax, [ecx - 0x10]
mov dword [esp + 0x20], 1
mov byte [esp + 0x10144], 0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a7b1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov dword [esp + 0x10144], edi
lock xadd dword [ecx], edi
dec edi
test edi, edi
jg 0x40a7d5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x34]
push ecx
push 0x7fff
lea edx, [esp + 0x8140]
push edx
push str.DriverDesc
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileSectionA]
xor edi, edi
lea ebp, [edi + 3]
jmp 0x40a800
lea esi, [esp + edi + 0x8138]
push esi
lea ecx, [esp + 0x1c]
call fcn.004027b0
push 0x45d32c
lea ecx, [esp + 0x1c]
mov dword [esp + 0x10148], ebp
call fcn.00407740
push 1
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x20]
call fcn.00407350
mov eax, dword [eax]
push 0x45d328
push eax
call fcn.00442f25
add esp, 8
test eax, eax
mov eax, dword [esp + 0x24]
setne bl
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a86b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
je 0x40a885
mov ecx, dword [esp + 0x28]
push ecx
push esi
call fcn.00442610
add esp, 8
test eax, eax
jne 0x40a95f
mov eax, esi
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a890
sub eax, edx
mov esi, eax
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea edi, [edi + esi + 1]
mov dword [esp + 0x10144], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40a8cc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
jne 0x40a800
mov eax, dword [esp + 0x20]
jmp 0x40a991
mov ecx, dword [esp + 0x1c]
lea eax, [ecx - 0x10]
mov byte [esp + 0x10144], 0
lea ecx, [eax + 0xc]
mov edx, edi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a904
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a910
sub eax, edx
mov esi, eax
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ebp, [esi + ebp + 1]
mov dword [esp + 0x10144], edi
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edi
dec edi
test edi, edi
jg 0x40a945
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
jne 0x40a5e3
jmp 0x40a7d5
mov dword [esp + 0x20], 1
jmp 0x40a7b1
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov esi, 1
mov dword [esp + 0x10144], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a98f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x1013c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x10124]
xor ecx, esp
call fcn.0044027a
add esp, 0x10134
ret