Function at 0x40d710
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40fcb0
mov eax, dword fs:[0]
push eax
sub esp, 0x8c
mov eax, dword [0x414008]
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 edi, ecx
push 8
xorps xmm0, xmm0
mov dword [ebp - 0x70], 0
push str.tgm3.cfg
lea ecx, [ebp - 0x80]
movlpd qword [ebp - 0x2c], xmm0
mov dword [ebp - 0x6c], 0xf
mov byte [ebp - 0x80], 0
call fcn.00403e40
lea eax, [ebp - 0x80]
mov dword [ebp - 4], 0
push eax
lea ecx, [ebp - 0x2c]
call fcn.004019a0
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x6c]
cmp edx, 0x10
jb 0x40d7b6
mov ecx, dword [ebp - 0x80]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40d7ac
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40d7ac
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0040e5c2
add esp, 8
push 0x14
push str.patches.resolution_x
lea ecx, [ebp - 0x68]
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x6c], 0xf
mov byte [ebp - 0x80], 0
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0xf
mov byte [ebp - 0x68], 0
call fcn.00403e40
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 3
push eax
push 0x280
lea ecx, [ebp - 0x2c]
call fcn.0040d530
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x54]
mov dword [ebp - 0x20], eax
cmp edx, 0x10
jb 0x40d839
mov ecx, dword [ebp - 0x68]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40d82f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e27e
push edx
push ecx
call fcn.0040e5c2
add esp, 8
push 0x14
push str.patches.resolution_y
lea ecx, [ebp - 0x68]
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0xf
mov byte [ebp - 0x68], 0
call fcn.00403e40
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 4
push eax
push 0x1e0
lea ecx, [ebp - 0x2c]
call fcn.0040d530
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x54]
mov dword [ebp - 0x1c], eax
cmp edx, 0x10
jb 0x40d8aa
mov ecx, dword [ebp - 0x68]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40d8a0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e27e
push edx
push ecx
call fcn.0040e5c2
add esp, 8
push 0x12
push str.patches.fullscreen
lea ecx, [ebp - 0x68]
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0xf
mov byte [ebp - 0x68], 0
call fcn.00403e40
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 5
push eax
push 1
lea ecx, [ebp - 0x2c]
call fcn.0040d5f0
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x54]
mov byte [ebp - 0x21], al
cmp edx, 0x10
jb 0x40d918
mov ecx, dword [ebp - 0x68]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40d90e
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e27e
push edx
push ecx
call fcn.0040e5c2
add esp, 8
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
lea eax, [ebp - 0x14]
push eax
push 0x40
push 1
push 0x44dcc9
push edi
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
lea eax, [ebp - 0x21]
push 0
push 1
push eax
push 0x44dcc9
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 1
push 0x44dcc9
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x40d160
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x40d160
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x40d160
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x40d165
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x40d165
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x40d165
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x40d19a
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x40d19a
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x40d19a
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x40d19f
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x40d19f
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x40d19f
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x41f154
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x41f154
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x41f154
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x41f163
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x41f163
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x41f163
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x41f176
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x41f176
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x41f176
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x41f181
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x41f181
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x41f181
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44dca6
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x44dca6
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dca6
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44dcab
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x44dcab
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dcab
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44dcb0
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x44dcb0
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dcb0
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44dcb5
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x44dcb5
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dcb5
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44dd2d
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x44dd2d
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dd2d
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44dd32
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x44dd32
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dd32
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44dd4d
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x44dd4d
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dd4d
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44dd52
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x44dd52
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dd52
push edi
call ebx
movd xmm1, dword [ebp - 0x20]
lea eax, [ebp - 0x14]
movd xmm0, dword [ebp - 0x1c]
cvtdq2ps xmm1, xmm1
push eax
push 0x40
push 4
push 0x44dd6b
cvtdq2ps xmm0, xmm0
push edi
divss xmm1, xmm0
movss dword [ebp - 0x30], xmm1
call ebx
push 0
push 4
lea eax, [ebp - 0x30]
push eax
push 0x44dd6b
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44dd6b
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44e126
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x44e126
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44e126
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44e12b
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x44e12b
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44e12b
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44e198
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x44e198
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44e198
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44e19d
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x44e19d
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44e19d
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44e349
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x44e349
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44e349
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44e34e
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x44e34e
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44e34e
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44e429
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x44e429
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44e429
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44e42e
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x44e42e
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44e42e
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x450e5b
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x450e5b
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x450e5b
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x450e60
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x450e60
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x450e60
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x450e90
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x450e90
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x450e90
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x450e95
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x450e95
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x450e95
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x450ed7
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x1c]
push eax
push 0x450ed7
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x450ed7
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x450edc
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x20]
push eax
push 0x450edc
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x450edc
push edi
call ebx
lea eax, [ebp - 0x14]
push eax
push 0x40
push 2
push 0x42ed40
push edi
call ebx
push 0
push 2
push 0x410894
push 0x42ed40
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 2
push 0x42ed40
push edi
call ebx
push 0x12
push str.patches.gl_nearest
lea ecx, [ebp - 0x68]
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0xf
mov byte [ebp - 0x68], 0
call fcn.00403e40
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 6
push eax
push 1
lea ecx, [ebp - 0x2c]
call fcn.0040d5f0
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x54]
mov byte [ebp - 0x15], al
cmp edx, 0x10
jb 0x40e000
mov ecx, dword [ebp - 0x68]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40dff3
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e27e
push edx
push ecx
call fcn.0040e5c2
mov al, byte [ebp - 0x15]
add esp, 8
test al, al
je 0x40e03c
lea eax, [ebp - 0x14]
mov dword [ebp - 0x34], 0x2600
push eax
push 0x40
push 4
push 0x43dc95
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x34]
push eax
push 0x43dc95
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x43dc95
push edi
call ebx
push 0x10
push str.patches.windowed
lea ecx, [ebp - 0x68]
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0xf
mov byte [ebp - 0x68], 0
call fcn.00403e40
lea eax, [ebp - 0x68]
mov byte [ebp - 4], 7
push eax
push 0
lea ecx, [ebp - 0x2c]
call fcn.0040d5f0
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x54]
mov byte [ebp - 0x15], al
cmp edx, 0x10
jb 0x40e0ad
mov ecx, dword [ebp - 0x68]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40e0a0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e27e
push edx
push ecx
call fcn.0040e5c2
mov al, byte [ebp - 0x15]
add esp, 8
test al, al
je 0x40e0e6
lea eax, [ebp - 0x14]
mov byte [ebp - 0x15], 0
push eax
push 0x40
push 1
push 0x44dcc9
push edi
call ebx
push 0
push 1
lea eax, [ebp - 0x15]
push eax
push 0x44dcc9
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 1
push 0x44dcc9
push edi
call ebx
lea eax, [ebp - 0x14]
mov byte [ebp - 0x22], 0
push eax
push 0x40
push 1
push 0x46a0b0
push edi
call ebx
push 0
push 1
lea eax, [ebp - 0x22]
push eax
push 0x46a0b0
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 1
push 0x46a0b0
push edi
call ebx
push 0x11
push str.patches.sram_path
lea ecx, [ebp - 0x98]
mov dword [ebp - 0x88], 0
mov dword [ebp - 0x84], 0xf
mov byte [ebp - 0x98], 0
call fcn.00403e40
mov byte [ebp - 4], 8
lea ecx, [ebp - 0x68]
push 2
push 0x4108d4
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0xf
mov byte [ebp - 0x68], 0
call fcn.00403e40
lea eax, [ebp - 0x98]
mov byte [ebp - 4], 9
push eax
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x2c]
call fcn.0040d4c0
mov edx, dword [ebp - 0x54]
cmp edx, 0x10
jb 0x40e1bc
mov ecx, dword [ebp - 0x68]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40e1b2
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e27e
push edx
push ecx
call fcn.0040e5c2
add esp, 8
mov edx, dword [ebp - 0x84]
cmp edx, 0x10
jb 0x40e1f6
mov ecx, dword [ebp - 0x98]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40e1ec
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e27e
push edx
push ecx
call fcn.0040e5c2
add esp, 8
mov esi, dword [ebp - 0x3c]
push 4
push 0x3000
inc esi
push esi
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
cmp dword [ebp - 0x38], 0x10
lea ecx, [ebp - 0x4c]
push 0
cmovae ecx, dword [ebp - 0x4c]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push ecx
push eax
push edi
mov dword [ebp - 0x50], eax
call esi
lea eax, [ebp - 0x14]
push eax
push 0x40
push 4
push 0x44b3e1
push edi
call ebx
push 0
push 4
lea eax, [ebp - 0x50]
push eax
push 0x44b3e1
push edi
call esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x14]
push 4
push 0x44b3e1
push edi
call ebx
mov edx, dword [ebp - 0x38]
cmp edx, 0x10
jb 0x40e28e
mov ecx, dword [ebp - 0x4c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40e284
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40e284
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0040e5c2
add esp, 8
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0xf
mov byte [ebp - 0x4c], 0
call fcn.00403550
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.0040e581
mov esp, ebp
pop ebp
ret