Function at 0x413c40
Capabilities:
Clear file content
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x430cbd
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x440440]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
xor esi, esi
mov ebx, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x18], 0
nop
push 0
push 0x80
push 4
push 0
push 1
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x34], eax
cmp eax, 0xffffffff
jne 0x413ccc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
jne 0x413cf6
push 0xfa
call edi
inc esi
cmp esi, 0x10
jl 0x413c90
mov eax, dword [ebp - 0x34]
push 0
lea ecx, [ebp - 0x18]
mov word [ebp - 0x14], 0xfeff
push ecx
push 2
lea ecx, [ebp - 0x14]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
call fcn.00401ec0
mov ecx, eax
test ecx, ecx
je 0x414474
jmp 0x413cfd
xor al, al
jmp 0x414456
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x2c], esi
mov eax, dword [ebp - 0x3c]
xor edx, edx
or edi, 0xffffffff
mov dword [ebp - 4], 0
mov dword [ebp - 0x38], edx
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub eax, ecx
sar eax, 2
test eax, eax
je 0x41441a
nop dword [eax]
mov eax, dword [ecx + edx*4]
lea edi, [edx*4]
sub eax, 0x10
push eax
call fcn.004025a0
lea esi, [eax + 0x10]
mov dword [ebp - 0x30], esi
mov eax, dword [ebp - 0x40]
mov byte [ebp - 4], 1
mov eax, dword [eax]
mov eax, dword [eax + edi]
sub eax, 0x10
push eax
call fcn.004025a0
add eax, 0x10
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x44]
mov byte [ebp - 4], 2
mov eax, dword [eax]
mov eax, dword [eax + edi]
sub eax, 0x10
push eax
call fcn.004025a0
add esp, 0xc
lea edi, [eax + 0x10]
mov dword [ebp - 0x24], edi
movzx eax, word [esi]
xor ebx, ebx
mov byte [ebp - 4], 3
mov ecx, eax
test ax, ax
je 0x413dfc
mov edi, esi
push ecx
call fcn.00422e67
add esp, 4
test eax, eax
je 0x413dac
test ebx, ebx
mov eax, edi
cmovne eax, ebx
mov ebx, eax
jmp 0x413dae
xor ebx, ebx
movzx eax, word [edi + 2]
add edi, 2
mov ecx, eax
test ax, ax
jne 0x413d94
mov edi, dword [ebp - 0x24]
test ebx, ebx
je 0x413dfc
sub ebx, esi
sar ebx, 1
js 0x41447e
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, ebx
or eax, ecx
jge 0x413dea
push ebx
lea ecx, [ebp - 0x30]
call fcn.00401bb0
mov esi, dword [ebp - 0x30]
cmp ebx, dword [esi - 8]
jg 0x41447e
xor eax, eax
mov dword [esi - 0xc], ebx
mov word [esi + ebx*2], ax
movzx eax, word [esi]
mov ebx, esi
push eax
call fcn.00422e67
add esp, 4
test eax, eax
je 0x413ee3
movzx eax, word [ebx + 2]
add ebx, 2
push eax
call fcn.00422e67
add esp, 4
test eax, eax
jne 0x413e12
cmp ebx, esi
je 0x413ee3
mov edx, dword [esi - 0xc]
sub ebx, esi
sar ebx, 1
test edx, edx
js 0x41447e
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x413e5a
push edx
lea ecx, [ebp - 0x30]
call fcn.00401bb0
mov esi, dword [ebp - 0x30]
mov eax, dword [esi - 0xc]
lea edx, [esi + ebx*2]
sub eax, ebx
mov dword [ebp - 0x1c], eax
lea ecx, [eax*2 + 2]
test ecx, ecx
je 0x413ebb
test edx, edx
jne 0x413e8b
call fcn.00420096
mov dword [eax], 0x16
call fcn.004205b4
mov eax, 0x16
jmp 0x413ebd
mov eax, dword [esi - 0xc]
lea eax, [eax*2 + 2]
cmp eax, ecx
jae 0x413eb0
call fcn.00420096
mov dword [eax], 0x22
call fcn.004205b4
mov eax, 0x22
jmp 0x413ebd
push ecx
push edx
push esi
call fcn.0041e260
add esp, 0xc
xor eax, eax
push eax
call fcn.00401a10
mov eax, dword [ebp - 0x1c]
add esp, 4
test eax, eax
js 0x41447e
cmp eax, dword [esi - 8]
jg 0x41447e
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
mov eax, dword [ebp - 0x20]
xor ebx, ebx
movzx ecx, word [eax]
test cx, cx
je 0x413f5d
mov edi, eax
push ecx
call fcn.00422e67
add esp, 4
test eax, eax
je 0x413f0a
test ebx, ebx
mov eax, edi
cmovne eax, ebx
mov ebx, eax
jmp 0x413f0c
xor ebx, ebx
movzx eax, word [edi + 2]
add edi, 2
mov ecx, eax
test ax, ax
jne 0x413ef2
mov edi, dword [ebp - 0x24]
mov eax, dword [ebp - 0x20]
test ebx, ebx
je 0x413f5d
sub ebx, eax
sar ebx, 1
js 0x41447e
mov ecx, dword [eax - 8]
mov edx, 1
sub edx, dword [eax - 4]
sub ecx, ebx
or ecx, edx
jge 0x413f4b
push ebx
lea ecx, [ebp - 0x20]
call fcn.00401bb0
mov eax, dword [ebp - 0x20]
cmp ebx, dword [eax - 8]
jg 0x41447e
xor ecx, ecx
mov dword [eax - 0xc], ebx
mov word [eax + ebx*2], cx
mov ebx, eax
movzx eax, word [eax]
push eax
call fcn.00422e67
add esp, 4
test eax, eax
je 0x414054
movzx eax, word [ebx + 2]
add ebx, 2
push eax
call fcn.00422e67
add esp, 4
test eax, eax
jne 0x413f73
mov eax, dword [ebp - 0x20]
cmp ebx, eax
je 0x414054
mov ecx, dword [eax - 0xc]
sub ebx, eax
sar ebx, 1
mov dword [ebp - 0x1c], ecx
test ecx, ecx
js 0x41447e
mov ecx, dword [eax - 8]
mov edx, 1
sub edx, dword [eax - 4]
sub ecx, dword [eax - 0xc]
or ecx, edx
jge 0x413fc4
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x20]
call fcn.00401bb0
mov eax, dword [ebp - 0x20]
lea ecx, [eax + ebx*2]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [eax - 0xc]
sub ecx, ebx
mov dword [ebp - 0x28], ecx
lea edx, [ecx*2 + 2]
test edx, edx
je 0x414029
mov ebx, dword [ebp - 0x1c]
test ebx, ebx
jne 0x413ff9
call fcn.00420096
mov dword [eax], 0x16
call fcn.004205b4
lea eax, [ebx + 0x16]
jmp 0x41402b
mov ecx, dword [eax - 0xc]
lea ecx, [ecx*2 + 2]
cmp ecx, edx
jae 0x41401e
call fcn.00420096
mov dword [eax], 0x22
call fcn.004205b4
mov eax, 0x22
jmp 0x41402b
push edx
push ebx
push eax
call fcn.0041e260
add esp, 0xc
xor eax, eax
push eax
call fcn.00401a10
mov ecx, dword [ebp - 0x28]
add esp, 4
test ecx, ecx
js 0x41447e
mov eax, dword [ebp - 0x20]
cmp ecx, dword [eax - 8]
jg 0x41447e
xor edx, edx
mov dword [eax - 0xc], ecx
mov word [eax + ecx*2], dx
movzx eax, word [edi]
xor ebx, ebx
mov dword [ebp - 0x28], edi
test ax, ax
je 0x4140cb
mov ecx, eax
push ecx
call fcn.00422e67
add esp, 4
test eax, eax
je 0x41407b
test ebx, ebx
mov eax, edi
cmovne eax, ebx
mov ebx, eax
jmp 0x41407d
xor ebx, ebx
movzx eax, word [edi + 2]
add edi, 2
mov ecx, eax
test ax, ax
jne 0x414063
mov edi, dword [ebp - 0x24]
test ebx, ebx
je 0x4140cb
sub ebx, edi
sar ebx, 1
js 0x41447e
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, ebx
or eax, ecx
jge 0x4140b9
push ebx
lea ecx, [ebp - 0x24]
call fcn.00401bb0
mov edi, dword [ebp - 0x24]
cmp ebx, dword [edi - 8]
jg 0x41447e
xor eax, eax
mov dword [edi - 0xc], ebx
mov word [edi + ebx*2], ax
movzx eax, word [edi]
mov ebx, edi
push eax
call fcn.00422e67
add esp, 4
test eax, eax
je 0x4141b2
movzx eax, word [ebx + 2]
add ebx, 2
push eax
call fcn.00422e67
add esp, 4
test eax, eax
jne 0x4140e1
cmp ebx, edi
je 0x4141b2
mov edx, dword [edi - 0xc]
sub ebx, edi
sar ebx, 1
test edx, edx
js 0x41447e
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, edx
or eax, ecx
jge 0x414129
push edx
lea ecx, [ebp - 0x24]
call fcn.00401bb0
mov edi, dword [ebp - 0x24]
mov eax, dword [edi - 0xc]
lea edx, [edi + ebx*2]
sub eax, ebx
mov dword [ebp - 0x28], eax
lea ecx, [eax*2 + 2]
test ecx, ecx
je 0x41418a
test edx, edx
jne 0x41415a
call fcn.00420096
mov dword [eax], 0x16
call fcn.004205b4
mov eax, 0x16
jmp 0x41418c
mov eax, dword [edi - 0xc]
lea eax, [eax*2 + 2]
cmp eax, ecx
jae 0x41417f
call fcn.00420096
mov dword [eax], 0x22
call fcn.004205b4
mov eax, 0x22
jmp 0x41418c
push ecx
push edx
push edi
call fcn.0041e260
add esp, 0xc
xor eax, eax
push eax
call fcn.00401a10
mov eax, dword [ebp - 0x28]
add esp, 4
test eax, eax
js 0x41447e
cmp eax, dword [edi - 8]
jg 0x41447e
xor ecx, ecx
mov dword [edi - 0xc], eax
mov word [edi + eax*2], cx
call fcn.00401ec0
mov ecx, eax
test ecx, ecx
je 0x414474
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x2c]
mov byte [ebp - 4], 4
test eax, eax
je 0x414474
mov edx, eax
mov ecx, esi
nop
mov bx, word [ecx]
cmp bx, word [edx]
jne 0x414206
test bx, bx
je 0x414202
mov bx, word [ecx + 2]
cmp bx, word [edx + 2]
jne 0x414206
add ecx, 4
add edx, 4
test bx, bx
jne 0x4141e0
xor ecx, ecx
jmp 0x41420b
sbb ecx, ecx
or ecx, 1
test ecx, ecx
je 0x4142ae
lea ecx, [esi - 0x10]
lea edi, [eax - 0x10]
cmp ecx, edi
je 0x414263
cmp dword [edi + 0xc], 0
lea ebx, [edi + 0xc]
jl 0x414257
mov eax, dword [ecx]
cmp eax, dword [edi]
jne 0x414257
push ecx
call fcn.004025a0
add esp, 4
mov dword [ebp - 0x28], eax
or ecx, 0xffffffff
lock xadd dword [ebx], ecx
dec ecx
test ecx, ecx
jg 0x41424f
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x28]
add eax, 0x10
mov dword [ebp - 0x2c], eax
jmp 0x414263
push dword [esi - 0xc]
lea ecx, [ebp - 0x2c]
push esi
call fcn.00401840
push esi
lea eax, [ebp - 0x1c]
push str.__s__r_n
push eax
call fcn.00402f80
mov edi, dword [ebp - 0x1c]
add esp, 0xc
cmp dword [edi - 4], 1
jle 0x41428c
push dword [edi - 0xc]
lea ecx, [ebp - 0x1c]
call fcn.00401ab0
mov edi, dword [ebp - 0x1c]
mov eax, dword [edi - 0xc]
lea ecx, [ebp - 0x18]
mov ebx, dword [ebp - 0x34]
add eax, eax
push 0
push ecx
push eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x414392
mov edi, dword [ebp - 0x24]
push edi
push dword [ebp - 0x20]
lea eax, [ebp - 0x1c]
push str._s_s_r_n
push eax
call fcn.00402f80
mov edi, dword [ebp - 0x1c]
add esp, 0x10
cmp dword [edi - 4], 1
mov ebx, dword [edi - 0xc]
jle 0x4142db
push ebx
lea ecx, [ebp - 0x1c]
call fcn.00401ab0
mov edi, dword [ebp - 0x1c]
push 0
lea eax, [ebp - 0x18]
push eax
lea eax, [ebx + ebx]
mov ebx, dword [ebp - 0x34]
push eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x414392
mov byte [ebp - 4], 3
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x414314
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x24]
or edi, 0xffffffff
mov byte [ebp - 4], 2
add edx, 0xfffffff0
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x414335
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x20]
mov eax, edi
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x414353
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x41436e
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x38]
inc edx
mov dword [ebp - 0x38], edx
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub eax, ecx
sar eax, 2
cmp edx, eax
jb 0x413d30
mov esi, dword [ebp - 0x2c]
jmp 0x41441d
push 0
push ebx
call fcn.00412090
add esp, 8
mov byte [ebp - 4], 3
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x4143b9
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x24]
or edi, 0xffffffff
mov byte [ebp - 4], 2
add edx, 0xfffffff0
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4143da
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x20]
mov eax, edi
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4143f8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x414413
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x2c]
xor bl, bl
jmp 0x414438
mov ebx, dword [ebp - 0x34]
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
push ebx
call fcn.00412090
add esp, 8
mov bl, 1
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x414454
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0041cd0c
mov esp, ebp
pop ebp
ret 0x10
push 0x80004005
call fcn.00401fc0
push 0x80070057
call fcn.00401fc0
int3