Function at 0x40596d
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x437941
mov eax, dword fs:[0]
push eax
sub esp, 0x418
mov eax, dword [0x449390]
xor eax, esp
mov dword [esp + 0x410], eax
push ebx
push esi
push edi
mov eax, dword [0x449390]
xor eax, esp
push eax
lea eax, [esp + 0x428]
mov dword fs:[0], eax
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x38]
push 0x3e7
push eax
mov eax, str.xb_config_SUG0_821_GS128.txt
call fcn.004060e7
mov ebx, eax
xor esi, esi
add esp, 0xc
cmp ebx, esi
je 0x405a38
mov dword [0x514d98], esi
call fcn.0040a75b
push eax
lea ecx, [esp + 0x18]
call fcn.00401660
push 0x43ff58
lea ecx, [esp + 0x18]
mov dword [esp + 0x434], 8
call fcn.004013e5
push 0x43ffa4
lea ecx, [esp + 0x18]
call fcn.00401d46
mov edi, dword [esp + 0x14]
mov ecx, dword [0x50cad8]
push edi
call fcn.004162f3
cmp dword [ebp + 8], esi
je 0x405a29
mov eax, ebx
call fcn.00405906
lea ecx, [edi - 0x10]
call fcn.00401108
xor eax, eax
jmp 0x405def
mov edi, dword [esp + 0x10]
lea eax, [esp + 0x34]
mov byte [esp + edi + 0x34], 0
push eax
inc edi
call fcn.0040125f
pop ecx
push eax
lea ecx, [esp + 0x1c]
call fcn.0040577e
mov dword [esp + 0x430], esi
mov dword [0x514d98], 1
cmp edi, 0x14
jae 0x405aa1
movzx eax, byte [0x514d35]
shl eax, 2
push dword [eax + 0x44a7c0]
push dword [eax + 0x44a7b8]
call fcn.00401309
mov eax, dword [0x50cad8]
pop ecx
pop ecx
push esi
push esi
push 0x10
push dword [eax + 0x20]
call dword [sym.imp.USER32.dll_PostMessageW]
jmp 0x405de0
push str.VALD
push ecx
lea eax, [esp + 0x20]
mov dword [esp + 0x18], esp
mov ecx, esp
push eax
call fcn.00401685
lea eax, [esp + 0x28]
push eax
call fcn.00401184
add esp, 0xc
mov edi, 0x43ff44
push edi
mov ecx, eax
mov byte [esp + 0x434], 1
call fcn.00405ea6
test eax, eax
mov byte [esp + 0x430], 0
mov ecx, dword [esp + 0x20]
setne bl
add ecx, 0xfffffff0
call fcn.00401108
test bl, bl
je 0x405b2d
movzx eax, byte [0x514d35]
shl eax, 2
push dword [eax + 0x44a7c8]
mov dword [0x514d9c], esi
push dword [eax + 0x44a7b8]
call fcn.00401309
mov eax, dword [0x50cad8]
pop ecx
pop ecx
push esi
push esi
push 0x10
push dword [eax + 0x20]
call dword [sym.imp.USER32.dll_PostMessageW]
jmp 0x405b37
mov dword [0x514d9c], 1
push str.MSGE
push ecx
lea eax, [esp + 0x20]
mov dword [esp + 0x18], esp
mov ecx, esp
push eax
call fcn.00401685
lea eax, [esp + 0x24]
push eax
call fcn.00401184
add esp, 0xc
push 0x43dae4
lea ecx, [esp + 0x20]
mov byte [esp + 0x434], 2
call fcn.00405ea6
test eax, eax
je 0x405b8c
movzx eax, byte [0x514d35]
push dword [eax*4 + 0x44a7d8]
lea esi, [esp + 0x20]
call fcn.0040135f
pop ecx
call fcn.0040a75b
push eax
lea ecx, [esp + 0x18]
call fcn.00401660
push 0x43ff58
lea ecx, [esp + 0x18]
mov byte [esp + 0x434], 3
call fcn.004013e5
push str.WKEY
push ecx
lea eax, [esp + 0x20]
mov dword [esp + 0x18], esp
mov ecx, esp
push eax
call fcn.00401685
lea eax, [esp + 0x30]
push eax
call fcn.00401184
add esp, 0xc
push edi
mov ecx, eax
mov byte [esp + 0x434], 4
call fcn.00405ea6
mov ebx, eax
neg ebx
mov byte [esp + 0x430], 3
mov ecx, dword [esp + 0x28]
sbb bl, bl
add ecx, 0xfffffff0
inc bl
call fcn.00401108
xor eax, eax
test bl, bl
setne al
push str.UPLD
push ecx
mov dword [esp + 0x18], esp
mov ecx, esp
mov dword [0x514da4], eax
lea eax, [esp + 0x20]
push eax
call fcn.00401685
lea eax, [esp + 0x38]
push eax
call fcn.00401184
add esp, 0xc
push edi
mov ecx, eax
mov byte [esp + 0x434], 5
call fcn.00405ea6
mov ebx, eax
neg ebx
mov byte [esp + 0x430], 3
mov ecx, dword [esp + 0x30]
sbb bl, bl
add ecx, 0xfffffff0
inc bl
call fcn.00401108
test bl, bl
je 0x405c7a
push 0x43ff78
lea eax, [esp + 0x18]
push eax
mov dword [0x514da0], 1
call fcn.00401431
jmp 0x405c81
and dword [0x514da0], 0
push str.MUST
push ecx
lea eax, [esp + 0x20]
mov dword [esp + 0x18], esp
mov ecx, esp
push eax
call fcn.00401685
lea eax, [esp + 0x2c]
push eax
call fcn.00401184
add esp, 0xc
push edi
mov ecx, eax
mov byte [esp + 0x434], 6
call fcn.00405ea6
mov ebx, eax
neg ebx
mov byte [esp + 0x430], 3
mov ecx, dword [esp + 0x24]
sbb bl, bl
add ecx, 0xfffffff0
inc bl
call fcn.00401108
test bl, bl
je 0x405cef
push 0x43ff84
lea eax, [esp + 0x18]
push eax
mov dword [0x514d94], 1
call fcn.00401431
jmp 0x405cf6
and dword [0x514d94], 0
push str.DATA
push ecx
lea eax, [esp + 0x20]
mov dword [esp + 0x18], esp
mov ecx, esp
push eax
call fcn.00401685
lea eax, [esp + 0x34]
push eax
call fcn.00401184
add esp, 0xc
push edi
mov ecx, eax
mov byte [esp + 0x434], 7
call fcn.00405ea6
mov ebx, eax
neg ebx
mov byte [esp + 0x430], 3
mov ecx, dword [esp + 0x2c]
sbb bl, bl
add ecx, 0xfffffff0
inc bl
call fcn.00401108
test bl, bl
je 0x405dbc
push 0x554dbc
push 0x40000
push 0x514dbc
mov eax, str.xb_rom_SUG0.rom
call fcn.004060e7
xor esi, esi
add esp, 0xc
cmp eax, esi
jne 0x405da5
mov eax, dword [0x554dbc]
mov edi, eax
mov dword [esp + 0x10], esi
cmp eax, esi
jbe 0x405d94
lea eax, [esp + 0x10]
push eax
call fcn.00401a61
xor byte [esi + 0x514dbc], al
inc esi
pop ecx
mov dword [esp + 0x10], esi
cmp esi, edi
jb 0x405d7a
push 0x43ffa0
lea eax, [esp + 0x18]
push eax
call fcn.00401431
jmp 0x405dbc
call fcn.00405906
mov eax, dword [0x50cad8]
push esi
push esi
push 0x10
push dword [eax + 0x20]
call dword [sym.imp.USER32.dll_PostMessageW]
mov esi, dword [esp + 0x14]
mov ecx, dword [0x50cad8]
push esi
call fcn.004162f3
lea ecx, [esi - 0x10]
call fcn.00401108
mov ecx, dword [esp + 0x1c]
add ecx, 0xfffffff0
call fcn.00401108
mov ecx, dword [esp + 0x18]
add ecx, 0xfffffff0
call fcn.00401108
xor eax, eax
inc eax
mov ecx, dword [esp + 0x428]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x410]
xor ecx, esp
call fcn.0041ce9c
mov esp, ebp
pop ebp
ret