Function at 0x409460
Capabilities:
Get file size
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x224
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
push eax
lea ecx, [esp + 0x130]
xor edi, edi
push str._s_setup.cfg
push ecx
mov dword [esp + 0x24], edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x18], edi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
lea edx, [esp + 0x12c]
push edi
push 0x80
push 3
push edi
push edi
push 0x80000000
push edx
call ebx
mov esi, eax
cmp esi, 0xffffffff
je 0x40951f
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
test edi, edi
je 0x4094f6
lea eax, [edi + 1]
push eax
call fcn.00450d2b
add esp, 4
lea ecx, [esp + 0x18]
mov dword [esp + 0xc], eax
push 0
push ecx
push edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4094f6
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [esp + 0x12c]
push 0x80
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
test eax, eax
jne 0x40951b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [esp + 0xc]
push 0
push 0x80
push 2
push 0
push 0
lea eax, [esp + 0x140]
push 0x40000000
push eax
call ebx
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x40954d
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x18]
mov dword [esp + 0x28], edi
test eax, eax
jbe 0x4097b3
test edi, edi
je 0x4097b3
push edi
call fcn.00408e90
mov dword [esp + 0x20], eax
mov al, byte [0x47de5c]
add esp, 4
test al, al
je 0x409793
xor eax, eax
xor ecx, ecx
mov esi, 0x47de5d
mov dl, byte [esi]
inc eax
inc esi
test dl, dl
jne 0x409588
mov dl, byte [0x46ceb4]
mov esi, 0x46ceb5
test dl, dl
je 0x4095a7
mov bl, byte [esi]
inc ecx
inc esi
test bl, bl
jne 0x40959f
cmp eax, ecx
jne 0x409826
mov bl, byte [eax + 0x47de5b]
dec eax
dec ecx
cmp bl, byte [ecx + 0x46ceb4]
jne 0x4095d7
test eax, eax
je 0x4095df
test ecx, ecx
je 0x4095d7
mov bl, byte [eax + 0x47de5b]
dec eax
dec ecx
cmp bl, byte [ecx + 0x46ceb4]
je 0x4095bf
test eax, eax
jne 0x409826
test ecx, ecx
jne 0x409826
cmp byte [0x47de5c], dl
jne 0x409826
mov eax, dword [0x46b6f0]
xor edx, edx
test eax, eax
mov byte [esp + 0x2c], cl
mov dword [esp + 0x14], edx
jbe 0x409793
mov bl, byte [0x47f7a8]
lea esi, [edx + edx*2]
shl esi, 3
xor ecx, ecx
xor edi, edi
mov eax, dword [esi + 0x46b304]
mov edx, 0x47f7a9
test bl, bl
je 0x409631
mov bl, byte [edx]
inc ecx
inc edx
test bl, bl
jne 0x409629
mov bl, byte [eax]
lea edx, [eax + 1]
test bl, bl
je 0x409642
mov bl, byte [edx]
inc edi
inc edx
test bl, bl
jne 0x40963a
mov edx, dword [esp + 0x14]
cmp ecx, edi
jne 0x409747
mov bl, byte [ecx + 0x47f7a7]
dec ecx
dec edi
cmp bl, byte [edi + eax]
jne 0x409672
xor ebx, ebx
cmp ecx, ebx
je 0x40967c
cmp edi, ebx
je 0x409674
mov bl, byte [ecx + 0x47f7a7]
dec ecx
dec edi
cmp bl, byte [edi + eax]
je 0x40965b
xor ebx, ebx
cmp ecx, ebx
jne 0x409747
cmp edi, ebx
jne 0x409747
mov cl, byte [0x47f7a8]
cmp cl, byte [eax]
jne 0x409747
mov ecx, dword [esi + 0x46b30c]
and ecx, 0xffff0000
cmp ecx, 0x4000000
ja 0x4096ec
je 0x4096cd
cmp ecx, 0x1000000
je 0x4096cd
cmp ecx, 0x2000000
jne 0x409741
mov edx, dword [esi + 0x46b300]
mov ecx, dword [edx]
push ecx
push eax
push str.set__s__d_r_n
jmp 0x409709
mov ecx, dword [esi + 0x46b300]
mov edx, dword [ecx]
push edx
push eax
lea eax, [esp + 0x34]
push str.set__s__d_r_n
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
jmp 0x40973b
cmp ecx, 0x8000000
je 0x409719
cmp ecx, 0x10000000
jne 0x409741
mov ecx, dword [esi + 0x46b300]
push ecx
push eax
push str.set__s__s_r_n
lea edx, [esp + 0x38]
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
jmp 0x40973b
mov ecx, dword [esi + 0x46b300]
sub esp, 8
lea edx, [esp + 0x34]
fld dword [ecx]
fstp qword [esp]
push eax
push str.set__s__f_r_n
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
mov dword [esi + 0x46b314], ebx
mov edx, dword [0x46b6f0]
mov eax, dword [0x46b6f0]
inc edx
cmp edx, eax
mov dword [esp + 0x14], edx
jb 0x40960a
mov al, byte [esp + 0x2c]
test al, al
je 0x40978f
lea eax, [esp + 0x24]
push 0
push eax
lea edi, [esp + 0x34]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x18]
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x38]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409544
mov edi, dword [esp + 0xc]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
add eax, ecx
add edi, ecx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x20], eax
cmp eax, ecx
mov dword [esp + 0xc], edi
jb 0x40955d
mov eax, dword [0x46b6f0]
xor ebx, ebx
test eax, eax
jbe 0x409905
mov esi, 0x46b300
mov eax, dword [esi + 0x14]
xor edi, edi
cmp eax, edi
je 0x4098f4
test byte [esi + 0x10], 1
je 0x4098f4
mov eax, dword [esi + 0xc]
and eax, 0xffff0000
cmp eax, 0x4000000
ja 0x409879
je 0x409869
cmp eax, 0x1000000
je 0x40984b
cmp eax, 0x2000000
jne 0x4098c7
mov eax, dword [esi]
mov edx, dword [esi + 4]
mov ecx, dword [eax]
lea eax, [esp + 0x2c]
push ecx
push edx
push str.set__s__d_r_n
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
jmp 0x4098c4
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x24]
push 0
push eax
push ecx
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409544
jmp 0x409793
mov ecx, dword [esi]
mov eax, dword [esi + 4]
mov edx, dword [ecx]
lea ecx, [esp + 0x2c]
push edx
push eax
push str.set__s__d_r_n
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
jmp 0x4098c4
mov edx, dword [esi]
mov ecx, dword [esi + 4]
mov eax, dword [edx]
push eax
push ecx
push str.set__s__d_r_n
jmp 0x409893
cmp eax, 0x8000000
je 0x4098a3
cmp eax, 0x10000000
jne 0x4098c7
mov eax, dword [esi]
mov ecx, dword [esi + 4]
push eax
push ecx
push str.set__s__s_r_n
lea edx, [esp + 0x38]
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
jmp 0x4098c4
mov eax, dword [esi]
mov ecx, dword [esi + 4]
sub esp, 8
lea edx, [esp + 0x34]
fld dword [eax]
fstp qword [esp]
push ecx
push str.set__s__f_r_n
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
mov dword [esi + 0x14], edi
lea eax, [esp + 0x24]
push edi
push eax
lea edi, [esp + 0x34]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edx, dword [esp + 0x18]
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x38]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409544
mov eax, dword [0x46b6f0]
inc ebx
add esi, 0x18
cmp ebx, eax
jb 0x4097c7
mov eax, dword [esp + 0x28]
test eax, eax
je 0x409916
push eax
call fcn.00450d9f
add esp, 4
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret