Function at 0x408210
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Delete drive layout via ioctl
Get disk information
Print debug messages
Read file on windows
Write and execute a file
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2604
call fcn.0042c9d0
mov eax, dword [0x468600]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
xor edi, edi
push 0x7fe
mov dword [ebp - 0x2580], eax
mov esi, edx
lea eax, [ebp - 0x2526]
xor edx, edx
push edi
push eax
mov dword [ebp - 0x258c], ecx
mov dword [ebp - 0x2534], ebx
mov dword [ebp - 0x2538], edi
mov dword [ebp - 0x259c], edi
mov dword [ebp - 0x254c], 0xffffffff
mov word [ebp - 0x2528], dx
call fcn.00429d20
add esp, 0xc
push 0x7fe
lea edx, [ebp - 0x1126]
xor ecx, ecx
push edi
push edx
mov word [ebp - 0x1128], cx
call fcn.00429d20
add esp, 0xc
push 0x206
lea ecx, [ebp - 0x23e]
xor eax, eax
push edi
push ecx
mov word [ebp - 0x240], ax
call fcn.00429d20
add esp, 0xc
push 0x40
or eax, 0xffffffff
lea edx, [ebp - 0x25fc]
push edi
push edx
mov dword [ebp - 0x2530], edi
mov dword [ebp - 0x253c], eax
mov dword [ebp - 0x2540], eax
mov dword [ebp - 0x2600], edi
call fcn.00429d20
xor eax, eax
mov dword [ebp - 0x2578], edi
mov dword [ebp - 0x2598], edi
mov dword [ebp - 0x2568], edi
mov dword [ebp - 0x2544], edi
mov dword [ebp - 0x2548], edi
mov dword [ebp - 0x2574], eax
mov dword [ebp - 0x2570], eax
mov dword [ebp - 0x256c], eax
mov dword [ebp - 0x2594], eax
mov dword [ebp - 0x2590], eax
mov dword [ebp - 0x2564], eax
mov dword [ebp - 0x2560], eax
mov dword [ebp - 0x255c], eax
mov dword [ebp - 0x2558], eax
mov dword [ebp - 0x2554], eax
mov eax, dword [esi + 0x10]
lea edi, [esi + 0x10]
add esp, 0xc
cmp dword [eax - 0xc], 0
jne 0x40838c
mov ecx, dword [esi + 0x28]
mov esi, dword [esi + 0x14]
mov edi, dword [ecx]
test esi, esi
jne 0x408388
call fcn.004292b7
cmp edi, dword [esi + 0x14]
jne 0x408366
call fcn.004292b7
mov edx, dword [edi + 8]
push edx
push 0x45d374
lea eax, [ebp - 0x1128]
push 0x400
push eax
call fcn.004296cf
add esp, 0x10
jmp 0x40840d
mov esi, dword [esi]
jmp 0x40835c
mov ecx, eax
push ecx
push 0x45d374
lea edx, [ebp - 0x1128]
push 0x400
push edx
call fcn.004296cf
mov eax, dword [edi]
mov esi, dword [eax - 0xc]
push str.0123456789
push eax
call fcn.00429870
add esp, 0x18
test eax, eax
jne 0x4083c1
or eax, 0xffffffff
jmp 0x4083c5
sub eax, dword [edi]
sar eax, 1
sub esi, eax
push esi
lea ecx, [ebp - 0x2584]
push ecx
mov ecx, edi
call fcn.00405ce0
mov eax, dword [eax]
push 0xa
push 0
push eax
call fcn.004296a3
mov dword [ebp - 0x254c], eax
mov eax, dword [ebp - 0x2584]
add eax, 0xfffffff0
add esp, 0xc
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40840d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0
push 0x80
push 3
push 0
push 3
push 0xc0000000
lea ecx, [ebp - 0x1128]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x408456
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x1128]
push edx
push 0x45dd40
push 0x100
push ebx
call fcn.004296cf
add esp, 0x14
jmp 0x408496
lea eax, [ebp - 0x2588]
push eax
lea ecx, [ebp - 0x25a0]
push ecx
push edi
call fcn.00448700
add esp, 0xc
test eax, eax
jne 0x408532
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x45dd6c
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2540]
cmp eax, 0xffffffff
je 0x4084a8
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x253c]
cmp eax, 0xffffffff
je 0x4084ba
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x2548]
test eax, eax
je 0x4084cd
push eax
call fcn.004297a2
add esp, 4
mov eax, dword [ebp - 0x2544]
test eax, eax
je 0x4084e0
push eax
call fcn.004297a2
add esp, 4
cmp dword [ebp - 0x2530], 0
je 0x40851b
mov ebx, dword [ebp - 0x2534]
mov edi, dword [ebp - 0x2530]
xor esi, esi
test ebx, ebx
jbe 0x408512
cmp dword [edi + esi*4], 0
je 0x40850d
mov ecx, dword [edi + esi*4]
push ecx
call fcn.004297a2
add esp, 4
inc esi
cmp esi, ebx
jb 0x4084fb
push edi
call fcn.004297a2
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x2538]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00427f57
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push 0
lea edx, [ebp - 0x252c]
push edx
push 0
push 0
push 0
push 0
push 0x7c100
push edi
call esi
test eax, eax
jne 0x408566
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_DISK_DELETE_DRIVE_LAYOUT
jmp 0x408481
push 0
mov dword [ebp - 0x25b8], 0
call fcn.00429082
add esp, 4
push 0
mov dword [ebp - 0x25b4], eax
lea eax, [ebp - 0x252c]
push eax
push 0
push 0
push 0x18
lea ecx, [ebp - 0x25b8]
push ecx
push 0x7c058
push edi
call esi
test eax, eax
jne 0x4085b3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_DISK_CREATE_DISK
jmp 0x408481
push 0
lea edx, [ebp - 0x252c]
push edx
push 0
push 0
push 0
push 0
push 0x70140
push edi
call esi
test eax, eax
jne 0x4085e1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_DISK_UPDATE_PROPERTIES
jmp 0x408481
push 0
lea eax, [ebp - 0x252c]
push eax
push 0x18
lea ecx, [ebp - 0x2568]
push ecx
push 0
push 0
push 0x70000
push edi
call esi
test eax, eax
jne 0x408614
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_DISK_GET_DRIVE_GEOMETRY
jmp 0x408481
mov eax, dword [ebp - 0x2554]
mul dword [ebp - 0x2558]
mov ecx, dword [ebp - 0x255c]
push 0
push ecx
push edx
push eax
call fcn.0042c720
mov ecx, dword [ebp - 0x2564]
push ecx
mov ecx, dword [ebp - 0x2568]
push ecx
push edx
push eax
call fcn.0042c720
push 1
push 0x150
mov esi, eax
mov ebx, edx
call fcn.00429830
add esp, 8
mov dword [ebp - 0x2544], eax
test eax, eax
jne 0x40867f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x2534]
push eax
push 0x45def0
push 0x100
push edx
jmp 0x408487
push 0
call fcn.00429082
mov ecx, dword [ebp - 0x2544]
mov dword [ecx + 8], eax
mov dword [ecx], 0
mov dword [ecx + 4], 1
mov dword [ecx + 0x30], 0
mov eax, dword [ebp - 0x2554]
mul dword [ebp - 0x2558]
add esp, 4
push 0
sub esi, eax
mov dword [ecx + 0x3c], edx
sbb ebx, edx
lea edx, [ebp - 0x252c]
push edx
push 0
push 0
push 0x150
push ecx
mov dword [ecx + 0x38], eax
mov dword [ecx + 0x40], esi
mov dword [ecx + 0x44], ebx
mov dword [ecx + 0x48], 1
mov byte [ecx + 0x4c], 1
mov byte [ecx + 0x50], 7
mov byte [ecx + 0x51], 1
mov byte [ecx + 0x52], 1
mov eax, dword [ebp - 0x2558]
push 0x7c054
push edi
mov dword [ecx + 0x54], eax
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov ebx, dword [ebp - 0x2534]
test eax, eax
jne 0x408749
test ebx, ebx
je 0x408749
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_DISK_SET_DRIVE_LAYOUT_EX
push 0x100
push ebx
call fcn.004296cf
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
add esp, 0x10
push ebx
call esi
push 0x45df74
call esi
push 0x100
push 0
push ebx
call fcn.00429d20
add esp, 0xc
push 0
lea eax, [ebp - 0x252c]
push eax
push 0
push 0
push 0
push 0
push 0x70140
push edi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x4085d0
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x2530]
push ecx
call fcn.00408020
add esp, 4
mov dword [ebp - 0x2534], eax
test eax, eax
jne 0x4087b8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x45df78
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
jmp 0x408496
xor esi, esi
cmp dword [ebp - 0x2534], esi
jbe 0x408a66
mov edi, dword [ebp - 0x259c]
lea esp, [esp]
mov edx, dword [ebp - 0x2530]
mov eax, dword [edx + esi*4]
push eax
call fcn.00408190
add esp, 4
cmp dword [ebp - 0x254c], eax
jne 0x408a51
mov ecx, dword [ebp - 0x2530]
mov ecx, dword [ecx + esi*4]
lea edx, [ebp - 0x240]
lea ecx, [ecx]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
test ax, ax
jne 0x408800
lea edi, [ebp - 0x240]
add edi, 0xfffffffe
lea ebx, [ebx]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x408820
mov edx, dword [0x45dfa0]
push 0x104
lea eax, [ebp - 0x240]
push eax
mov ecx, eax
push ecx
mov dword [edi], edx
call dword [sym.imp.KERNEL32.dll_GetVolumeNameForVolumeMountPointW]
test eax, eax
je 0x408884
lea edx, [ebp - 0x252c]
push edx
push 0x104
lea eax, [ebp - 0x240]
push eax
mov ecx, eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetVolumePathNamesForVolumeNameW]
test eax, eax
je 0x408884
cmp dword [ebp - 0x252c], 0
je 0x408884
cmp word [ebp - 0x240], 0
jne 0x408a7e
xor edx, edx
push 0x32
push edx
lea eax, [ebp - 0x36]
push eax
mov word [ebp - 0x38], dx
call fcn.00429d20
add esp, 0xc
xor ecx, ecx
push 0xce
push ecx
lea edx, [ebp - 0x30e]
push edx
mov word [ebp - 0x310], cx
call fcn.00429d20
add esp, 0xc
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x516]
push ecx
mov word [ebp - 0x518], ax
call fcn.00429d20
add esp, 0xc
xor edx, edx
push 0x206
push edx
lea eax, [ebp - 0x926]
push eax
mov word [ebp - 0x928], dx
call fcn.00429d20
add esp, 0xc
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x71e]
push edx
mov word [ebp - 0x720], cx
call fcn.00429d20
add esp, 0xc
lea eax, [ebp - 0x310]
push eax
push 0x68
call dword [sym.imp.KERNEL32.dll_GetLogicalDriveStringsW]
lea ecx, [ebp - 0x310]
movzx eax, word [ecx]
test ax, ax
je 0x408957
cmp ax, 0x41
jb 0x40893f
cmp ax, 0x5a
ja 0x40893f
movzx eax, ax
jmp 0x408945
movzx eax, ax
sub eax, 0x20
add ecx, 8
mov edx, 1
mov word [ebp + eax*2 - 0xba], dx
jne 0x408926
mov eax, 0x44
lea esp, [esp]
movzx ecx, ax
cmp word [ebp + ecx*2 - 0xba], 0
je 0x408975
inc eax
cmp ax, 0x5a
jbe 0x408960
movzx edi, ax
push edi
push 0x45dfd0
lea edx, [ebp - 0x240]
push 0x104
push edx
call fcn.004296cf
push edi
push str._C:_
lea eax, [ebp - 0x720]
push 0x104
push eax
call fcn.004296cf
mov edx, dword [ebp - 0x2530]
mov eax, dword [edx + esi*4]
add esp, 0x20
push 0x104
lea ecx, [ebp - 0x518]
push ecx
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_QueryDosDeviceW]
lea ecx, [ebp - 0x518]
push ecx
lea edx, [ebp - 0x240]
push edx
push 1
call dword [sym.imp.KERNEL32.dll_DefineDosDeviceW]
test eax, eax
je 0x408bf3
push 0x104
lea eax, [ebp - 0x928]
push eax
lea ecx, [ebp - 0x720]
push ecx
call dword [sym.imp.KERNEL32.dll_GetVolumeNameForVolumeMountPointW]
test eax, eax
je 0x408c12
lea edx, [ebp - 0x518]
push edx
lea eax, [ebp - 0x240]
push eax
push 7
call dword [sym.imp.KERNEL32.dll_DefineDosDeviceW]
test eax, eax
je 0x408c31
lea ecx, [ebp - 0x928]
push ecx
lea edx, [ebp - 0x720]
push edx
call dword [sym.imp.KERNEL32.dll_SetVolumeMountPointW]
test eax, eax
je 0x408c50
push 0x1f4
mov edi, 1
call dword [sym.imp.KERNEL32.dll_Sleep]
inc esi
cmp esi, dword [ebp - 0x2534]
jb 0x4087d0
test edi, edi
jne 0x408b94
push str.b_rN0R
push 0x100
push ebx
call fcn.004296cf
add esp, 0xc
jmp 0x408496
push 1
push 0x10000
mov dword [ebp - 0x252c], 0x10000
call fcn.00429830
mov esi, eax
add esp, 8
mov dword [ebp - 0x2548], esi
test esi, esi
jne 0x408ac2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x45def0
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
jmp 0x408496
movzx eax, word [ebp - 0x240]
push eax
push str.._C:
lea ecx, [ebp - 0x1128]
push 0x400
push ecx
call fcn.004296cf
add esp, 0x10
push 0
push 0x80
push 3
push 0
push 3
push 0xc0000000
lea edx, [ebp - 0x1128]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x408b1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x1128]
push eax
jmp 0x408441
push edi
call fcn.00448880
add esp, 4
push edi
call fcn.00448820
add esp, 4
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x252c]
xor edx, edx
push eax
div dword [ebp - 0x2588]
mov edx, edi
mov ecx, eax
call fcn.00407fb0
add esp, 4
test eax, eax
jne 0x408b84
mov edx, dword [ebp - 0x252c]
push eax
lea ecx, [ebp - 0x252c]
push ecx
push edx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408b84
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x45dfa4
jmp 0x408481
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov word [ebp - 0x23c], ax
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
push edi
lea ecx, [ebp - 0x2598]
push ecx
lea edx, [ebp - 0x253c]
push edx
lea eax, [ebp - 0x2540]
push eax
mov dword [ebp - 0x2598], 0xc
mov dword [ebp - 0x2590], 1
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x408c6f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x45e1d0
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
jmp 0x408496
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DefineDosDevice__DDD_RAW_TARGET_PATH_
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
jmp 0x408496
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetVolumeNameForVolumeMountPoint
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
jmp 0x408496
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DefineDosDevice__DDD_RAW_TARGET_PATHDDD_REMOVE_DEFINITIONDDD_EXACT_MATCH_ON_REMOVE_
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
jmp 0x408496
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetVolumeMountPoint
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
jmp 0x408496
mov eax, dword [ebp - 0x253c]
mov edx, dword [ebp - 0x2580]
mov dword [ebp - 0x25c4], eax
mov dword [ebp - 0x25c0], eax
movzx eax, word [ebp - 0x240]
push edx
push eax
xor ecx, ecx
push str.cmd.exe__c_Format__C:__FS:_s__Q__Y__X__U__force
mov word [ebp - 0x25d0], cx
lea ecx, [ebp - 0x2528]
push 0x400
push ecx
mov dword [ebp - 0x2600], 0x44
mov dword [ebp - 0x25d4], 0x101
call fcn.004296cf
add esp, 0x14
lea edx, [ebp - 0x2578]
push edx
lea eax, [ebp - 0x2600]
push eax
push edi
push edi
push edi
push 1
push edi
push edi
lea ecx, [ebp - 0x2528]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x408d0c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x45e268
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
jmp 0x408496
mov edx, dword [ebp - 0x253c]
push edx
call esi
mov eax, dword [ebp - 0x2578]
push 0xea60
push eax
mov dword [ebp - 0x253c], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x408e20
mov edx, dword [ebp - 0x2578]
lea ecx, [ebp - 0x257c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
jne 0x408d62
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x45e298
jmp 0x408e00
cmp dword [ebp - 0x257c], edi
je 0x408e16
push 0x3ff
lea eax, [ebp - 0x1527]
push edi
push eax
mov byte [ebp - 0x1528], 0
call fcn.00429d20
add esp, 0xc
push 0x7fe
lea edx, [ebp - 0x1d26]
xor ecx, ecx
push edi
push edx
mov word [ebp - 0x1d28], cx
call fcn.00429d20
mov edx, dword [ebp - 0x2540]
add esp, 0xc
push edi
lea eax, [ebp - 0x252c]
push eax
push 0x400
lea ecx, [ebp - 0x1528]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x252c]
push 0x400
lea ecx, [ebp - 0x1d28]
push ecx
push 0xffffffffffffffff
lea edx, [ebp - 0x1528]
push edx
push edi
push edi
mov byte [ebp + eax - 0x1529], 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [ebp - 0x1d28]
push eax
push 0x45d374
push 0x100
push ebx
call fcn.004296cf
add esp, 0x10
mov dword [ebp - 0x2538], edi
jmp 0x408e20
mov dword [ebp - 0x2538], 1
mov eax, dword [ebp - 0x258c]
cmp eax, edi
je 0x408e45
movzx ecx, word [ebp - 0x240]
push ecx
push 0x45dfd0
push 0x104
push eax
call fcn.004296cf
add esp, 0x10
mov edx, dword [ebp - 0x2578]
push edx
call esi
mov eax, dword [ebp - 0x2574]
push eax
call esi
jmp 0x408496