Function at 0x47f5b0
Capabilities:
Check if file exists
Get file size
Read file on windows
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, dword [ebp + 0x18]
sub esp, 0x44
push ebx
push esi
push edi
cmp eax, 0xf
ja case.default.0x47f5c8
jmp dword [eax*4 + 0x47ff64]
mov esi, dword [ebp + 8]
cmp dword [esi + 0x1c], 0
jne 0x47f5f1
or eax, 0xffffffff
mov dword [esi], 0x1c
mov dword [esi + 4], 0
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x20]
or ebx, 0xffffffff
mov dword [esp + 0x1c], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0
cmp eax, ebx
je 0x47f667
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x47f667
lea eax, [esp + 0x10]
push eax
push 0
lea eax, [esp + 0x30]
push eax
push 0
push 0
push 0x20000004
push 1
push dword [esi + 0x20]
call dword [sym.imp.ADVAPI32.dll_GetSecurityInfo]
test eax, eax
jne 0x47f667
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x44], eax
lea eax, [esp + 0x40]
mov dword [esp + 0x40], 0xc
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edx, eax
xor edi, edi
mov dword [esp + 0x30], edx
cmp ebx, 0xffffffff
jne 0x47f6ef
push dword [esp + 0x24]
mov ecx, dword [esi + 0x18]
lea eax, [edi + edx]
push eax
lea eax, [esp + 0x24]
push eax
mov eax, dword [ecx + 8]
push esi
call eax
mov ebx, eax
add esp, 0x10
cmp ebx, 0xffffffff
jne 0x47f6a5
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
jne 0x47f6b7
mov edx, dword [esp + 0x30]
inc edi
cmp edi, 0x400
jl 0x47f675
cmp ebx, 0xffffffff
jne 0x47f6ef
push dword [esp + 0x1c]
call fcn.004aa8f0
add esp, 4
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_LocalFree]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.00480030
mov dword [esi + 4], eax
or eax, 0xffffffff
mov dword [esi], 0xc
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x1c]
xorps xmm0, xmm0
movlpd qword [esp + 0x38], xmm0
mov edx, dword [esp + 0x3c]
mov dword [esi + 0x80], eax
mov eax, dword [esp + 0x38]
mov dword [esi + 0x84], ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
push dword [esi + 0x84]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x47f756
mov dword [esi + 0x84], 0xffffffff
call edi
mov ecx, eax
call fcn.00480030
mov dword [esi], 6
mov dword [esi + 4], eax
mov eax, dword [esi + 0x18]
mov dword [esi + 0x84], 0xffffffff
push esi
mov eax, dword [eax + 0xc]
call eax
add esp, 4
test eax, eax
jns 0x47fa17
call edi
mov ecx, eax
call fcn.00480030
mov dword [esi + 4], eax
or eax, 0xffffffff
mov dword [esi], 2
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
cmp dword [esi + 0x1c], 0
je 0x47fc10
push dword [esi + 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov dword [esi + 0x20], 0xffffffff
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x14], 0
ja 0x47f7d0
jb 0x47ff55
cmp dword [ebp + 0x10], 8
jb 0x47ff55
mov edx, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov eax, dword [edx]
mov dword [ecx], eax
mov eax, dword [edx + 4]
xor edx, edx
mov dword [ecx + 4], eax
mov eax, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
push dword [esi + 0x1c]
call fcn.004aa8f0
add esp, 4
push dword [esi + 0x80]
call fcn.004aa8f0
add esp, 4
cmp dword [esi + 0x24], 0
je 0x47f81f
mov eax, dword [esi + 0x20]
cmp eax, 0xffffffff
je 0x47f81f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004aa8f0
add esp, 4
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
cmp dword [esi + 0x1c], 0
je 0x47f872
mov eax, dword [esi + 0x18]
push esi
mov eax, dword [eax + 4]
call eax
add esp, 4
mov dword [esi + 0x20], eax
cmp eax, 0xffffffff
jne 0x47f872
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.00480030
mov dword [esi + 4], eax
or eax, 0xffffffff
mov dword [esi], 0xb
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi + 0x24], 0
je 0x47f8c6
mov ecx, dword [esi + 0x6c]
mov eax, dword [esi + 0x68]
test ecx, ecx
jne 0x47f886
test eax, eax
je 0x47f8c6
cmp ecx, 0x7fffffff
jb 0x47f8ae
ja 0x47f895
cmp eax, 0xffffffff
jbe 0x47f8ae
or eax, 0xffffffff
mov dword [esi], 4
mov dword [esi + 4], 0x84
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
push ecx
mov ecx, dword [esi + 0x20]
xor edx, edx
push eax
call fcn.0047ffb0
add esp, 0xc
test eax, eax
js 0x47ff55
mov eax, dword [esi + 0x68]
mov ecx, dword [esi + 0x6c]
mov dword [esi + 0x78], eax
xor eax, eax
mov dword [esi + 0x7c], ecx
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x74]
mov edi, dword [esi + 0x70]
test eax, eax
jne 0x47f8f6
test edi, edi
jne 0x47f8f6
mov edi, dword [ebp + 0x10]
mov eax, dword [ebp + 0x14]
jmp 0x47f910
sub edi, dword [esi + 0x78]
mov edx, dword [ebp + 0x14]
sbb eax, dword [esi + 0x7c]
cmp eax, edx
jb 0x47f910
mov ecx, dword [ebp + 0x10]
ja 0x47f90c
cmp edi, ecx
jbe 0x47f910
mov edi, ecx
mov eax, edx
test eax, eax
jne 0x47f919
cmp edi, 0xffffffff
jbe 0x47f924
or edi, 0xffffffff
mov dword [esp + 0x3c], 0
cmp dword [esi + 0x24], 0
jne 0x47f95f
mov ecx, dword [esi + 0x7c]
mov eax, dword [esi + 0x78]
cmp ecx, 0x7fffffff
jb 0x47f947
ja 0x47f895
cmp eax, 0xffffffff
ja 0x47f895
push esi
push ecx
mov ecx, dword [esi + 0x20]
xor edx, edx
push eax
call fcn.0047ffb0
add esp, 0xc
test eax, eax
js 0x47ff55
push 0
lea eax, [esp + 0x3c]
push eax
push edi
push dword [ebp + 0xc]
push dword [esi + 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x47f999
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.00480030
mov dword [esi + 4], eax
or eax, 0xffffffff
mov dword [esi], 5
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x38]
add dword [esi + 0x78], eax
adc dword [esi + 0x7c], 0
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x18]
push dword [esi + 0x1c]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
test eax, eax
jns 0x47fc10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.00480030
mov dword [esi + 4], eax
or eax, 0xffffffff
mov dword [esi], 0x16
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x84]
test eax, eax
je 0x47fa06
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0x84], 0xffffffff
mov eax, dword [esi + 0x18]
push dword [esi + 0x80]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
push dword [esi + 0x80]
call fcn.004aa8f0
add esp, 4
mov dword [esi + 0x80], 0
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x14], 0
ja 0x47fa6c
jb 0x47fa48
cmp dword [ebp + 0x10], 0x10
jae 0x47fa6c
mov eax, dword [ebp + 8]
test eax, eax
je 0x47ff55
mov dword [eax], 0x12
mov dword [eax + 4], 0
or eax, 0xffffffff
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x47ff55
mov esi, dword [ebp + 8]
mov eax, dword [edi + 8]
mov ebx, dword [esi + 0x24]
mov dword [esp + 0x24], ebx
sub eax, 0
je 0x47fb40
sub eax, 1
je 0x47fb33
sub eax, 1
je 0x47fab4
or eax, 0xffffffff
mov dword [esi], 0x12
mov dword [esi + 4], 0
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi + 0x70]
mov eax, ecx
mov edx, dword [esi + 0x74]
or eax, edx
jne 0x47fb2c
push 2
push eax
push dword [edi + 4]
push dword [edi]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push dword [esi + 0x20]
call edi
test eax, eax
jne 0x47faf9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.00480030
mov dword [esi], 4
mov dword [esi + 4], eax
or eax, 0xffffffff
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 1
lea eax, [esp + 0x2c]
xorps xmm0, xmm0
push eax
movlpd qword [esp + 0x38], xmm0
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push dword [esi + 0x20]
call edi
test eax, eax
je 0x47fad7
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x24], 0
jmp 0x47fb45
add ecx, dword [edi]
adc edx, dword [edi + 4]
jmp 0x47fb45
mov ecx, dword [esi + 0x78]
add ecx, dword [edi]
mov edx, dword [esi + 0x7c]
adc edx, dword [edi + 4]
jmp 0x47fb45
mov ecx, dword [edi]
mov edx, dword [edi + 4]
test edx, edx
jl 0x47fa9b
jg 0x47fb57
test ecx, ecx
jb 0x47fa9b
cmp edx, dword [esi + 0x6c]
jb 0x47fa9b
ja 0x47fb6b
cmp ecx, dword [esi + 0x68]
jb 0x47fa9b
mov ebx, dword [esi + 0x70]
mov eax, ebx
mov edi, dword [esi + 0x74]
or eax, edi
je 0x47fb89
cmp edx, edi
ja 0x47fa9b
jb 0x47fb89
cmp ecx, ebx
ja 0x47fa9b
cmp dword [esp + 0x24], 0
mov dword [esi + 0x78], ecx
mov dword [esi + 0x7c], edx
je 0x47fc10
cmp edx, 0x7fffffff
jb 0x47fbad
ja 0x47f895
cmp ecx, 0xffffffff
ja 0x47f895
push esi
push edx
push ecx
mov ecx, dword [esi + 0x20]
xor edx, edx
call fcn.0047ffb0
add esp, 0xc
test eax, eax
jns 0x47fc10
or eax, 0xffffffff
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x14], 0
ja 0x47fbe3
jb 0x47fa48
cmp dword [ebp + 0x10], 0x10
jb 0x47fa48
mov edx, dword [ebp + 0xc]
test edx, edx
je 0x47ff55
mov ecx, dword [ebp + 8]
push ecx
push dword [edx + 4]
push dword [edx]
mov edx, dword [edx + 8]
mov ecx, dword [ecx + 0x84]
call fcn.0047ffb0
add esp, 0xc
test eax, eax
js 0x47ff55
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x14], 0
ja 0x47fc2b
cmp dword [ebp + 0x10], 0x40
jb 0x47ff55
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x28]
or eax, dword [ebx + 0x2c]
je 0x47fc66
movups xmm0, xmmword [ebx + 0x28]
mov eax, dword [ebp + 0xc]
movups xmmword [eax], xmm0
movups xmm0, xmmword [ebx + 0x38]
movups xmmword [eax + 0x10], xmm0
movups xmm0, xmmword [ebx + 0x48]
movups xmmword [eax + 0x20], xmm0
movups xmm0, xmmword [ebx + 0x58]
movups xmmword [eax + 0x30], xmm0
mov eax, 0x40
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebx + 0x20]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x24], esi
cmp esi, 0xffffffff
jne 0x47fcb4
mov eax, dword [ebx + 0x18]
push ebx
mov eax, dword [eax + 4]
call eax
mov esi, eax
add esp, 4
mov dword [esp + 0x24], esi
cmp esi, 0xffffffff
jne 0x47fcb4
call edi
cmp eax, 2
je 0x47fc9b
cmp eax, 3
jne 0x47fcb4
or eax, 0xffffffff
mov dword [ebx], 5
mov dword [ebx + 4], 2
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x1c]
push eax
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileTime]
test eax, eax
jne 0x47fce7
call edi
mov ecx, eax
call fcn.00480030
mov dword [ebx], 5
mov dword [ebx + 4], eax
mov dword [esp + 0x1c], 0xffffffff
jmp 0x47fe3c
mov eax, dword [esp + 0x1c]
mov ebx, 0xe57a42bd
mul ebx
mov edi, 0xd6bf94d5
mov dword [esp + 0x30], eax
mov esi, edx
mov eax, dword [esp + 0x1c]
mul edi
mov edi, eax
mov dword [esp + 0x30], edx
mov eax, dword [esp + 0x20]
mul ebx
mov ebx, edx
mov ecx, eax
mov eax, dword [esp + 0x20]
mov edx, 0xd6bf94d5
mul edx
add ecx, esi
mov esi, dword [esp + 0x24]
mov dword [esp + 0x28], eax
adc ebx, 0
add edi, ecx
mov ecx, dword [esp + 0x30]
adc ecx, 0
mov dword [esp + 0x40], edi
mov edi, dword [esp + 0x28]
xor eax, eax
add ebx, ecx
push esi
adc eax, eax
add edi, ebx
adc edx, eax
shrd edi, edx, 0x17
shr edx, 0x17
sub edi, 0xb6109100
sbb edx, 2
xor ebx, ebx
mov dword [esp + 0x34], edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov ecx, 1
cmp eax, ecx
lea eax, [esp + 0x10]
push eax
cmove ebx, ecx
push esi
mov dword [esp + 0x30], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x47fd98
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
mov ecx, eax
call fcn.00480030
mov ebx, dword [ebp + 8]
jmp 0x47fcd1
mov edx, dword [ebp + 0xc]
xor eax, eax
mov ebx, dword [ebp + 8]
mov dword [edx + 0x34], eax
mov eax, dword [esp + 0x30]
mov dword [edx + 0x2c], eax
mov dword [edx + 8], 0
mov dword [edx + 0x10], 0xffffffff
mov dword [edx + 0x14], 0xffffffff
mov dword [edx + 0x30], 0
mov dword [edx + 0x18], 0
mov dword [edx + 0x1c], 0
mov dword [edx + 0x20], 0
mov dword [edx + 0x24], 0
mov dword [edx + 0x28], edi
mov dword [edx], 0x10
mov dword [edx + 4], 0
mov ecx, dword [ebx + 0x70]
mov eax, ecx
mov edi, dword [ebx + 0x74]
or eax, edi
je 0x47fe0c
sub ecx, dword [ebx + 0x68]
sbb edi, dword [ebx + 0x6c]
mov dword [edx + 0x18], ecx
mov dword [edx + 0x1c], edi
jmp 0x47fe21
cmp dword [esp + 0x28], 0
je 0x47fe2e
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov dword [edx + 0x18], eax
mov dword [edx + 0x1c], ecx
mov dword [edx + 4], 0
mov dword [edx], 0x14
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x1c], 0
call edi
mov edi, eax
cmp esi, dword [ebx + 0x20]
je 0x47fe4c
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x1c], 0
jge 0x47fc58
mov ecx, edi
mov dword [ebx], 5
call fcn.00480030
mov dword [ebx + 4], eax
or eax, 0xffffffff
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x10]
mov edx, dword [edx + 0x14]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x78]
mov edx, dword [edx + 0x7c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
lea eax, [esp + 0x30]
push 1
push eax
xorps xmm0, xmm0
movlpd qword [esp + 0x40], xmm0
push dword [esp + 0x44]
push dword [esp + 0x44]
push dword [esi + 0x84]
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x47fee0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.00480030
mov dword [esi + 4], eax
or eax, 0xffffffff
mov dword [esi], 0x1e
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x10]
lea eax, [esp + 0x30]
mov esi, dword [ebp + 8]
push 0
push eax
push edi
push dword [ebp + 0xc]
push dword [esi + 0x84]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x47ff1f
mov eax, dword [esp + 0x30]
xor edx, edx
cmp eax, edi
jne 0x47ff1f
cmp edx, dword [ebp + 0x14]
je 0x47ff5a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.00480030
mov dword [esi + 4], eax
or eax, 0xffffffff
mov dword [esi], 6
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
test eax, eax
je 0x47ff55
mov dword [eax], 0x1c
mov dword [eax + 4], 0
or eax, 0xffffffff
or edx, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret