Function at 0x47e8f0
Capabilities:
Clear file content
Get common file path
Get file size
Query environment variable

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc4
push ebx
push esi
push edi
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp byte [eax + 0x1b1], 0
jne 0x47e91b
mov eax, dword [ebp - 4]
cmp dword [eax + 0x1b8], 0
jbe 0x47ebb2
mov eax, dword [ebp - 4]
call fcn.0047d8a4
push eax
call sub.KERNEL32.DLL_GetEnvironmentVariableW
mov dword [ebp - 0xc], eax
xor ecx, ecx
push ebp
push 0x47ebab
push dword fs:[ecx]
mov dword fs:[ecx], esp
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 4]
call fcn.0047d8a4
push eax
call fcn.0040be5c
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 4]
call fcn.0047d8a4
push eax
call sub.KERNEL32.DLL_GetFileSize
push 2
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 4]
call fcn.0047d8a4
push eax
push 0
call sub.KERNEL32.DLL_SetEndOfFile
mov ecx, dword [ebp - 0x28]
neg ecx
mov edx, dword [ebp - 0x2c]
neg edx
lea eax, [ebp - 0x1c]
call fcn.0040a980
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.gdi32.dll_ExcludeClipRect
lea esi, [ebp - 0x2c]
lea edi, [ebp - 0x3c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1b8]
push eax
push eax
lea eax, [ebp - 0x1c]
push eax
call sub.KERNEL32.DLL_GetTempPathW
lea esi, [ebp - 0x1c]
lea edi, [ebp - 0x2c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push 0xfffffffffffffff0
mov eax, dword [ebp - 4]
call fcn.0047d8a4
push eax
call sub.KERNEL32.DLL_GetExitCodeThread
mov ebx, eax
test ebx, 0x200000
je 0x47ea03
mov eax, dword [ebp - 4]
call fcn.004750dc
test al, al
je 0x47e9f9
push 0x14
call sub.KERNEL32.DLL_GetDateFormatW
sub dword [ebp - 0x2c], eax
jmp 0x47ea03
push 0x14
call sub.KERNEL32.DLL_GetDateFormatW
add dword [ebp - 0x24], eax
test ebx, 0x100000
je 0x47ea15
push 0x15
call sub.KERNEL32.DLL_GetDateFormatW
add dword [ebp - 0x20], eax
mov eax, dword [ebp - 4]
cmp byte [eax + 0x1b1], 0
je 0x47eaea
xor esi, esi
mov eax, dword [ebp - 4]
movzx edx, byte [eax + 0x1af]
test dl, dl
je 0x47ea40
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1b4]
add esi, eax
mov eax, dword [ebp - 4]
movzx eax, byte [eax + 0x1b0]
test al, al
je 0x47ea59
mov ecx, dword [ebp - 4]
mov ecx, dword [ecx + 0x1b4]
add esi, ecx
mov ecx, dword [ebp - 4]
test byte [ecx + 0x1ae], 1
je 0x47ea68
sub dword [ebp - 0x2c], esi
mov ecx, dword [ebp - 4]
test byte [ecx + 0x1ae], 2
je 0x47ea77
sub dword [ebp - 0x28], esi
mov ecx, dword [ebp - 4]
test byte [ecx + 0x1ae], 4
je 0x47ea86
add dword [ebp - 0x24], esi
mov ecx, dword [ebp - 4]
test byte [ecx + 0x1ae], 8
je 0x47ea95
add dword [ebp - 0x20], esi
mov ecx, dword [ebp - 4]
movzx ecx, byte [ecx + 0x1ae]
mov ebx, dword [ebp - 4]
movzx ebx, byte [ebx + 0x1b1]
or ecx, dword [ebx*4 + 0x5585bc]
mov ebx, dword [ebp - 4]
movzx ebx, byte [ebx + 0x1e9]
or ecx, dword [ebx*4 + 0x5585cc]
or ecx, 0x2000
push ecx
and edx, 0x7f
mov edx, dword [edx*4 + 0x55859c]
and eax, 0x7f
or edx, dword [eax*4 + 0x5585ac]
push edx
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0xc]
push eax
call fcn.0040bd94
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.gdi32.dll_IntersectClipRect
lea esi, [ebp - 0x3c]
lea edi, [ebp - 0x2c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 8]
mov eax, dword [eax + 4]
cmp eax, 1
jne 0x47eb2c
mov ecx, dword [ebp - 0x28]
neg ecx
mov edx, dword [ebp - 0x2c]
neg edx
lea eax, [ebp - 0x2c]
call fcn.0040a980
jmp 0x47eb6f
lea edx, [ebp - 0x1c]
push edx
mov edx, dword [ebp - 8]
push eax
call sub.gdi32.dll_GetRgnBox
push 2
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 4]
call fcn.0047d8a4
push eax
push 0
call sub.KERNEL32.DLL_SetEndOfFile
lea ecx, [ebp - 0x1c]
lea edx, [ebp - 0x2c]
lea eax, [ebp - 0x2c]
call fcn.0040a908
mov ecx, dword [ebp - 0x38]
neg ecx
mov edx, dword [ebp - 0x3c]
neg edx
lea eax, [ebp - 0x2c]
call fcn.0040a980
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c0]
call fcn.004588cc
push eax
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0xc]
push eax
call fcn.0040be1c
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x47ebb2
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 4]
call fcn.0047d8a4
push eax
call sub.KERNEL32.DLL_InitializeCriticalSection
ret
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx - 0x10]
mov eax, dword [ebp - 4]
call fcn.0048b028
test al, al
je 0x47ebe1
mov eax, dword [ebp - 4]
test byte [eax + 0x52], 2
je 0x47ebe1
call fcn.00489918
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.0048ae68
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret