Function at 0x401040
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40b756
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 + 0x18]
call fcn.00401b20
xor esi, esi
mov dword [esp + 0x668], esi
mov dword [esp + 0x10], vtable.slDrvFile.0
mov dword [esp + 0x14], esi
push 0x210
lea eax, [esp + 0x38]
push esi
push eax
mov byte [esp + 0x674], 1
call fcn.00407250
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 0x40164b
push esi
lea ecx, [esp + 0x14]
push ecx
push 0x210
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 0x40164b
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 + 0x14]
push ecx
push 0x210
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 0x40164b
cmp word [esi], 0x2d
je 0x40116f
lea eax, [esp + 0x34]
push eax
jmp 0x40163b
movzx eax, word [esi + 2]
add eax, 0xffffff9d
cmp eax, 0x15
ja case.0x401186.102
movzx ecx, byte [eax + 0x40169c]
jmp dword [ecx*4 + 0x401670]
cmp edx, 3
jne case.0x401186.102
mov eax, dword [edi + 8]
lea ebx, [esp + 0x18]
call fcn.00402070
test eax, eax
jne 0x401627
mov eax, dword [esp + 0x24]
mov dword [esp + 0x34], eax
lea ecx, [esp + 0x34]
push ecx
jmp 0x401643
mov ecx, 4
cmp edx, ecx
jne 0x40127e
mov eax, dword [edi + 8]
push eax
lea ecx, [esp + 0x1c]
push ecx
mov ecx, dword [edi + 0xc]
call fcn.00401ed0
test eax, eax
jne 0x401627
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x34]
mov dword [esp + 0x34], edx
push eax
jmp 0x401643
cmp edx, 5
je 0x401627
lea ecx, [esp + 0x34]
push ecx
jmp 0x40163b
cmp edx, 3
jne case.0x401186.102
mov edx, dword [edi + 8]
lea eax, [esp + 0x44c]
push eax
lea ecx, [esp + 0x1c]
call fcn.00402a20
mov eax, dword [esp + 0x24]
test eax, eax
mov dword [esp + 0x34], eax
jne 0x4011b2
mov eax, dword [esp + 0x20]
mov ecx, 0x81
lea esi, [esp + 0x44c]
lea edi, [esp + 0x40]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x34]
mov dword [esp + 0x3c], 0x204
mov dword [esp + 0x38], eax
push ecx
jmp 0x401643
cmp edx, 3
jne case.0x401186.102
mov eax, dword [edi + 8]
push eax
lea edi, [esp + 0x1c]
call fcn.00402150
test eax, eax
jne 0x401627
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x34]
mov dword [esp + 0x34], ecx
push edx
jmp 0x401643
cmp edx, 3
jne 0x401165
mov edx, dword [edi + 8]
lea ecx, [esp + 0x18]
call fcn.00402260
jmp 0x401272
mov ecx, 4
cmp edx, ecx
je 0x4012ba
lea eax, [esp + 0x34]
mov dword [esp + 0x34], ecx
push eax
jmp 0x401643
mov edx, dword [edi + 0xc]
movzx eax, word [edx]
cmp ax, 0x69
jne 0x4012da
mov edx, dword [edi + 8]
xor eax, eax
push eax
lea ecx, [esp + 0x1c]
call fcn.00402810
jmp 0x4011a2
cmp ax, 0x73
jne 0x40127e
mov edx, dword [edi + 8]
mov eax, 1
push eax
lea ecx, [esp + 0x1c]
call fcn.00402810
jmp 0x4011a2
cmp edx, 2
jne 0x401165
lea ecx, [esp + 0x18]
push ecx
call fcn.00402ec0
jmp 0x4011da
cmp edx, 3
jne 0x4011fd
mov eax, dword [edi + 8]
test eax, eax
je case.0x401186.102
push eax
xor edx, edx
lea ecx, [esp + 0x14]
call fcn.00401860
test eax, eax
je 0x4015ef
mov edx, dword [edi + 8]
lea esi, [esp + 0x44c]
mov eax, edx
sub esi, edx
movzx ecx, word [eax]
mov word [esi + eax], cx
add eax, 2
test cx, cx
jne 0x401345
lea eax, [esp + 0x44c]
add eax, 0xfffffffe
mov edi, edi
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x401360
mov ecx, dword [str.winlh]
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.winlh
lea ecx, [esp + 0x14]
call fcn.00401860
test eax, eax
jne 0x4013b5
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x34]
mov dword [esp + 0x34], edx
push eax
jmp 0x401643
xor eax, eax
jmp 0x4013c0
movzx ecx, word [esp + eax + 0x44c]
mov word [esp + eax + 0x244], cx
add eax, 2
test cx, cx
jne 0x4013c0
lea edi, [esp + 0x244]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4013e2
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 0x401400
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 0x79
lea eax, [esp + 0x18]
call fcn.004016f0
test eax, eax
jne 0x401461
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x34]
mov dword [esp + 0x34], ecx
push edx
jmp 0x401643
xor eax, eax
jmp 0x401470
movzx ecx, word [esp + eax + 0x44c]
mov word [esp + eax + 0x244], cx
add eax, 2
test cx, cx
jne 0x401470
lea edi, [esp + 0x244]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x401492
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 0x4014b0
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 0x7a
lea eax, [esp + 0x18]
call fcn.004016f0
test eax, eax
je 0x4015ef
push str.i386
lea edx, [esp + 0x450]
lea ecx, [esp + 0x14]
call fcn.00401860
test eax, eax
je 0x4013a3
xor eax, eax
jmp 0x401530
movzx ecx, word [esp + eax + 0x44c]
mov word [esp + eax + 0x244], cx
add eax, 2
test cx, cx
jne 0x401530
lea eax, [esp + 0x244]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x401552
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 0x401582
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 0x4015a0
mov ecx, dword [str.slusb.sys]
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
lea edx, [esp + 0x244]
push edx
mov dword [eax + 0x10], ecx
push 0x7b
lea eax, [esp + 0x18]
call fcn.004016f0
test eax, eax
jne 0x401627
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x34]
mov dword [esp + 0x34], eax
push ecx
jmp 0x401643
cmp edx, 3
jne case.0x401186.102
mov edi, dword [edi + 8]
lea esi, [esp + 0x18]
call fcn.00403400
test eax, eax
je 0x4011aa
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x40], edx
mov dword [esp + 0x3c], 4
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x34]
mov dword [esp + 0x38], eax
push ecx
jmp 0x401643
lea edx, [esp + 0x34]
push edx
mov dword [esp + 0x38], 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.004034bc
mov esp, ebp
pop ebp
ret