Function at 0x401040
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40d1e6
mov eax, dword fs:[0]
push eax
sub esp, 0x650
mov eax, dword [0x411020]
xor eax, esp
mov dword [esp + 0x648], eax
push ebx
push esi
push edi
mov eax, dword [0x411020]
xor eax, esp
push eax
lea eax, [esp + 0x660]
mov dword fs:[0], eax
mov edi, dword [ebp + 0xc]
xor esi, esi
mov dword [esp + 0x1c], vtable.slDrvPnp98.0
mov dword [esp + 0x28], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x668], esi
mov dword [esp + 0x14], vtable.slDrvFile.0
mov dword [esp + 0x18], esi
push 0x210
lea eax, [esp + 0x238]
push esi
push eax
mov byte [esp + 0x674], 1
call fcn.00406e60
mov edx, dword [ebp + 8]
add esp, 0xc
cmp edx, 2
jge 0x401116
push 0xfffffffffffffff5
mov dword [esp + 0x238], 4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp eax, 0xffffffff
jne 0x4010ee
or eax, 0xffffffff
jmp 0x401226
push esi
lea ecx, [esp + 0x18]
push ecx
push 0x210
lea edx, [esp + 0x240]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
sbb eax, eax
neg eax
sub eax, 1
jmp 0x401226
mov esi, dword [edi + 4]
mov eax, esi
lea ebx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x401120
sub eax, ebx
cmp eax, 2
je 0x401171
push 0xfffffffffffffff5
mov dword [esp + 0x238], 4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp eax, 0xffffffff
je 0x4010e6
push 0
lea ecx, [esp + 0x18]
push ecx
push 0x210
lea edx, [esp + 0x240]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
sbb eax, eax
neg eax
sub eax, 1
jmp 0x401226
cmp byte [esi], 0x2d
je 0x401183
lea eax, [esp + 0x234]
push eax
jmp 0x401213
movsx eax, byte [esi + 1]
add eax, 0xffffff9d
cmp eax, 0x15
ja case.0x401196.102
movzx ecx, byte [eax + 0x4015ac]
jmp dword [ecx*4 + 0x401580]
cmp edx, 3
jne case.0x401196.102
mov eax, dword [edi + 8]
push eax
lea esi, [esp + 0x20]
call fcn.00402660
test eax, eax
jne 0x401568
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x234], ecx
lea edx, [esp + 0x234]
push edx
jmp 0x40121e
cmp edx, 5
jne 0x401176
mov ecx, dword [edi + 8]
mov edx, dword [edi + 0xc]
push ecx
mov ecx, dword [edi + 0x10]
push edx
lea edx, [esp + 0x24]
call fcn.004022c0
test eax, eax
jne 0x401568
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x234]
mov dword [esp + 0x234], eax
push ecx
jmp 0x40121e
cmp edx, 3
je 0x401568
lea edx, [esp + 0x234]
push edx
mov dword [esp + 0x238], 4
call fcn.00401000
add esp, 4
mov ecx, dword [esp + 0x660]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x648]
xor ecx, esp
call fcn.004030dc
mov esp, ebp
pop ebp
ret
cmp edx, 3
jne 0x401176
lea ecx, [esp + 0x1c]
push ecx
mov ecx, dword [edi + 8]
lea esi, [esp + 0x30]
call fcn.00402cd0
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esp + 0x234], eax
jne 0x4011c2
mov eax, dword [esp + 0x24]
mov ecx, 0x81
lea edi, [esp + 0x240]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x234]
mov dword [esp + 0x23c], 0x204
mov dword [esp + 0x238], eax
push ecx
jmp 0x40121e
cmp edx, 3
jne 0x401176
mov ecx, dword [edi + 8]
push ecx
lea ecx, [esp + 0x20]
call fcn.00402730
test eax, eax
jne 0x401568
mov edx, dword [esp + 0x28]
lea eax, [esp + 0x234]
mov dword [esp + 0x234], edx
push eax
jmp 0x40121e
cmp edx, 3
je 0x4012f0
lea ecx, [esp + 0x234]
push ecx
jmp 0x401213
mov ecx, dword [edi + 8]
lea edx, [esp + 0x1c]
push edx
call fcn.004029a0
jmp 0x4011e5
mov ecx, 4
cmp edx, ecx
jne 0x4011bb
mov eax, dword [edi + 0xc]
mov al, byte [eax]
cmp al, 0x69
jne 0x401329
mov edi, dword [edi + 8]
lea ecx, [esp + 0x1c]
xor ebx, ebx
push ecx
call fcn.00402b30
jmp 0x4012be
cmp al, 0x73
jne 0x401344
mov edi, dword [edi + 8]
lea ecx, [esp + 0x1c]
mov ebx, 1
push ecx
call fcn.00402b30
jmp 0x4012be
mov dword [esp + 0x234], ecx
lea ecx, [esp + 0x234]
push ecx
jmp 0x40121e
cmp edx, 2
jne case.0x401196.102
lea eax, [esp + 0x1c]
push eax
call fcn.00402f60
jmp 0x4011af
cmp edx, 3
jne 0x401176
mov edx, dword [edi + 8]
test edx, edx
je 0x4012e3
push 0
lea ecx, [esp + 0x18]
call fcn.00401770
test eax, eax
jne 0x4013ab
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x234]
mov dword [esp + 0x234], edx
push eax
jmp 0x40121e
mov esi, dword [edi + 8]
lea edx, [esp + 0x54c]
mov eax, esi
sub edx, esi
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x4013c0
lea eax, [esp + 0x54c]
add eax, 0xffffffff
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x4013d6
mov ecx, dword [str.win98]
mov dx, word [0x40fb20]
mov dword [eax], ecx
mov cl, byte [0x40fb22]
lea edi, [esp + 0x54c]
mov word [eax + 4], dx
mov byte [eax + 6], cl
add edi, 0xffffffff
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x401406
mov dx, word [0x40fb24]
mov word [edi], dx
push esi
mov edx, str.win98
lea ecx, [esp + 0x18]
call fcn.00401770
test eax, eax
je 0x40151d
xor eax, eax
jmp 0x401440
mov cl, byte [esp + eax + 0x54c]
mov byte [esp + eax + 0x444], cl
add eax, 1
test cl, cl
jne 0x401440
lea eax, [esp + 0x444]
add eax, 0xffffffff
nop
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x401460
mov edx, dword [str.slusb.inf]
mov ecx, dword [0x40fb2c]
mov dword [eax], edx
mov dx, word [0x40fb30]
mov dword [eax + 4], ecx
mov word [eax + 8], dx
lea eax, [esp + 0x444]
push eax
push 0x6c
lea eax, [esp + 0x1c]
call fcn.00401600
test eax, eax
jne 0x4014b5
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x234]
mov dword [esp + 0x234], ecx
push edx
jmp 0x40121e
xor eax, eax
jmp 0x4014c0
mov cl, byte [esp + eax + 0x54c]
mov byte [esp + eax + 0x444], cl
add eax, 1
test cl, cl
jne 0x4014c0
lea eax, [esp + 0x444]
add eax, 0xffffffff
nop
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x4014e0
mov ecx, dword [str.slusb.sys]
mov edx, dword [0x40fb40]
mov dword [eax], ecx
mov cx, word [0x40fb44]
mov dword [eax + 4], edx
lea edx, [esp + 0x444]
push edx
mov word [eax + 8], cx
push 0x6d
lea eax, [esp + 0x1c]
call fcn.00401600
test eax, eax
jne 0x401568
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x234]
mov dword [esp + 0x234], eax
push ecx
jmp 0x40121e
cmp edx, 3
jne case.0x401196.102
mov edi, dword [edi + 8]
lea esi, [esp + 0x1c]
call fcn.00403020
test eax, eax
je 0x4011ed
mov edx, dword [esp + 0x20]
mov dword [esp + 0x240], edx
mov dword [esp + 0x23c], 4
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x234]
mov dword [esp + 0x238], eax
push ecx
jmp 0x40121e