Function at 0x54ec90
Capabilities:
Clear file content

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
mov esi, dword [ebp + 8]
push edi
mov eax, dword [esi + 0x30]
mov edi, dword [esi + 0x2c]
test eax, eax
jne 0x54eca6
mov eax, dword [esi + 0x28]
mov ecx, dword [esi + 0xb0]
sub edi, eax
lea eax, [edi + 4]
cmp eax, ecx
mov dword [ebp - 4], eax
jbe 0x54ed05
push 0x200
push esi
call fcn.005518a0
add esp, 8
test eax, eax
je 0x54ed05
push 4
push esi
call fcn.005518a0
add esp, 8
test eax, eax
je 0x54ed05
cmp edi, dword [esi + 0xb0]
ja 0x54ecea
cmp byte [esi + 0x11c], 1
je 0x54ed05
push esi
push 0xc0000042
push 0xc0000042
push 1
call fcn.00546a20
add esp, 0x10
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov al, byte [esi + 0x11c]
movsx ecx, al
dec ecx
cmp ecx, 6
ja case.default.0x54ed18
jmp dword [ecx*4 + 0x54f06c]
mov ecx, dword [esi + 0xb4]
cmp edi, ecx
jae case.0x54ed18.5
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]
jmp case.0x54ed18.5
cmp dword [esi + 0x100], 0xb
jne 0x54ee30
cmp al, 4
jne 0x54ee30
mov ecx, dword [esi + 0x30]
test ecx, ecx
je 0x54ed75
mov eax, dword [esi + 0x2c]
mov edi, ecx
sub eax, ecx
sub eax, 4
jmp 0x54ed7b
lea eax, [edi - 4]
mov edi, dword [esi + 0x28]
mov ecx, dword [esi + 0x134]
test ecx, 0x1000000
je 0x54ed9b
and ecx, 0xfeffffff
mov dword [esi + 0x134], ecx
mov ecx, eax
neg ecx
jmp 0x54ed9d
mov ecx, eax
mov dl, byte [esi + 0x12c]
mov dword [ebp + 8], ecx
test dl, 2
je 0x54edbe
mov dl, byte [ebp + 0xb]
mov byte [edi + 2], ch
mov byte [edi], dl
mov dl, byte [ebp + 0xa]
mov byte [edi + 1], dl
mov byte [edi + 3], cl
jmp 0x54edcf
mov dl, byte [ebp + 0xb]
mov byte [edi], cl
mov cl, byte [ebp + 0xa]
mov byte [edi + 1], ch
mov byte [edi + 2], cl
mov byte [edi + 3], dl
mov ecx, dword [esi + 0x114]
test ecx, ecx
je 0x54eddb
neg eax
mov cl, byte [esi + 0x12c]
mov dword [ebp + 8], eax
test cl, 2
mov ecx, dword [esi + 0x2c]
je 0x54ee0e
mov dl, byte [ebp + 0xb]
mov edi, dword [ebp - 4]
mov byte [ecx], dl
mov ecx, dword [esi + 0x2c]
mov dl, byte [ebp + 0xa]
mov byte [ecx + 1], dl
mov ecx, dword [esi + 0x2c]
mov byte [ecx + 2], ah
mov edx, dword [esi + 0x2c]
mov byte [edx + 3], al
jmp case.0x54ed18.5
mov byte [ecx], al
mov edx, dword [esi + 0x2c]
mov cl, byte [ebp + 0xa]
mov edi, dword [ebp - 4]
mov byte [edx + 1], ah
mov eax, dword [esi + 0x2c]
mov byte [eax + 2], cl
mov edx, dword [esi + 0x2c]
mov al, byte [ebp + 0xb]
mov byte [edx + 3], al
jmp case.0x54ed18.5
mov ecx, dword [esi + 0x30]
test ecx, ecx
je 0x54ee7f
mov eax, dword [esi + 0x2c]
mov dl, byte [esi + 0x12c]
sub eax, ecx
sub eax, 4
test dl, 2
mov dword [ebp + 8], eax
je 0x54ee69
mov dl, byte [ebp + 0xb]
mov byte [ecx], dl
mov edi, dword [esi + 0x30]
mov cl, byte [ebp + 0xa]
mov byte [edi + 1], cl
mov edi, dword [esi + 0x30]
mov byte [edi + 2], ah
mov edi, dword [esi + 0x30]
mov byte [edi + 3], al
jmp 0x54eecc
mov byte [ecx], al
mov ecx, dword [esi + 0x30]
mov byte [ecx + 1], ah
mov edx, dword [esi + 0x30]
mov cl, byte [ebp + 0xa]
mov byte [edx + 2], cl
mov edi, dword [esi + 0x30]
jmp 0x54eec6
mov cl, byte [esi + 0x12c]
lea eax, [edi - 4]
test cl, 2
mov dword [ebp + 8], eax
je 0x54eeaf
mov ecx, dword [esi + 0x28]
mov dl, byte [ebp + 0xb]
mov byte [ecx], dl
mov edi, dword [esi + 0x28]
mov cl, byte [ebp + 0xa]
mov byte [edi + 1], cl
mov edi, dword [esi + 0x28]
mov byte [edi + 2], ah
mov edi, dword [esi + 0x28]
mov byte [edi + 3], al
jmp 0x54eecc
mov edx, dword [esi + 0x28]
mov byte [edx], al
mov ecx, dword [esi + 0x28]
mov byte [ecx + 1], ah
mov edx, dword [esi + 0x28]
mov cl, byte [ebp + 0xa]
mov byte [edx + 2], cl
mov edi, dword [esi + 0x28]
mov dl, byte [ebp + 0xb]
mov byte [edi + 3], dl
mov edi, dword [esi + 0x2c]
test byte [esi + 0x12c], 2
je 0x54eef4
mov byte [edi], dl
mov edx, dword [esi + 0x2c]
mov edi, dword [ebp - 4]
mov byte [edx + 1], cl
mov ecx, dword [esi + 0x2c]
mov byte [ecx + 2], ah
mov edx, dword [esi + 0x2c]
mov byte [edx + 3], al
jmp case.0x54ed18.5
mov byte [edi], al
mov edi, dword [esi + 0x2c]
mov byte [edi + 1], ah
mov eax, dword [esi + 0x2c]
mov edi, dword [ebp - 4]
mov byte [eax + 2], cl
mov ecx, dword [esi + 0x2c]
mov byte [ecx + 3], dl
jmp case.0x54ed18.5
mov ecx, dword [esi + 0x30]
test ecx, ecx
je 0x54ef4b
mov ax, word [esi + 0x2c]
sub ax, cx
sub eax, 2
mov byte [ecx], al
mov edx, dword [esi + 0x30]
mov byte [edx + 1], ah
mov eax, edi
and eax, 0x80000001
jns 0x54ef37
dec eax
or eax, 0xfffffffe
inc eax
je case.0x54ed18.5
mov ecx, dword [esi + 0x30]
inc edi
mov byte [edi + ecx - 1], 0
jmp case.0x54ed18.5
mov edx, dword [esi + 0x28]
lea eax, [edi - 2]
mov byte [edx], al
mov ecx, dword [esi + 0x28]
mov edx, edi
and edx, 0x80000001
mov byte [ecx + 1], ah
jns 0x54ef68
dec edx
or edx, 0xfffffffe
inc edx
je case.0x54ed18.5
mov eax, dword [esi + 0x28]
inc edi
mov byte [edi + eax - 1], 0
jmp case.0x54ed18.5
mov eax, dword [esi + 0x30]
test eax, eax
je 0x54ef8b
mov byte [eax + edi], 0xd
mov ecx, dword [esi + 0x30]
inc edi
mov byte [edi + ecx], 0xa
inc edi
jmp case.0x54ed18.5
mov edx, dword [esi + 0x28]
inc edi
mov byte [edi + edx - 1], 0xd
mov eax, dword [esi + 0x28]
mov byte [edi + eax], 0xa
inc edi
jmp case.0x54ed18.5
mov eax, dword [esi + 0x30]
test eax, eax
je 0x54efac
mov byte [eax + edi], 0xd
inc edi
jmp case.0x54ed18.5
mov ecx, dword [esi + 0x28]
inc edi
mov byte [ecx + edi - 1], 0xd
jmp case.0x54ed18.5
push 0x236
push 0x58889c
push 2
push 0xc0000008
call fcn.005469f0
add esp, 0x10
mov eax, dword [esi + 0x30]
push edi
test eax, eax
je 0x54efdb
push eax
jmp 0x54efdf
mov edx, dword [esi + 0x28]
push edx
push esi
call fcn.005500b0
mov edi, dword [esi + 0x128]
add esp, 0xc
and edi, 0xfbffffff
cmp eax, 0xffffffff
mov dword [esi + 0x128], edi
mov ecx, edi
jne 0x54f018
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xac], eax
pop edi
mov eax, 0xc0000026
pop esi
mov esp, ebp
pop ebp
ret
test ecx, 0x80000000
je 0x54f062
mov eax, dword [esi + 0xa8]
xor edi, edi
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x54f044
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 0x54f062
mov eax, edi
pop edi
pop esi
mov esp, ebp
pop ebp
ret
pop edi
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret