Function at 0x4a1c30
Capabilities:
Get common file path
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea esi, [ebp - 0x110]
push ebx
mov ebx, ecx
mov edi, dword fs:[0x18]
sub esp, 0x138
mov dword [ebp - 0x128], edx
mov dword [ebp - 0x120], eax
mov dword [esp + 4], esi
mov dword [esp], 0x104
call dword [sym.imp.kernel32.dll_GetTempPathA]
sub esp, 8
mov dword [esp + 0xc], ebx
mov dword [esp], esi
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5d3758
call dword [sym.imp.kernel32.dll_GetTempFileNameA]
sub esp, 0x10
mov dword [esp], ebx
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x40000000
call dword [sym.imp.kernel32.dll_CreateFileA]
sub esp, 0x1c
mov esi, eax
call fcn.0057d110
mov dword [eax], 0x5d3477
mov dword [eax + 4], 0x12f
mov eax, dword [edi + 0x34]
mov dword [esp + 8], ebx
mov dword [esp + 0xc], eax
xor eax, eax
cmp esi, 0xffffffff
setne al
mov dword [esp + 4], str.failed_to_create__s_err__lu_n
xor ebx, ebx
mov dword [esp], eax
call fcn.0049fda0
cmp esi, 0xffffffff
je 0x4a1f36
mov ecx, dword [sym.imp.kernel32.dll_WriteFile]
lea ebx, [ebp - 0x114]
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x40
mov dword [esp + 4], 0x79e760
mov dword [esp], esi
mov dword [ebp - 0x124], ecx
call ecx
sub esp, 0x14
mov ebx, eax
call fcn.0057d110
mov dword [eax], 0x5d3477
mov dword [eax + 4], 0x134
mov eax, dword [edi + 0x34]
mov dword [esp], ebx
lea ebx, [ebp - 0x114]
mov dword [esp + 8], eax
mov dword [esp + 4], str.WriteFile_error__ld_n
call fcn.0049fda0
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], 0
mov edx, dword [ebp - 0x120]
movzx eax, word [edx + 0x14]
mov dword [esp + 4], edx
mov dword [esp], esi
add eax, 0x18
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x124]
call ecx
sub esp, 0x14
mov ebx, eax
call fcn.0057d110
mov dword [eax], 0x5d3477
mov dword [eax + 4], 0x138
mov eax, dword [edi + 0x34]
mov dword [esp], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.WriteFile_error__ld_n
call fcn.0049fda0
lea eax, [ebp - 0x114]
mov dword [edi + 0x34], 0xdeadbeef
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0x120]
movzx eax, word [edx + 6]
mov dword [esp + 4], 0x57f2c0
mov dword [esp], esi
lea eax, [eax + eax*4]
shl eax, 3
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x124]
call ecx
sub esp, 0x14
mov ebx, eax
call fcn.0057d110
mov dword [eax], 0x5d3477
mov dword [eax + 4], 0x13d
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.WriteFile_error__ld_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.0049fda0
mov edx, dword [ebp - 0x120]
cmp word [edx + 6], 0
je 0x4a1f14
mov ebx, 0x57f2d0
xor ecx, ecx
nop
mov dword [ebp - 0x11c], ecx
add ebx, 0x28
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov eax, dword [ebx - 0x24]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
lea eax, [ebp - 0x114]
mov dword [edi + 0x34], 0xdeadbeef
sub esp, 0x10
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebx - 0x28]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x128]
mov dword [esp], esi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x124]
call eax
sub esp, 0x14
mov dword [ebp - 0x118], eax
call fcn.0057d110
mov dword [eax], 0x5d3477
mov dword [eax + 4], 0x144
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.WriteFile_error__ld_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x118]
mov dword [esp], edx
call fcn.0049fda0
mov eax, dword [ebp - 0x120]
mov ecx, dword [ebp - 0x11c]
movzx eax, word [eax + 6]
add ecx, 1
cmp ecx, eax
jb 0x4a1e60
mov dword [esp + 4], 0
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
mov ebx, eax
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret