Function at 0x412810
Capabilities:
Check for peb ntglobalflag flag
Get common file path
Get file size
Get number of processors
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4d4442
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x55c
push ebx
push ebp
push esi
push edi
mov ebx, ecx
push 1
mov dword [esp + 0x24], ebx
call sub.MFC42.DLL_CWnd::UpdateData
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x469]
mov byte [esp + 0x468], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x261]
mov byte [esp + 0x260], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x468]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea ecx, [esp + 0x260]
xor esi, esi
push ecx
push esi
lea edx, [esp + 0x470]
push 0x518bac
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
mov al, byte [esp + 0x13]
push esi
lea ecx, [esp + 0x58]
mov byte [esp + 0x58], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
lea ecx, [esp + 0x13]
mov dword [esp + 0x574], esi
push ecx
lea ecx, [esp + 0x68]
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea edx, [esp + 0x2f]
lea ecx, [esp + 0x74]
push edx
mov byte [esp + 0x578], 1
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea eax, [esp + 0x31]
lea ecx, [esp + 0x84]
push eax
mov byte [esp + 0x578], 2
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea ecx, [esp + 0x33]
mov byte [esp + 0x574], 3
push ecx
lea ecx, [esp + 0x98]
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea edx, [esp + 0x27]
lea ecx, [esp + 0xa4]
push edx
mov byte [esp + 0x578], 4
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea eax, [esp + 0x35]
lea ecx, [esp + 0xb4]
push eax
mov byte [esp + 0x578], 5
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea ecx, [esp + 0x2d]
mov byte [esp + 0x574], 6
push ecx
lea ecx, [esp + 0xc8]
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea edx, [esp + 0x37]
lea ecx, [esp + 0xd4]
push edx
mov byte [esp + 0x578], 7
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea eax, [esp + 0x36]
lea ecx, [esp + 0xe4]
push eax
mov byte [esp + 0x578], 8
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea ecx, [esp + 0x30]
mov byte [esp + 0x574], 9
push ecx
lea ecx, [esp + 0xf8]
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea edx, [esp + 0x34]
lea ecx, [esp + 0x104]
push edx
mov byte [esp + 0x578], 0xa
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea eax, [esp + 0x32]
lea ecx, [esp + 0x114]
push eax
mov byte [esp + 0x578], 0xb
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea ecx, [esp + 0x2e]
mov byte [esp + 0x574], 0xc
push ecx
lea ecx, [esp + 0x128]
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
mov edi, 0x517724
or ecx, 0xffffffff
xor eax, eax
mov dword [esp + 0x574], 0xd
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x517724
lea ecx, [esp + 0x7c]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
mov edi, 0x517724
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x517724
lea ecx, [esp + 0xec]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
mov edi, 0x517724
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x517724
lea ecx, [esp + 0xdc]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
lea edx, [esp + 0x40]
mov dword [esp + 0x40], esi
push edx
mov dword [esp + 0x48], esi
call fcn.00421000
add esp, 4
test eax, eax
je 0x412b11
mov edx, dword [esp + 0x44]
mov ebp, dword [esp + 0x40]
mov eax, edx
mov ecx, edx
sar eax, 0x10
mov esi, eax
mov eax, edx
sar ecx, 0x1f
sar eax, 0x1f
mov edi, edx
mov ecx, 0x10
mov eax, ebp
and esi, 0xff
and edi, 0xff
call fcn.004cf2d0
and ebp, 0xff
and eax, 0xff
push ebp
push eax
push edi
push esi
push str._d._02d._02d._02d
lea ecx, [esp + 0x148]
push 0x28
push ecx
call dword [sym.imp.MSVCRT.dll__snprintf]
lea edi, [esp + 0x150]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x1c
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [esp + 0x134]
push ecx
push edx
lea ecx, [esp + 0xac]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
xor esi, esi
jmp 0x412b33
mov edi, 0x517724
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x517724
lea ecx, [esp + 0xac]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x365]
mov byte [esp + 0x364], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x50]
push eax
call dword [sym.imp.MSVCRT.dll_time]
lea ecx, [esp + 0x54]
push ecx
call dword [sym.imp.MSVCRT.dll_localtime]
push eax
push 0x518ba0
lea edx, [esp + 0x374]
push 0x104
push edx
call dword [sym.imp.MSVCRT.dll_strftime]
lea edi, [esp + 0x37c]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x18
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x364]
push ecx
push eax
lea ecx, [esp + 0x8c]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
mov ecx, dword [ebx + 0x234]
lea ebp, [ebx + 0x234]
cmp dword [ecx - 8], esi
je 0x412c1c
push 0x104
mov ecx, ebp
call sub.MFC42.DLL_CString::GetBuffer
mov esi, eax
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov ebx, ecx
lea ecx, [esp + 0xc8]
push ebx
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x412c0d
mov edi, dword [esp + 0xc8]
mov ecx, ebx
mov edx, ecx
push ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0xc8]
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
push 0xffffffffffffffff
mov ecx, ebp
call sub.MFC42.DLL_CString::ReleaseBuffer
mov ebx, dword [esp + 0x20]
jmp 0x412c6b
mov edi, 0x5265c0
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
lea ecx, [esp + 0xc8]
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x412c6d
mov edi, dword [esp + 0xc8]
mov ecx, ebp
mov eax, ecx
mov esi, 0x5265c0
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0xc8]
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
xor esi, esi
mov dword [esp + 0x14], esi
mov dword [esp + 0x28], esi
mov edx, dword [0x52d100]
mov ecx, 0x52d100
mov byte [esp + 0x574], 0xf
mov dword [esp + 0x3c], 0x52d100
call dword [edx + 4]
mov eax, dword [0x52662c]
mov byte [esp + 0x574], 0x10
cmp eax, esi
jne 0x412d01
cmp dword [0x526628], esi
jne 0x412d01
push 0xb0
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [esp + 0x48], eax
cmp eax, esi
mov byte [esp + 0x574], 0x11
je 0x412cd3
push esi
mov ecx, eax
call fcn.00404bd0
jmp 0x412cd5
xor eax, eax
mov dword [0x526628], eax
mov eax, dword [0x517cd8]
push eax
push 0x404ba0
mov ecx, 0x52b648
mov byte [esp + 0x57c], 0x10
call fcn.00402160
mov dword [0x52662c], 1
mov edx, dword [0x52d100]
mov esi, dword [0x526628]
mov ecx, 0x52d100
mov byte [esp + 0x574], 0xf
call dword [edx + 8]
lea eax, [esp + 0x28]
mov ecx, esi
push eax
call fcn.0044d1e0
test eax, eax
jl 0x412e76
mov eax, dword [esp + 0x28]
test eax, eax
je 0x412e76
mov ecx, dword [eax]
lea edx, [esp + 0x14]
push edx
push 0x518b90
push eax
call dword [ecx + 0xc]
test eax, eax
jl 0x412e76
mov eax, dword [esp + 0x14]
test eax, eax
je 0x412e76
push 0x10000
call dword [sym.imp.MSVCRT.dll_malloc]
mov ecx, dword [esp + 0xcc]
add esp, 4
test ecx, ecx
mov ebx, eax
jne 0x412d82
mov ecx, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov eax, dword [esp + 0x14]
push ecx
push 0x10000
push ebx
mov edx, dword [eax]
push eax
call dword [edx + 0x54]
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
lea ecx, [esp + 0xb8]
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x412ddc
mov edi, dword [esp + 0xb8]
mov ecx, ebp
mov eax, ecx
mov esi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0xb8]
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x15d]
mov byte [esp + 0x15c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x14]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x44]
push eax
push 0x51842c
lea edx, [esp + 0x164]
push 0x104
push edx
call dword [sym.imp.MSVCRT.dll__snprintf]
lea edi, [esp + 0x16c]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov ebp, ecx
lea ecx, [esp + 0x68]
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x412e68
mov edi, dword [esp + 0x68]
mov ecx, ebp
mov eax, ecx
lea esi, [esp + 0x15c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x68]
mov dword [esp + 0x6c], ebp
mov byte [ecx + ebp], 0
push ebx
call dword [sym.imp.MSVCRT.dll_free]
mov ebx, dword [esp + 0x24]
add esp, 4
add ebx, 0x230
push 0x104
mov ecx, ebx
call sub.MFC42.DLL_CString::GetBuffer
mov esi, eax
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov ebp, ecx
lea ecx, [esp + 0x98]
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x412ed5
mov edi, dword [esp + 0x98]
mov ecx, ebp
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x98]
mov dword [esp + 0x9c], ebp
mov byte [eax + ebp], 0
push 0xffffffffffffffff
mov ecx, ebx
call sub.MFC42.DLL_CString::ReleaseBuffer
mov eax, dword [esp + 0x98]
xor ebx, ebx
cmp eax, ebx
jne 0x412ef0
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocStringLen
push eax
call edi
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x3c], ebp
je 0x4130a3
lea ecx, [esp + 0x38]
mov dword [esp + 0x38], ebx
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
xor byte [ecx + 0x548b004e], al
and al, 0x38