Function at 0x40db10
Capabilities:
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x5cc
push ebx
push esi
mov esi, eax
test esi, esi
push edi
mov dword [esp + 0x28], 0
jne 0x40db93
push eax
push str.Pages
lea esi, [esp + 0x30]
call fcn.00407150
add esp, 8
test eax, eax
jne 0x40db4c
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [esp + 0x28]
push 0
push 0x80
push 4
push 0
sub eax, esi
push 1
mov edi, eax
push 0xc0000000
lea eax, [esp + 0x4e8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40db43
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0
add edi, 0xfffffffe
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebx, 1
mov dword [esp + 0x20], 0
mov eax, dword [esp + 0x20]
test eax, eax
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea edx, [esp + 0x400]
jne 0x40dbce
mov ecx, dword [0x41de7c]
push str.Pages
push edx
mov dword [esp + 0x34], ecx
call edi
push str.Page_03u
jmp 0x40dbe5
mov ecx, dword [0x41de80]
push str.SubMenus
push edx
mov dword [esp + 0x34], ecx
call edi
push str.SubMenu_03u
lea eax, [esp + 0x12c]
push eax
call edi
xor eax, eax
mov dword [esp + 0xc0], 0x5b0a0d
mov ecx, 0x18
lea edi, [esp + 0xc4]
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x400]
push ecx
lea edx, [esp + 0xc4]
push edx
call edi
push 0x4173ec
lea eax, [esp + 0xc4]
push eax
call edi
lea ecx, [esp + 0xc0]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
lea edx, [esp + 0x3c]
push edx
push eax
mov dword [esp + 0x44], eax
lea eax, [esp + 0xcc]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [esp + 0x2c]
push edi
push str.Count
lea ecx, [esp + 0x3a0]
push str._s_d_r_n
push ecx
and ebx, eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea edx, [esp + 0x398]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
lea ecx, [esp + 0x40]
push ecx
push eax
lea edx, [esp + 0x3a4]
push edx
push esi
mov dword [esp + 0x50], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
and ebx, eax
xor eax, eax
cmp edi, eax
mov dword [esp + 0x14], eax
jle 0x40e02b
mov dword [esp + 0x30], eax
mov dword [esp + 0x18], eax
lea ecx, [ecx]
xor eax, eax
mov ecx, 0x18
lea edi, [esp + 0x5c]
mov dword [esp + 0x58], 0x5b0a0d
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x18]
test eax, eax
lea edx, [esp + 0x58]
lea ecx, [esp + 0x128]
jl 0x40dd07
mov eax, dword [esp + 0x14]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [esp + eax + 0x60]
push eax
call edi
add esp, 0xc
jmp 0x40dd15
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
push 0x4173ec
lea eax, [esp + 0x5c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x58]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
lea edx, [esp + 0x50]
push edx
push eax
mov dword [esp + 0x58], eax
lea eax, [esp + 0x64]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
and ebx, eax
mov eax, dword [esp + 0x20]
xor ecx, ecx
cmp eax, ecx
jne 0x40deab
mov eax, dword [esp + 0x18]
cmp eax, ecx
jl 0x40dd7a
mov edx, dword [esp + 0x14]
cmp edx, dword [0x41de7c]
jge 0x40dd7a
mov ecx, dword [0x41deac]
add eax, ecx
mov dword [esp + 0x10], eax
jmp 0x40dd7e
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x10]
push str.Name
add ecx, 4
push esi
or eax, 0xffffffff
call fcn.0040bda0
mov edx, dword [esp + 0x18]
add esp, 8
and ebx, eax
mov ecx, 1
add edx, 0x128
mov dword [esp + 0xc], ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x1c], 2
jmp 0x40ddc0
mov ecx, dword [esp + 0xc]
lea ecx, [ecx]
test ecx, ecx
mov eax, dword [esp + 0x24]
mov edx, dword [eax]
mov dword [esp + 0x44], edx
mov eax, str.ScrollMode_d
jl 0x40dde9
push ecx
push eax
lea eax, [esp + 0x470]
push eax
call edi
add esp, 0xc
lea eax, [esp + 0x468]
mov ecx, dword [esp + 0x44]
push ecx
push eax
lea edx, [esp + 0x2d0]
push str._s_d_r_n
push edx
call edi
add esp, 0x10
lea eax, [esp + 0x2c8]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
lea ecx, [esp + 0x58]
push ecx
push eax
lea edx, [esp + 0x2d4]
push edx
push esi
mov dword [esp + 0x68], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0xc]
and ebx, eax
mov eax, dword [esp + 0x1c]
add edx, 4
inc ecx
dec eax
mov dword [esp + 0x24], edx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x1c], eax
jne 0x40ddb9
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x130]
push ecx
push str.Flag
lea edx, [esp + 0x198]
push str._s_08x_r_n
push edx
call edi
add esp, 0x10
lea eax, [esp + 0x190]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
lea ecx, [esp + 0x38]
push ecx
push eax
lea edx, [esp + 0x19c]
push edx
push esi
mov dword [esp + 0x48], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
and ebx, eax
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
mov dword [esp + 0x10], ecx
jmp 0x40df6b
cmp dword [esp + 0x18], ecx
jl 0x40dece
mov edx, dword [esp + 0x14]
cmp edx, dword [0x41de80]
jge 0x40dece
mov eax, dword [0x41deb0]
mov ecx, dword [esp + 0x30]
add eax, ecx
mov dword [esp + 0xc], eax
jmp 0x40ded4
mov dword [esp + 0xc], ecx
mov eax, ecx
mov edx, dword [eax + 8]
movzx eax, word [eax]
push eax
push str.Page
lea ecx, [esp + 0x200]
push str._s_04x_r_n
push ecx
mov dword [esp + 0x20], edx
call edi
add esp, 0x10
lea edx, [esp + 0x1f8]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
lea ecx, [esp + 0x44]
push ecx
push eax
lea edx, [esp + 0x204]
push edx
push esi
mov dword [esp + 0x54], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
and ebx, eax
mov eax, dword [esp + 0xc]
mov ecx, dword [eax + 4]
push ecx
push str.Button
lea edx, [esp + 0x268]
push str._s_d_r_n
push edx
call edi
add esp, 0x10
lea eax, [esp + 0x260]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
lea ecx, [esp + 0x4c]
push ecx
push eax
lea edx, [esp + 0x26c]
push edx
push esi
mov dword [esp + 0x5c], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
and ebx, eax
mov eax, dword [esp + 0x10]
push eax
push str.Count
lea ecx, [esp + 0x338]
push str._s_d_r_n
push ecx
call edi
add esp, 0x10
lea edx, [esp + 0x330]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
lea ecx, [esp + 0x54]
push ecx
push eax
lea edx, [esp + 0x33c]
push edx
push esi
mov dword [esp + 0x64], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
and ebx, eax
mov eax, dword [esp + 0x20]
test eax, eax
mov eax, dword [esp + 0x14]
je 0x40dfc3
or eax, 0x8000
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x10]
test eax, eax
mov dword [esp + 0xc], 0
jle 0x40dffd
mov ecx, dword [esp + 0x1c]
push ecx
mov ecx, dword [esp + 0x10]
mov edi, esi
call fcn.0040e080
mov ecx, dword [esp + 0x14]
and ebx, eax
mov eax, dword [esp + 0x10]
add esp, 4
inc eax
cmp eax, ecx
mov dword [esp + 0xc], eax
jl 0x40dfd7
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
inc eax
add edi, 0x134
add edx, 0xc
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x30], edx
jl 0x40dcc0
mov eax, dword [esp + 0x20]
inc eax
cmp eax, 2
mov dword [esp + 0x20], eax
jl 0x40dba0
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40e06d
mov eax, dword [0x41db60]
test eax, eax
je 0x40e05f
push eax
call dword [sym.imp.KERNEL32.dll_HeapDestroy]
mov dword [0x41db60], 0
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
xor eax, eax
test ebx, ebx
pop esi
setne al
pop ebx
mov esp, ebp
pop ebp
ret