Function at 0x402160
Capabilities:
Create directory

Disassembly:
push 0xffffffffffffffff
push 0x407dfc
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x660
push ebx
push ebp
push esi
lea eax, [esp + 0x18]
push edi
push eax
push str.ProgramFilesDir
push str.SOFTWAREMicrosoftWindowsCurrentVersion
push 0x80000002
mov byte [esp + 0x2c], 0
call fcn.00401e00
or ebp, 0xffffffff
mov edi, str.KyoceraKMSLTwain
mov ecx, ebp
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x1c]
mov esi, edi
mov ebx, ecx
mov edi, edx
mov ecx, ebp
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
push 0x628
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.00402aea
add esp, 4
mov dword [esp + 0x14], eax
xor esi, esi
cmp eax, esi
mov dword [esp + 0x678], esi
je 0x4021f9
mov ecx, eax
call fcn.00401590
mov edi, eax
mov dword [esp + 0x18], edi
jmp 0x4021ff
mov dword [esp + 0x18], esi
mov edi, esi
cmp edi, esi
mov dword [esp + 0x678], ebp
je 0x402453
lea eax, [esp + 0x1c]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
push esi
push esi
lea ecx, [esp + 0x24]
push esi
push ecx
push str.Twain
mov ecx, edi
call fcn.00401bc0
push 0x1c
call fcn.00402aea
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, esi
mov dword [esp + 0x678], 1
je 0x402256
mov ecx, eax
call fcn.004013a0
mov ebx, eax
jmp 0x402258
xor ebx, ebx
cmp ebx, esi
mov dword [esp + 0x678], ebp
je 0x402443
mov esi, dword [sym.imp.USER32.dll_wsprintfA]
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x124]
push str._s.inf
push eax
mov byte [esp + 0x1d], 0
mov byte [esp + 0x1e], 0
mov byte [esp + 0x1f], 0
call esi
add esp, 0xc
lea ecx, [esp + 0x530]
lea edx, [esp + 0x120]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, ebp
mov dword [esp + 0x14], eax
je 0x4023e7
mov edi, dword [sym.imp.KERNEL32.dll_MoveFileA]
mov ebp, dword [sym.imp.KERNEL32.dll_FindNextFileA]
lea eax, [esp + 0x55c]
lea ecx, [esp + 0x1c]
push eax
push ecx
lea edx, [esp + 0x128]
push str._s_s
push edx
call esi
add esp, 0x10
lea eax, [esp + 0x120]
mov ecx, ebx
push str.KXDriver
push eax
call fcn.004014e0
test al, al
je 0x40232b
lea ecx, [esp + 0x1c]
push str.OEMSETUP.INF
push ecx
lea edx, [esp + 0x330]
push str._s_s
push edx
call esi
add esp, 0x10
lea eax, [esp + 0x328]
lea ecx, [esp + 0x120]
push eax
push ecx
call edi
mov byte [esp + 0x11], 1
lea edx, [esp + 0x120]
push str.USB2GM
push edx
mov ecx, ebx
call fcn.004014e0
test al, al
je 0x402376
lea eax, [esp + 0x1c]
push str.USB2GM.INF
push eax
lea ecx, [esp + 0x434]
push str._s_s
push ecx
call esi
add esp, 0x10
lea edx, [esp + 0x42c]
lea eax, [esp + 0x120]
push edx
push eax
call edi
mov byte [esp + 0x12], 1
lea ecx, [esp + 0x120]
push str.KMUSBSCN
push ecx
mov ecx, ebx
call fcn.004014e0
test al, al
je 0x4023c1
lea edx, [esp + 0x1c]
push str.KMUSBSCN.INF
push edx
lea eax, [esp + 0x22c]
push str._s_s
push eax
call esi
add esp, 0x10
lea ecx, [esp + 0x224]
lea edx, [esp + 0x120]
push ecx
push edx
call edi
mov byte [esp + 0x13], 1
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x530]
push eax
push ecx
call ebp
test eax, eax
jne 0x4022c1
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov edi, dword [esp + 0x18]
mov al, byte [edi + 4]
test al, al
je 0x402405
mov al, byte [esp + 0x12]
test al, al
je 0x402405
lea eax, [esp + 0x42c]
mov ecx, ebx
push eax
call fcn.00401570
mov al, byte [esp + 0x13]
test al, al
je 0x40241c
lea ecx, [esp + 0x224]
push ecx
mov ecx, ebx
call fcn.00401570
mov al, byte [esp + 0x11]
test al, al
je 0x402433
lea edx, [esp + 0x328]
mov ecx, ebx
push edx
call fcn.00401570
mov ecx, ebx
call fcn.004013b0
push ebx
call fcn.00402adf
add esp, 4
mov ecx, edi
call fcn.004015a0
push edi
call fcn.00402adf
add esp, 4
mov ecx, dword [esp + 0x670]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov dword fs:[0], ecx
add esp, 0x66c
ret