Function at 0x480790
Capabilities:
Clear file content

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 4], 0
mov ecx, dword [esi + 0x30]
mov edi, dword [esi + 0x2c]
test ecx, ecx
je 0x4807b1
sub edi, ecx
jmp 0x4807b4
sub edi, dword [esi + 0x28]
mov eax, dword [esi + 0xe0]
mov ebx, edi
add ebx, eax
mov al, byte [esi + 0x11c]
cmp al, 1
je 0x48081c
cmp al, 3
je 0x48081c
test edi, edi
je 0x480812
test ecx, ecx
jne 0x4807d7
mov ecx, dword [esi + 0x28]
cmp dword [esi + 0x100], 0xb
jne 0x4807ff
cmp al, 4
jne 0x4807ff
mov eax, dword [esi + 0x28]
push 1
push edi
push ecx
push esi
mov dword [esi + 0x2c], eax
call fcn.004805f0
mov ebx, dword [esi + 0xe0]
add esp, 0x10
jmp 0x48080a
push edi
push ecx
push esi
call fcn.00480580
add esp, 0xc
test eax, eax
jne 0x480acc
and dword [esi + 0x128], 0xfbffffff
movsx eax, byte [esi + 0x11c]
dec eax
cmp eax, 6
ja case.default.0x48082d
jmp dword [eax*4 + 0x480ad4]
mov ecx, dword [esi + 0xb4]
cmp edi, ecx
jae 0x480859
sub ecx, edi
mov edi, dword [esi + 0x2c]
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esi + 0xb4]
mov eax, dword [esi + 0x30]
push edi
test eax, eax
jne 0x480864
mov eax, dword [esi + 0x28]
push eax
push esi
call fcn.00480580
mov edx, dword [esi + 0x128]
add esp, 0xc
and edx, 0xfbffffff
test eax, eax
mov dword [esi + 0x128], edx
je case.0x48082d.5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x114]
lea edi, [ebx - 4]
test eax, eax
mov eax, edi
je 0x4808a0
neg eax
mov cl, byte [esi + 0x12c]
mov dword [ebp + 8], eax
test cl, 2
je 0x4808c2
mov cl, byte [ebp + 0xb]
mov dl, byte [ebp + 0xa]
mov byte [ebp - 4], cl
mov byte [ebp - 3], dl
mov byte [ebp - 2], ah
mov byte [ebp - 1], al
jmp 0x4808d4
mov cl, byte [ebp + 0xb]
mov byte [ebp - 4], al
mov al, byte [ebp + 0xa]
mov byte [ebp - 3], ah
mov byte [ebp - 2], al
mov byte [ebp - 1], cl
lea edx, [ebp - 4]
push 4
push edx
push esi
call fcn.00489b20
add esp, 0xc
cmp eax, 0xffffffff
je 0x480a4a
test dword [esi + 0x12c], 0x40000
jne case.0x48082d.5
mov eax, dword [esi + 0xa8]
push eax
call fcn.004803b0
mov ecx, dword [esi + 0xdc]
mov dword [ebp - 0xc], edx
mov edx, dword [esi + 0xd8]
mov ebx, eax
mov eax, dword [esi + 0xa8]
push 0
push ecx
push edx
push eax
call fcn.00480400
and eax, edx
add esp, 0x14
cmp eax, 0xffffffff
je 0x480a4a
mov eax, dword [esi + 0x134]
test eax, 0x2000000
je 0x480951
and eax, 0xfdffffff
mov dword [esi + 0x134], eax
neg edi
mov cl, byte [esi + 0x12c]
mov eax, edi
test cl, 2
mov dword [ebp + 8], eax
je 0x480975
mov cl, byte [ebp + 0xb]
mov dl, byte [ebp + 0xa]
mov byte [ebp - 4], cl
mov byte [ebp - 3], dl
mov byte [ebp - 2], ah
mov byte [ebp - 1], al
jmp 0x480987
mov cl, byte [ebp + 0xb]
mov byte [ebp - 4], al
mov al, byte [ebp + 0xa]
mov byte [ebp - 3], ah
mov byte [ebp - 2], al
mov byte [ebp - 1], cl
lea edx, [ebp - 4]
push 4
push edx
push esi
call fcn.00489b20
add esp, 0xc
cmp eax, 0xffffffff
je 0x480a4a
mov eax, dword [ebp - 0xc]
mov ecx, dword [esi + 0xa8]
push 0
push eax
push ebx
push ecx
call fcn.00480400
add esp, 0x10
and eax, edx
jmp 0x480a45
mov ecx, dword [esi + 0x30]
lea eax, [edi - 2]
test ecx, ecx
je 0x4809cd
mov byte [ecx], al
mov edx, dword [esi + 0x30]
jmp 0x4809d5
mov ecx, dword [esi + 0x28]
mov byte [ecx], al
mov edx, dword [esi + 0x28]
mov byte [edx + 1], ah
mov eax, dword [esi + 0x30]
test eax, eax
push edi
jne 0x4809e3
mov eax, dword [esi + 0x28]
push eax
push esi
call fcn.00480580
mov edx, dword [esi + 0x128]
add esp, 0xc
and edx, 0xfbffffff
test eax, eax
mov dword [esi + 0x128], edx
jne 0x480acc
and edi, 0x80000001
jns 0x480a14
dec edi
or edi, 0xfffffffe
inc edi
je case.0x48082d.5
lea ecx, [ebp + 0xb]
push 1
mov byte [ebp + 0xb], 0
push ecx
jmp 0x480a3c
lea edx, [ebp - 8]
push 2
mov byte [ebp - 8], 0xd
mov byte [ebp - 7], 0xa
push edx
jmp 0x480a3c
lea eax, [ebp - 8]
push 1
mov byte [ebp - 8], 0xd
push eax
push esi
call fcn.00489b20
add esp, 0xc
cmp eax, 0xffffffff
jne case.0x48082d.5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xac], eax
pop edi
pop esi
mov eax, 0xc0000026
pop ebx
mov esp, ebp
pop ebp
ret
push 0xf6d
push 0x4b92d8
push 2
push 0xc0000008
call fcn.00482080
add esp, 0x10
test dword [esi + 0x128], 0x80000000
je 0x480aca
mov ecx, dword [esi + 0xa8]
xor edi, edi
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x480aab
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xac], eax
mov edi, 0xc0000026
mov ecx, dword [esi + 0x128]
and ecx, 0x7fffffff
test edi, edi
mov dword [esi + 0x128], ecx
je 0x480aca
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret