Function at 0x4a2c60
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4d8b60
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x218
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
xor ebx, ebx
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x222]
mov word [ebp - 0x224], bx
mov dword [ebp - 0x10], esp
rep stosd dword es:[edi], eax
push ebx
push esi
mov dword [ebp - 0x18], 1
stosw word es:[edi], ax
call fcn.00433340
add esp, 8
test eax, eax
push esi
jne 0x4a2cd1
mov ecx, dword [0x5e6a0c]
lea eax, [ebp - 0x224]
push 0x103
push eax
push ecx
call fcn.00433350
jmp 0x4a2ce8
push 0x4ee160
lea edx, [ebp - 0x224]
push 0x103
push edx
call dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0x10
lea eax, [ebp - 0x224]
xor edi, edi
push ebx
push eax
mov dword [ebp + 0xc], edi
call fcn.00433340
add esp, 8
test eax, eax
je 0x4a2da6
push ebx
push 0x8000080
push 3
push ebx
push 1
lea ecx, [ebp - 0x224]
push SysReAllocString
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
push ebx
push esi
mov dword [ebp - 0x14], esi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4a2d59
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea esi, [ebx + 2]
push esi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edx, eax
mov ecx, esi
xor eax, eax
mov edi, edx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
add esp, 4
and ecx, 3
mov dword [ebp + 0xc], edx
test edx, edx
rep stosb byte es:[edi], al
je 0x4a2d92
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x1c]
push 0
push eax
push ebx
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp + 0xc]
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp + 8]
cmp ecx, 0xffffffff
je 0x4a2e14
test edi, edi
jne 0x4a2e1c
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x4a2f6a
push eax
lea edx, [ebp + 8]
push str.script
push edx
push ecx
mov dword [ebp + 8], edi
call fcn.0047f200
mov esi, eax
mov eax, dword [ebp + 8]
add eax, 2
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp + 8]
mov edx, eax
add ecx, 2
xor eax, eax
mov ebx, ecx
mov edi, edx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, ebx
mov dword [ebp + 0xc], edx
and ecx, 3
add esp, 0x14
rep stosb byte es:[edi], al
mov ecx, dword [ebp + 8]
mov edi, edx
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 edi, dword [ebp + 0xc]
test edi, edi
je 0x4a2f6a
xor eax, eax
mov ah, byte [edi + 1]
mov al, byte [edi]
cmp ax, 0xfeff
jne 0x4a2eb6
add edi, 2
test edi, edi
jne 0x4a2e4b
xor esi, esi
mov dword [ebp + 0x14], esi
jmp 0x4a2e57
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp + 0x14], eax
mov esi, eax
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx]
cmp dword [eax - 0xc], 1
jg 0x4a2e67
cmp esi, dword [eax - 4]
jle 0x4a2e7e
mov ecx, ebx
call fcn.00408fd0
push esi
mov ecx, ebx
call fcn.00408e20
test eax, eax
je 0x4a2f5c
lea eax, [esi + esi]
mov esi, edi
mov edi, dword [ebx]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [ebp + 0x14]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx]
mov dword [ecx - 8], edx
mov ecx, dword [ebx]
mov word [eax + ecx], 0
mov eax, dword [ebp + 0xc]
push eax
call fcn.004d2e69
add esp, 4
jmp 0x4a2f6d
test edi, edi
je 0x4a2ec5
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
jmp 0x4a2ec7
xor esi, esi
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx]
mov edx, dword [eax - 0xc]
lea ecx, [eax - 0xc]
cmp edx, 1
jg 0x4a2edc
cmp esi, dword [eax - 4]
jle 0x4a2f15
mov edx, dword [0x4ee0f0]
add eax, 0xfffffff4
cmp eax, edx
je 0x4a2f09
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x4a2f02
mov edx, dword [ebx]
sub edx, 0xc
push edx
call fcn.004d2e69
add esp, 4
mov eax, dword [0x4eeea4]
mov dword [ebx], eax
push esi
mov ecx, ebx
call fcn.00408e20
test eax, eax
je 0x4a2f5c
lea eax, [esi + 1]
mov esi, dword [ebx]
test eax, eax
jne 0x4a2f22
test esi, esi
jne 0x4a2f3f
mov ecx, dword [ebp + 0xc]
push eax
push esi
push 0xffffffffffffffff
push ecx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jle 0x4a2f3f
mov word [esi + eax*2 - 2], 0
mov ecx, ebx
call fcn.00441c10
mov edx, dword [ebx]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [ebx]
mov dword [ecx - 8], eax
mov edx, dword [ebx]
mov word [edx + eax*2], 0
mov eax, dword [ebp + 0xc]
push eax
call fcn.004d2e69
add esp, 4
jmp 0x4a2f6d
mov ebx, dword [ebp + 0x10]
mov ecx, dword [ebx]
mov eax, dword [ecx - 8]
test eax, eax
je 0x4a2f7d
mov dword [ebp - 0x18], 0
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret