Function at 0x479eb0
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x181c
call fcn.004ce9d0
mov eax, dword [0x5cd9a0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
xor edx, edx
mov ecx, 0xbfd80
push edi
mov eax, dword [esi + 0x24]
add eax, 0xffffffe7
div ecx
mov ebx, eax
shl ebx, 7
mov dword [ebp - 0x181c], ebx
cmp edx, 0x80
jbe 0x479f03
lea ecx, [edx - 0x80]
mov eax, 0xaad56003
mul ecx
shr edx, 0xc
add ebx, edx
mov dword [ebp - 0x181c], ebx
xor edi, edi
lea ecx, [ebx - 1]
mov ebx, ecx
mov dword [ebp - 0x1818], ecx
mov dword [ebp - 0x1814], edi
cmp dword [ebp - 0x181c], edi
jle 0x47a0d2
mov eax, dword [esi + 0x24]
xor edx, edx
add eax, 0xffffffe7
mov ecx, 0xbfd80
div ecx
shl eax, 7
mov dword [ebp - 0x1810], eax
cmp edx, 0x80
jbe 0x479f57
lea ecx, [edx - 0x80]
mov eax, 0xaad56003
mul ecx
mov eax, dword [ebp - 0x1810]
shr edx, 0xc
add eax, edx
cmp edi, eax
jae 0x47a45e
shr edi, 7
cmp dword [esi + 0x44], edi
je 0x479fc5
imul eax, edi, 0xbfd80
push 0
push 0
add eax, 0x19
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x47a457
push 0
lea eax, [ebp - 0x180c]
mov dword [ebp - 0x180c], 0
push eax
push 0x80
lea eax, [esi + 0x48]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47a409
cmp dword [ebp - 0x180c], 0x80
jne 0x47a409
mov dword [esi + 0x44], edi
mov edx, dword [ebp - 0x1814]
and edx, 0x7f
imul eax, edi, 0xbfd80
imul ecx, edx, 0x17fa
add ecx, 0x99
add eax, ecx
cmp byte [edx + esi + 0x48], 0
mov dword [ebp - 0x1810], eax
jne 0x47a3eb
cmp ebx, dword [ebp - 0x1814]
jle 0x47a0cc
nop
mov eax, dword [esi + 0x24]
xor edx, edx
add eax, 0xffffffe7
mov ecx, 0xbfd80
div ecx
mov edi, eax
shl edi, 7
cmp edx, 0x80
jbe 0x47a02b
lea ecx, [edx - 0x80]
mov eax, 0xaad56003
mul ecx
shr edx, 0xc
add edi, edx
cmp ebx, edi
jae 0x47a45e
mov edi, ebx
shr edi, 7
cmp dword [esi + 0x44], edi
je 0x47a09b
imul eax, edi, 0xbfd80
push 0
push 0
add eax, 0x19
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x47a457
push 0
lea eax, [ebp - 0x1804]
mov dword [ebp - 0x1804], 0
push eax
push 0x80
lea eax, [esi + 0x48]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47a409
cmp dword [ebp - 0x1804], 0x80
jne 0x47a409
mov dword [esi + 0x44], edi
mov edx, ebx
imul edi, edi, 0xbfd80
and edx, 0x7f
imul ecx, edx, 0x17fa
add edi, 0x99
add edi, ecx
cmp byte [edx + esi + 0x48], 1
je 0x47a308
dec ebx
cmp ebx, dword [ebp - 0x1814]
jg 0x47a000
mov ecx, dword [ebp - 0x1818]
xor ebx, ebx
test ecx, ecx
js 0x47a2f2
nop dword [eax]
mov eax, dword [esi + 0x24]
xor edx, edx
add eax, 0xffffffe7
mov edi, 0xbfd80
div edi
mov edi, eax
shl edi, 7
cmp edx, 0x80
jbe 0x47a111
lea ecx, [edx - 0x80]
mov eax, 0xaad56003
mul ecx
mov ecx, dword [ebp - 0x1818]
shr edx, 0xc
add edi, edx
cmp ecx, edi
jae 0x47a48b
mov edi, ecx
shr edi, 7
cmp dword [esi + 0x44], edi
je 0x47a187
imul eax, edi, 0xbfd80
push 0
push 0
add eax, 0x19
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x47a457
push 0
lea eax, [ebp - 0x1804]
mov dword [ebp - 0x1804], 0
push eax
push 0x80
lea eax, [esi + 0x48]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47a409
cmp dword [ebp - 0x1804], 0x80
jne 0x47a409
mov ecx, dword [ebp - 0x1818]
mov dword [esi + 0x44], edi
mov eax, ecx
and eax, 0x7f
mov al, byte [eax + esi + 0x48]
cmp al, 1
je 0x47a1a4
inc ebx
sub ecx, 1
mov dword [ebp - 0x1818], ecx
jns 0x47a0e0
test ebx, ebx
je 0x47a2f2
mov eax, dword [esi + 0x24]
xor edx, edx
add eax, 0xffffffe7
mov ecx, 0xbfd80
div ecx
mov edi, eax
shl edi, 7
cmp edx, 0x80
jbe 0x47a1d7
lea ecx, [edx - 0x80]
mov eax, 0xaad56003
mul ecx
shr edx, 0xc
add edi, edx
cmp ebx, edi
mov eax, edi
cmovb eax, ebx
sub edi, eax
mov eax, edi
mov ebx, edi
shr eax, 7
imul eax, eax, 0xbfd80
mov dword [ebp - 0x1810], eax
lea ecx, [eax + 0x19]
and ebx, 0x7f
je 0x47a206
imul eax, ebx, 0x17fa
sub ecx, 0xffffff80
add ecx, eax
push 0
push 0
push ecx
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x47a457
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x47a471
test ebx, ebx
je 0x47a2b5
push 0x200
lea eax, [ebp - 0x208]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov eax, dword [ebp - 0x1810]
add esp, 0xc
add eax, 0x19
add eax, ebx
push 0
push 0
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x47a457
push 0
lea ecx, [ebp - 0x1804]
mov dword [ebp - 0x1804], 0
push ecx
mov eax, 0x80
sub eax, ebx
push eax
mov dword [ebp - 0x1810], eax
lea eax, [ebp - 0x208]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x47a471
mov eax, dword [ebp - 0x1810]
cmp dword [ebp - 0x1804], eax
jne 0x47a471
push 0
push dword [esi]
mov dword [esi + 0x44], 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esi + 0x24], eax
mov ecx, esi
mov eax, dword [esi + 0x18]
cmp eax, edi
cmovae eax, edi
mov dword [esi + 0x18], eax
call fcn.00479a90
test eax, eax
je 0x47a45e
mov ecx, esi
call fcn.00479a90
test eax, eax
je 0x47a45e
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ce1ec
mov esp, ebp
pop ebp
ret
push 0x17fa
lea eax, [ebp - 0x1800]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0
push 0
push edi
push dword [esi]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
call edi
cmp eax, 0xffffffff
je 0x47a457
push 0
lea eax, [ebp - 0x1808]
mov dword [ebp - 0x1808], 0
push eax
push 0x17fa
lea eax, [ebp - 0x1800]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x47a43d
cmp dword [ebp - 0x1808], 0x17fa
jne 0x47a43d
push 0
push 0
push dword [ebp - 0x1810]
push dword [esi]
call edi
cmp eax, 0xffffffff
je 0x47a457
push 0
lea eax, [ebp - 0x1808]
mov dword [ebp - 0x1808], 0
push eax
push 0x17fa
lea eax, [ebp - 0x1800]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x47a423
cmp dword [ebp - 0x1808], 0x17fa
jne 0x47a423
mov edi, dword [ebp - 0x1814]
mov ecx, esi
push 1
push edi
call fcn.0047a4b0
test eax, eax
je 0x47a45e
push 0
push ebx
mov ecx, esi
call fcn.0047a4b0
test eax, eax
je 0x47a45e
jmp 0x47a3f1
mov edi, dword [ebp - 0x1814]
inc edi
mov dword [ebp - 0x1814], edi
cmp edi, dword [ebp - 0x181c]
jl 0x479f22
jmp 0x47a0cc
pop edi
mov dword [esi + 0x28], 5
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ce1ec
mov esp, ebp
pop ebp
ret
pop edi
mov dword [esi + 0x28], 4
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ce1ec
mov esp, ebp
pop ebp
ret
pop edi
mov dword [esi + 0x28], 5
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ce1ec
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x28], 0xa
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ce1ec
mov esp, ebp
pop ebp
ret
pop edi
mov dword [esi + 0x28], 4
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ce1ec
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
mov dword [esi + 0x28], 3
xor ecx, ebp
pop esi
pop ebx
call fcn.004ce1ec
mov esp, ebp
pop ebp
ret