Function at 0x401040
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40b2f6
mov eax, dword fs:[0]
push eax
sub esp, 0x650
mov eax, dword [0x40f020]
xor eax, esp
mov dword [esp + 0x648], eax
push ebx
push esi
push edi
mov eax, dword [0x40f020]
xor eax, esp
push eax
lea eax, [esp + 0x660]
mov dword fs:[0], eax
mov edi, dword [ebp + 0xc]
lea esi, [esp + 0x1c]
call fcn.00401cc0
xor esi, esi
mov dword [esp + 0x668], esi
mov dword [esp + 0x14], vtable.slDrvFile.0
mov dword [esp + 0x18], esi
push 0x20c
lea eax, [esp + 0x38]
push esi
push eax
mov byte [esp + 0x674], 1
call fcn.00406f40
mov edx, dword [ebp + 8]
add esp, 0xc
cmp edx, 2
jge 0x401106
push 0xfffffffffffffff5
mov dword [esp + 0x38], 4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp eax, 0xffffffff
jne 0x4010e1
or eax, 0xffffffff
jmp 0x4017f7
push esi
lea ecx, [esp + 0x18]
push ecx
push 0x20c
lea edx, [esp + 0x40]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
sbb eax, eax
neg eax
sub eax, 1
jmp 0x4017f7
mov esi, dword [edi + 4]
mov eax, esi
lea ebx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x401110
sub eax, ebx
sar eax, 1
cmp eax, 2
je 0x40115f
push 0xfffffffffffffff5
mov dword [esp + 0x38], 4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp eax, 0xffffffff
je 0x4010d9
push 0
lea ecx, [esp + 0x18]
push ecx
push 0x20c
lea edx, [esp + 0x40]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
sbb eax, eax
neg eax
sub eax, 1
jmp 0x4017f7
cmp word [esi], 0x2d
je 0x40116f
lea eax, [esp + 0x34]
push eax
jmp 0x4017e7
movzx eax, word [esi + 2]
add eax, 0xffffff9d
cmp eax, 0x15
ja case.0x401186.102
movzx ecx, byte [eax + 0x401844]
jmp dword [ecx*4 + 0x40181c]
cmp edx, 3
je 0x40119c
lea edx, [esp + 0x34]
push edx
jmp 0x4017e7
mov eax, dword [edi + 8]
lea esi, [esp + 0x1c]
call fcn.004021f0
test eax, eax
jne 0x4017d3
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x34]
mov dword [esp + 0x34], eax
push ecx
jmp 0x4017ef
mov ecx, 4
cmp edx, ecx
je 0x4011d9
lea edx, [esp + 0x34]
mov dword [esp + 0x34], ecx
push edx
jmp 0x4017ef
mov eax, dword [edi + 8]
push eax
lea ecx, [esp + 0x20]
push ecx
mov ecx, dword [edi + 0xc]
call fcn.00402050
test eax, eax
jne 0x4017d3
mov edx, dword [esp + 0x24]
mov dword [esp + 0x34], edx
lea eax, [esp + 0x34]
push eax
jmp 0x4017ef
cmp edx, 5
je 0x401212
lea ecx, [esp + 0x34]
jmp 0x4017e6
mov edx, dword [edi + 0x10]
push edx
call fcn.0040310b
add esp, 4
push eax
mov eax, dword [edi + 8]
push eax
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [edi + 0xc]
call fcn.004027f0
jmp 0x4011ea
cmp edx, 3
jne 0x401209
lea edx, [esp + 0x44c]
push edx
mov edx, dword [edi + 8]
lea ecx, [esp + 0x20]
call fcn.00402c00
mov eax, dword [esp + 0x24]
test eax, eax
mov dword [esp + 0x34], eax
jne 0x4011fa
mov edx, dword [esp + 0x20]
mov ecx, 0x81
lea esi, [esp + 0x44c]
lea edi, [esp + 0x40]
rep movsd dword es:[edi], dword [esi]
lea eax, [esp + 0x34]
mov dword [esp + 0x3c], 0x204
mov dword [esp + 0x38], edx
push eax
jmp 0x4017ef
cmp edx, 3
jne case.0x401186.102
mov edx, dword [edi + 8]
push edx
lea edi, [esp + 0x20]
call fcn.00402230
test eax, eax
jne 0x4017d3
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x34]
mov dword [esp + 0x34], eax
push ecx
jmp 0x4017ef
cmp edx, 3
je 0x4012c2
lea edx, [esp + 0x34]
push edx
jmp 0x4017e7
mov edi, dword [edi + 8]
lea esi, [esp + 0x1c]
call fcn.00402340
jmp 0x401299
mov ecx, 4
cmp edx, ecx
jne 0x40130d
mov eax, dword [edi + 0xc]
movzx eax, word [eax]
cmp ax, 0x69
jne 0x4012e9
xor eax, eax
jmp 0x4012f4
cmp ax, 0x73
jne 0x40131b
mov eax, 1
mov edx, dword [edi + 8]
push eax
lea ecx, [esp + 0x20]
call fcn.00402a10
test eax, eax
jne 0x4017d3
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x34]
mov dword [esp + 0x34], ecx
push edx
jmp 0x4017ef
lea eax, [esp + 0x34]
mov dword [esp + 0x34], ecx
push eax
jmp 0x4017ef
cmp edx, 2
jne case.0x401186.102
lea edx, [esp + 0x1c]
push edx
call fcn.00403040
jmp 0x401299
cmp edx, 3
jne 0x4012b8
mov eax, dword [edi + 8]
test eax, eax
jne 0x40135b
lea eax, [esp + 0x34]
push eax
jmp 0x4017e7
push eax
xor edx, edx
lea ecx, [esp + 0x18]
call fcn.00401a00
test eax, eax
jne 0x40137d
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x34]
mov dword [esp + 0x34], ecx
push edx
jmp 0x4017ef
mov edx, dword [edi + 8]
lea esi, [esp + 0x44c]
mov eax, edx
sub esi, edx
jmp 0x401390
movzx ecx, word [eax]
mov word [esi + eax], cx
add eax, 2
test cx, cx
jne 0x401390
lea eax, [esp + 0x44c]
add eax, 0xfffffffe
lea esp, [esp]
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x4013b0
mov ecx, dword [str.winxp]
mov dword [eax], ecx
mov ecx, dword [0x40da18]
mov dword [eax + 4], ecx
mov ecx, dword [0x40da1c]
mov dword [eax + 8], ecx
mov cx, word [0x40da20]
mov word [eax + 0xc], cx
push str.winxp
lea ecx, [esp + 0x18]
call fcn.00401a00
test eax, eax
jne 0x401405
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x34]
mov dword [esp + 0x34], edx
push eax
jmp 0x4017ef
xor eax, eax
jmp 0x401410
movzx ecx, word [esp + eax + 0x44c]
mov word [esp + eax + 0x244], cx
add eax, 2
test cx, cx
jne 0x401410
lea edi, [esp + 0x244]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x401432
mov ecx, dword [0x40da24]
lea eax, [esp + 0x244]
mov dword [edi], ecx
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x401450
mov edx, dword [0x40da28]
mov ecx, dword [str.usb.inf]
mov dword [eax], edx
mov edx, dword [0x40da30]
mov dword [eax + 4], ecx
mov ecx, dword [0x40da34]
mov dword [eax + 8], edx
mov edx, dword [0x40da38]
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], edx
lea eax, [esp + 0x244]
push eax
push 0x71
lea eax, [esp + 0x1c]
call fcn.00401890
test eax, eax
je 0x40136b
xor eax, eax
jmp 0x4014b0
movzx ecx, word [esp + eax + 0x44c]
mov word [esp + eax + 0x244], cx
add eax, 2
test cx, cx
jne 0x4014b0
lea edi, [esp + 0x244]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4014d2
mov eax, dword [0x40da24]
mov dword [edi], eax
lea eax, [esp + 0x244]
add eax, 0xfffffffe
nop
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x4014f0
mov ecx, dword [str.slusb.cat]
mov edx, dword [0x40da50]
mov dword [eax], ecx
mov ecx, dword [0x40da54]
mov dword [eax + 4], edx
mov edx, dword [0x40da58]
mov dword [eax + 8], ecx
mov ecx, dword [0x40da5c]
mov dword [eax + 0xc], edx
lea edx, [esp + 0x244]
push edx
mov dword [eax + 0x10], ecx
push 0x72
lea eax, [esp + 0x1c]
call fcn.00401890
test eax, eax
jne 0x401551
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x34]
mov dword [esp + 0x34], eax
push ecx
jmp 0x4017ef
push str.i386
lea edx, [esp + 0x450]
lea ecx, [esp + 0x18]
call fcn.00401a00
test eax, eax
je 0x4013f3
xor eax, eax
movzx ecx, word [esp + eax + 0x44c]
mov word [esp + eax + 0x244], cx
add eax, 2
test cx, cx
jne 0x401570
lea eax, [esp + 0x244]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x401592
mov ecx, dword [str.i386]
mov edx, dword [0x40da64]
mov dword [eax], ecx
mov ecx, dword [0x40da68]
lea edi, [esp + 0x244]
mov dword [eax + 4], edx
mov dword [eax + 8], ecx
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4015c2
mov edx, dword [0x40da24]
lea eax, [esp + 0x244]
mov dword [edi], edx
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x4015e0
mov ecx, dword [0x40da6c]
mov edx, dword [0x40da70]
mov dword [eax], ecx
mov ecx, dword [0x40da74]
mov dword [eax + 4], edx
mov edx, dword [0x40da78]
mov dword [eax + 8], ecx
mov ecx, dword [0x40da7c]
mov dword [eax + 0xc], edx
mov dx, word [0x40da80]
mov dword [eax + 0x10], ecx
mov word [eax + 0x14], dx
lea eax, [esp + 0x244]
push eax
push 0x74
lea eax, [esp + 0x1c]
call fcn.00401890
test eax, eax
je 0x40136b
xor eax, eax
movzx ecx, word [esp + eax + 0x44c]
mov word [esp + eax + 0x244], cx
add eax, 2
test cx, cx
jne 0x401640
lea eax, [esp + 0x244]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x401662
mov ecx, dword [str.i386]
mov edx, dword [0x40da64]
mov dword [eax], ecx
mov ecx, dword [0x40da68]
lea edi, [esp + 0x244]
mov dword [eax + 4], edx
mov dword [eax + 8], ecx
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x401692
mov edx, dword [0x40da24]
lea eax, [esp + 0x244]
mov dword [edi], edx
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x4016b0
mov ecx, dword [0x40da84]
mov edx, dword [0x40da88]
mov dword [eax], ecx
mov ecx, dword [0x40da8c]
mov dword [eax + 4], edx
mov edx, dword [0x40da90]
mov dword [eax + 8], ecx
mov ecx, dword [0x40da94]
mov dword [eax + 0xc], edx
lea edx, [esp + 0x244]
push edx
mov dword [eax + 0x10], ecx
push 0x75
lea eax, [esp + 0x1c]
call fcn.00401890
test eax, eax
je 0x40153f
xor eax, eax
jmp 0x401710
movzx ecx, word [esp + eax + 0x44c]
mov word [esp + eax + 0x244], cx
add eax, 2
test cx, cx
jne 0x401710
lea eax, [esp + 0x244]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x401732
mov edx, dword [str.i386]
mov ecx, dword [0x40da64]
mov dword [eax], edx
mov edx, dword [0x40da68]
lea edi, [esp + 0x244]
mov dword [eax + 4], ecx
mov dword [eax + 8], edx
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x401762
mov eax, dword [0x40da24]
mov dword [edi], eax
lea eax, [esp + 0x244]
add eax, 0xfffffffe
nop
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x401780
mov ecx, dword [0x40da98]
mov edx, dword [0x40da9c]
mov dword [eax], ecx
mov ecx, dword [0x40daa0]
mov dword [eax + 4], edx
mov edx, dword [0x40daa4]
mov dword [eax + 8], ecx
mov ecx, dword [0x40daa8]
mov dword [eax + 0xc], edx
lea edx, [esp + 0x244]
push edx
mov dword [eax + 0x10], ecx
push 0x73
lea eax, [esp + 0x1c]
call fcn.00401890
test eax, eax
je 0x40153f
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x34]
mov dword [esp + 0x38], edx
push eax
jmp 0x4017ef
lea ecx, [esp + 0x34]
push ecx
mov dword [esp + 0x38], 4
call entry0
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.00403110
mov esp, ebp
pop ebp
ret