Function at 0x401740
Capabilities:
Read .ini file
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x48
mov ecx, dword [esi + 0x20]
fld1
xor eax, eax
fstp dword [esp + 4]
push ebx
push ebp
mov ebp, dword [sym.imp.USER32.dll_GetWindowRect]
push edi
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x20]
push eax
push ecx
call ebp
mov eax, dword [esi + 0x20]
mov edi, dword [sym.imp.USER32.dll_GetClientRect]
lea edx, [esp + 0x30]
push edx
push eax
call edi
mov ecx, dword [esp + 0x28]
mov eax, dword [esi + 0x48ac]
mov ebx, ecx
mov dword [esp + 0x14], ebx
test eax, eax
je 0x401801
mov edx, dword [esi + 0x48b0]
test edx, edx
je 0x401801
sub eax, dword [esp + 0x38]
sub edx, dword [esp + 0x3c]
add ecx, eax
mov eax, dword [esp + 0x2c]
add eax, edx
mov edx, dword [esp + 0x24]
push 1
mov dword [esp + 0x30], eax
sub eax, edx
push eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x30], ecx
sub ecx, eax
push ecx
push edx
push eax
mov ecx, esi
call fcn.00412eca
cmp ebx, dword [esp + 0x28]
je 0x401801
fild dword [esp + 0x14]
fidiv dword [esp + 0x28]
fstp dword [esp + 0x10]
mov edx, dword [esi + 0x20]
lea ecx, [esp + 0x40]
push ecx
push edx
call ebp
lea eax, [esp + 0x40]
push eax
mov ecx, esi
call fcn.0041215c
mov edx, dword [esi + 0x4d0c]
lea ecx, [esp + 0x20]
push ecx
push edx
call edi
mov ebp, dword [esp + 0x28]
mov ebx, dword [esp + 0x2c]
sub ebp, dword [esp + 0x20]
sub ebx, dword [esp + 0x24]
lea eax, [esi + 0x78]
push eax
push 0
push 0x441408
push str.SETTING
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
mov dword [esp + 0x18], eax
lea edi, [esi + 0x4cec]
push 1
cmp eax, 1
jne 0x401883
mov eax, dword [esp + 0x30]
sub eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
sub ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x50]
push eax
mov eax, dword [esp + 0x48]
sub edx, ebx
push ecx
sub edx, 0x14
push edx
add eax, 0x14
push eax
jmp 0x4018a9
mov ecx, dword [esp + 0x30]
sub ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
sub edx, dword [esp + 0x24]
mov eax, dword [esp + 0x50]
push ecx
mov ecx, dword [esp + 0x50]
sub eax, ebx
push edx
sub eax, 0x14
sub ecx, ebp
push eax
sub ecx, 0x14
push ecx
mov ecx, edi
call fcn.00412eca
mov eax, dword [esi + 0x54e0]
lea edx, [esp + 0x30]
push edx
push eax
call dword [sym.imp.USER32.dll_GetClientRect]
cmp dword [esp + 0x18], 1
lea ebx, [esi + 0x54c0]
push 1
jne 0x4018fd
mov edx, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
mov eax, dword [esp + 0x3c]
sub eax, dword [esp + 0x34]
mov ebp, edx
sub ebp, ecx
sub ecx, edx
mov edx, dword [esp + 0x50]
push ebp
push eax
lea ecx, [ecx + edx - 0x14]
mov edx, dword [esp + 0x4c]
push ecx
lea eax, [eax + edx + 0x19]
push eax
jmp 0x401931
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x38]
mov edx, ecx
sub edx, eax
push edx
mov edx, dword [esp + 0x40]
sub edx, dword [esp + 0x38]
sub eax, ecx
mov ecx, dword [esp + 0x54]
push edx
lea edx, [eax + ecx - 0x14]
mov eax, dword [esp + 0x54]
sub eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x3c]
push edx
sub eax, ebp
lea edx, [eax + ecx - 0x19]
push edx
mov ecx, ebx
call fcn.00412eca
mov ecx, dword [esi + 0x5cb4]
lea eax, [esp + 0x20]
push eax
push ecx
call dword [sym.imp.USER32.dll_GetWindowRect]
lea edx, [esp + 0x40]
push edx
mov ecx, esi
call fcn.0041215c
mov ebp, dword [esp + 0x28]
sub ebp, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
sub eax, ebp
mov dword [esp + 0x18], eax
fild dword [esp + 0x18]
test eax, eax
jge 0x401976
fadd dword [0x442950]
fld dword [esp + 0x10]
fld st(0)
fdivp st(2)
fld qword [0x442948]
fmul st(2), st(0)
fxch st(2)
call fcn.004281b0
fnstcw word [esp + 0x10]
mov ecx, eax
mov eax, dword [esp + 0x2c]
sub eax, dword [esp + 0x24]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x18], eax
fild dword [esp + 0x18]
movzx eax, word [esp + 0x10]
or eax, 0xc00
mov dword [esp + 0x18], eax
fdiv st(1)
fadd st(2)
fldcw word [esp + 0x18]
fistp qword [esp + 0x18]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x18], ebp
mov dword [esp + 0x14], edx
fldcw word [esp + 0x10]
fild dword [esp + 0x18]
test ebp, ebp
jge 0x4019df
fadd dword [0x442950]
fdiv st(1)
fnstcw word [esp + 0x10]
fadd st(2)
movzx eax, word [esp + 0x10]
or eax, 0xc00
mov dword [esp + 0x18], eax
fldcw word [esp + 0x18]
fistp qword [esp + 0x18]
mov eax, dword [esp + 0x18]
add eax, ecx
mov dword [esp + 0x28], eax
fldcw word [esp + 0x10]
fidivr dword [esp + 0x24]
faddp st(1)
call fcn.004281b0
mov ecx, dword [esp + 0x14]
lea ebp, [esi + 0x78]
push ebp
push 0
mov dword [esp + 0x2c], eax
push str.LineTopOffset
add eax, ecx
push str.SETTING
mov dword [esp + 0x3c], eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
test eax, eax
jge 0x401a42
xor eax, eax
jmp 0x401a4c
cmp eax, 0x14
jle 0x401a4c
mov eax, 0x14
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x2c]
add dword [esp + 0x20], 0x14
add ecx, eax
mov eax, dword [esp + 0x28]
push 1
sub edx, ecx
push edx
mov edx, dword [esp + 0x28]
sub eax, 0x14
mov dword [esp + 0x30], eax
sub eax, edx
push eax
push ecx
mov dword [esp + 0x34], ecx
push edx
lea ecx, [esi + 0x5c94]
call fcn.00412eca
lea eax, [esi + 0x489c]
test eax, eax
je 0x401a90
mov eax, dword [eax + 4]
push 0
push eax
mov eax, dword [esi + 0x4d0c]
push 0x30
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [edi + 0x130]
mov dword [edi + 0x70], 1
test eax, eax
je 0x401ac7
mov ecx, dword [edi + 0x144]
test ecx, ecx
je 0x401ac7
mov ecx, dword [ecx + 4]
push ecx
push eax
call fcn.0041271d
lea ecx, [edi + 0x13c]
call fcn.004126e6
lea ecx, [edi + 0x12c]
call fcn.00412425
push ebp
push 0x5a
mov eax, 1
push str.ButtonColorR
mov byte [esi + 0x4d74], 3
push str.SETTING
mov dword [edi + 0x60], eax
mov dword [edi + 0x64], eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
push ebp
push 0xf0
push str.ButtonColorG
push str.SETTING
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
push ebp
push 0xa0
push str.ButtonColorB
push str.SETTING
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
mov ebp, 0xff
cmp dword [esp + 0x14], ebp
jle 0x401b45
mov dword [esp + 0x14], ebp
cmp dword [esp + 0x10], ebp
jle 0x401b4f
mov dword [esp + 0x10], ebp
cmp eax, ebp
jle 0x401b55
mov eax, ebp
movzx ecx, byte [esp + 0x10]
movzx edx, byte [esp + 0x14]
movzx ebp, al
mov eax, dword [edi + 0x20]
shl ebp, 8
or ebp, ecx
push 1
shl ebp, 8
push 0
or ebp, edx
push eax
mov dword [edi + 0x98], ebp
call dword [sym.imp.USER32.dll_InvalidateRect]
mov ecx, dword [edi + 0x20]
push 1
push 0
mov dword [edi + 0xa0], ebp
mov edi, dword [sym.imp.USER32.dll_InvalidateRect]
push ecx
call edi
lea eax, [esi + 0x489c]
test eax, eax
je 0x401ba3
mov eax, dword [eax + 4]
mov edx, dword [esi + 0x54e0]
push 0
push eax
push 0x30
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [ebx + 0x130]
mov dword [ebx + 0x70], 1
test eax, eax
je 0x401bda
mov ecx, dword [ebx + 0x144]
test ecx, ecx
je 0x401bda
mov ecx, dword [ecx + 4]
push ecx
push eax
call fcn.0041271d
lea ecx, [ebx + 0x13c]
call fcn.004126e6
lea ecx, [ebx + 0x12c]
call fcn.00412425
mov eax, 1
mov byte [esi + 0x5548], 3
push eax
mov dword [ebx + 0x60], eax
mov dword [ebx + 0x64], eax
mov eax, dword [ebx + 0x20]
push 0
push eax
mov dword [ebx + 0x98], ebp
call edi
mov ecx, dword [ebx + 0x20]
push 1
push 0
push ecx
mov dword [ebx + 0xa0], ebp
call edi
lea eax, [esi + 0x488c]
test eax, eax
je 0x401c2e
mov eax, dword [eax + 4]
mov edx, dword [esi + 0x5cb4]
push 1
push eax
push 0x30
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
pop edi
pop ebp
pop ebx
add esp, 0x48
ret