Function at 0x450b40
Capabilities:
Check if file exists
Clear file content
Get file size
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x5614eb
mov eax, dword fs:[0]
push eax
sub esp, 0x430
mov eax, dword [0x5b7a9c]
xor eax, esp
mov dword [esp + 0x42c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5b7a9c]
xor eax, esp
push eax
lea eax, [esp + 0x444]
mov dword fs:[0], eax
mov eax, dword [esp + 0x458]
mov ebp, dword [esp + 0x454]
xor ebx, ebx
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], eax
mov dword [esp + 0x24], ebx
call fcn.0050830c
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x450bb1
push 0x80004005
call fcn.00401350
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x20], ebx
xor eax, eax
cmp ebp, ebx
setne al
mov dword [esp + 0x44c], ebx
mov edi, ebp
cmp eax, ebx
jne 0x450be7
push 0x80004005
call fcn.00401350
mov ecx, dword [0x5ba3b8]
push ebp
push ecx
call fcn.005408be
add esp, 8
cmp eax, ebx
jne 0x450c01
mov edi, dword [0x5ba3b8]
push ebx
push 0x80
push 3
push ebx
push 3
push accept
push edi
mov dword [esp + 0x3c], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [esp + 0x18], esi
cmp esi, 0xffffffff
je 0x450c41
cmp esi, ebx
je 0x450ca6
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0x7fffffff
jb 0x450ca6
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x18], 0
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x450e56
mov eax, ebp
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x450c61
sub eax, edx
sar eax, 1
lea edi, [eax - 6]
mov ecx, str._u.ini
lea eax, [ebp + edi*2]
lea esp, [esp]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x450cda
test dx, dx
je 0x450ca2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x450cda
add eax, 4
add ecx, 4
test dx, dx
jne 0x450c80
xor eax, eax
jmp 0x450cdf
cmp edi, ebx
jne 0x450cae
xor eax, eax
jmp 0x450cc2
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x450cb3
sub eax, edx
sar eax, 1
push eax
push edi
lea ecx, [esp + 0x24]
call fcn.00401e70
mov dword [esp + 0x14], 1
jmp 0x450e52
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x450e56
lea esi, [edi + edi]
push esi
lea edx, [esp + 0x34]
push ebp
push edx
call fcn.005402a0
mov eax, 0x208
push 0x579db8
sub eax, edi
push eax
lea ecx, [esp + esi + 0x44]
push ecx
call fcn.0054013c
add esp, 0x18
push 1
xor edx, edx
push edx
push accept
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x28]
mov word [esp + esi + 0x48], dx
call fcn.00450840
test eax, eax
je 0x450e52
mov eax, dword [esp + 0x18]
test eax, eax
je 0x450d4a
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
jmp 0x450d4c
xor edi, edi
lea ecx, [edi + 1]
push ecx
call fcn.004ff272
add esp, 4
push 1
mov ebp, eax
push edi
push ebp
lea ecx, [esp + 0x24]
call fcn.00450970
lea ecx, [esp + 0x18]
mov byte [edi + ebp], 0
call fcn.0044d2c0
xor ecx, ecx
lea eax, [edi + 3]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004ff272
add esp, 4
mov esi, eax
push edi
lea ecx, [esi + 2]
push ecx
push edi
push ebp
push 0
mov eax, 0xfeff
push 0
mov word [esi], ax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov edi, eax
inc edi
xor edx, edx
lea ebx, [edi + edi]
push ebp
mov word [ebx + esi], dx
call fcn.004ff267
push 0x579da4
push esi
call fcn.005422d6
mov ebp, eax
add esp, 0xc
test ebp, ebp
je 0x450e01
add ebp, 6
mov eax, ebp
sub eax, esi
sar eax, 1
mov ecx, edi
sub ecx, eax
add ecx, ecx
push ecx
lea edx, [ebp + 2]
push ebp
push edx
call fcn.00542560
inc edi
add esp, 0xc
mov eax, 0x74
lea ebx, [edi + edi]
xor ecx, ecx
mov word [ebp], ax
mov word [ebx + esi], cx
mov edi, dword [esp + 0x28]
push 1
push 0
push 0x40000000
push edi
lea ecx, [esp + 0x28]
call fcn.00450840
test eax, eax
je 0x450e47
push ebx
push esi
lea ecx, [esp + 0x20]
call fcn.004509e0
lea ecx, [esp + 0x18]
call fcn.0044d2c0
push 1
push 0
push accept
push edi
lea ecx, [esp + 0x28]
call fcn.00450840
mov dword [esp + 0x14], eax
push esi
call fcn.004ff267
add esp, 4
mov ebp, edi
mov ebx, dword [esp + 0x18]
xor esi, esi
cmp dword [esp + 0x14], esi
je 0x450eff
test ebx, ebx
je 0x450e72
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
jmp 0x450e74
xor edi, edi
mov eax, edi
cdq
sub eax, edx
mov esi, eax
sar esi, 1
xor ecx, ecx
lea eax, [esi + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004ff272
add esp, 4
mov ebp, eax
mov dword [esp + 0x24], ebp
test ebx, ebx
je 0x450ef6
test ebp, ebp
je 0x450edf
push 0
lea eax, [esp + 0x18]
push eax
push edi
push ebp
push ebx
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x450ec9
cmp dword [esp + 0x14], edi
je 0x450edf
mov ecx, dword [esp + 0x1c]
push 0
push ecx
push 0
push 0x5bfb
call fcn.00450540
add esp, 0x10
cmp dword [esp + 0x20], 0
je 0x450eed
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
xor edx, edx
mov word [ebp + esi*2], dx
jmp 0x450f2b
push ebp
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x450f2b
push 4
call fcn.004ff272
add esp, 4
mov ecx, 0xfeff
xor edx, edx
mov word [eax], cx
mov dword [esp + 0x24], eax
mov esi, 1
mov word [eax + 2], dx
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x450f35
mov dword [eax], esi
mov dword [esp + 0x44c], 0xffffffff
test ebx, ebx
je 0x450f59
cmp dword [esp + 0x20], 0
je 0x450f52
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x450f79
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x444]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x42c]
xor ecx, esp
call fcn.0053fa67
add esp, 0x43c
ret