Function at 0x475380
Capabilities:
Reference sql statements
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x4a2c31
mov eax, dword fs:[0]
push eax
mov eax, 0x3950
mov dword fs:[0], esp
call fcn.0047f090
mov eax, dword [0x4d2084]
xor eax, esp
push ebx
push ebp
xor ebx, ebx
push esi
push edi
mov dword [esp + 0x395c], eax
mov ebp, ecx
mov dword [esp + 0x150], ebx
mov dword [esp + 0x154], ebx
mov dword [esp + 0x158], ebx
mov byte [esp + 0x15c], bl
mov edi, 0x4d1744
jmp 0x4753e0
lea ecx, [esp + 0xa0]
call fcn.00474b70
cmp dword [edi + 0x14], 0x10
mov dword [esp + 0x3968], ebx
jb 0x4753fd
mov eax, dword [edi]
jmp 0x4753ff
mov eax, edi
push eax
lea eax, [esp + 0x160]
push str.SELECT_DefWeekDay__DefHour__DefMinute__DefDuration__LatestTime_FROM_T_castlewar_time_set_WHERE__FeodName__LIKE_CONVERT___utf8__s_USING_gb2312__
push eax
call fcn.0047f034
add esp, 0xc
push 1
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x164]
push edx
mov ecx, 0x4d8c60
call fcn.00404b50
test al, al
je 0x4755f9
mov eax, dword [esp + 0x10]
push eax
call sub.LIBMYSQL.dll_mysql_num_rows
cmp eax, 1
jne 0x4755f9
mov ecx, dword [esp + 0x10]
push ecx
call sub.LIBMYSQL.dll_mysql_fetch_row
mov esi, eax
mov edx, dword [esi]
push edx
call fcn.0047f135
mov dword [ebp + 0x10], eax
mov eax, dword [esi + 4]
push eax
call fcn.0047f135
mov dword [ebp + 0x14], eax
mov ecx, dword [esi + 8]
push ecx
call fcn.0047f135
mov dword [ebp + 0x18], eax
mov edx, dword [esi + 0xc]
push edx
call fcn.0047f135
add esp, 0x10
push 0xffffffffffffffff
mov dword [ebp + 0x1c], eax
push ebx
lea eax, [edi - 4]
push eax
lea ecx, [esp + 0xac]
call fcn.004017d0
mov ecx, dword [esi + 0x10]
push ecx
call fcn.0047f135
add esp, 4
push eax
lea edx, [esp + 0x120]
push edx
mov ecx, ebp
call fcn.00473780
mov eax, dword [ebp + 0x1c]
mov ecx, dword [esp + 0x11c]
imul eax, eax, 0xe10
add eax, ecx
push ebx
push 0x4aa28a
lea ecx, [esp + 0xc8]
mov dword [esp + 0x128], eax
mov dword [esp + 0x12c], ebx
mov dword [esp + 0xc4], ebx
call fcn.004018c0
push ebx
push 0x4aa28a
lea ecx, [esp + 0xe4]
call fcn.004018c0
push ebx
push 0x4aa28a
lea ecx, [esp + 0x100]
call fcn.004018c0
lea ecx, [esp + 0x12c]
mov dword [esp + 0x114], ebx
mov dword [esp + 0x118], ebx
mov byte [esp + 0x128], 0
call fcn.004726f0
lea ecx, [esp + 0x13c]
call fcn.004727a0
lea ecx, [esp + 0xa0]
push ecx
mov ecx, ebp
call fcn.004752d0
lea ecx, [esp + 0xa0]
mov dword [esp + 0x3968], 0xffffffff
call fcn.00474c70
add edi, 0x1c
cmp edi, 0x4d1798
jl 0x4753e0
lea edx, [esp + 0x15c]
push str.SELECT_Name__CurrentUnion_FROM_T_feod
push edx
call fcn.0047f034
add esp, 8
push 1
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x164]
push ecx
mov ecx, 0x4d8c60
call fcn.00404b50
test al, al
je 0x475605
mov edx, dword [esp + 0x10]
push edx
call sub.LIBMYSQL.dll_mysql_num_rows
cmp eax, ebx
jle 0x4756d8
mov dword [esp + 0x18], eax
mov edi, edi
mov eax, dword [esp + 0x10]
push eax
call sub.LIBMYSQL.dll_mysql_fetch_row
xor ebx, ebx
mov dword [esp + 0x14], eax
xor edi, edi
mov ecx, dword [esp + 0x14]
mov esi, dword [ecx]
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4755e0
mov ecx, dword [ebp + 4]
sub eax, edx
cmp dword [edi + ecx + 0x18], 0x10
jb 0x47560c
mov ecx, dword [edi + ecx + 4]
jmp 0x475610
lea ecx, [esp + 0xa0]
call fcn.00474c70
xor al, al
jmp 0x475a83
lea ecx, [edi + ecx + 4]
push eax
push esi
push ecx
call fcn.004809e0
add esp, 0xc
test eax, eax
je 0x475633
add edi, 0xac
inc ebx
cmp edi, 0x204
jl 0x4755d2
jmp 0x4756ce
cmp ebx, 3
jge 0x4756ce
mov esi, dword [esp + 0x14]
mov edx, dword [esi + 4]
push edx
call fcn.0047f135
add esp, 4
test eax, eax
je 0x4756ce
mov eax, dword [esi + 4]
push eax
call fcn.0047f135
add esp, 4
push eax
call fcn.00459800
mov ecx, eax
call fcn.00459d40
mov edi, eax
test edi, edi
je 0x4756ce
mov eax, dword [ebp + 4]
mov ecx, dword [edi]
mov esi, ebx
imul esi, esi, 0xac
push 0xffffffffffffffff
mov dword [esi + eax + 0x1c], ecx
mov eax, dword [ebp + 4]
push 0
lea edx, [edi + 8]
lea ecx, [esi + eax + 0x20]
push edx
call fcn.004017d0
mov eax, dword [ebp + 4]
push 0xffffffffffffffff
lea ecx, [esi + eax + 0x3c]
push 0
lea eax, [edi + 0x6c]
push eax
call fcn.004017d0
mov ecx, dword [edi + 0x88]
push ecx
mov ecx, edi
call fcn.00459810
test eax, eax
je 0x4756ce
mov ecx, dword [ebp + 4]
push 0xffffffffffffffff
push 0
add eax, 0x10
lea ecx, [esi + ecx + 0x58]
push eax
call fcn.004017d0
dec dword [esp + 0x18]
jne 0x4755c0
lea edx, [esp + 0x15c]
push str.SELECT_FeodName__UnionID__UnionName__VassalName__FlagID__IsAttacker__IsAllowed__AnimalDead_FROM_T_castlewar_info
push edx
call fcn.0047f034
add esp, 8
push 1
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x164]
push ecx
mov ecx, 0x4d8c60
call fcn.00404b50
test al, al
je 0x475605
mov edx, dword [esp + 0x10]
push edx
call sub.LIBMYSQL.dll_mysql_num_rows
test eax, eax
jle 0x4759d9
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x10]
push eax
call sub.LIBMYSQL.dll_mysql_fetch_row
xor edi, edi
mov esi, eax
mov dword [esp + 0x14], edi
mov ebx, dword [esi]
mov eax, ebx
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x475740
mov ecx, dword [ebp + 4]
sub eax, edx
cmp dword [edi + ecx + 0x18], 0x10
jb 0x475759
mov ecx, dword [edi + ecx + 4]
jmp 0x47575d
lea ecx, [edi + ecx + 4]
push eax
push ebx
push ecx
call fcn.004809e0
add esp, 0xc
test eax, eax
je 0x475788
mov edx, dword [esp + 0x14]
inc edx
add edi, 0xac
cmp edi, 0x204
mov dword [esp + 0x14], edx
jl 0x475736
jmp 0x4759cf
mov edi, dword [esp + 0x14]
cmp edi, 3
jge 0x4759cf
mov eax, dword [ebp + 4]
imul edi, edi, 0xac
lea ecx, [esp + 0x1c]
mov byte [edi + eax + 0x88], 0
call fcn.00472260
lea ecx, [esp + 0x5c]
mov dword [esp + 0x3968], 1
call fcn.004722e0
mov ecx, dword [esi + 0x14]
push ecx
mov byte [esp + 0x396c], 2
call fcn.0047f135
mov edx, dword [esi + 4]
add esp, 4
cmp eax, 1
push edx
jne 0x4758a2
call fcn.0047f135
mov dword [esp + 0x20], eax
mov ecx, dword [esi + 8]
mov eax, ecx
add esp, 4
lea ebx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4757f8
sub eax, ebx
push eax
push ecx
lea ecx, [esp + 0x28]
call fcn.004018c0
mov ecx, dword [esi + 0xc]
mov eax, ecx
lea edx, [eax + 1]
mov bl, byte [eax]
inc eax
test bl, bl
jne 0x475814
sub eax, edx
push eax
push ecx
lea ecx, [esp + 0x44]
call fcn.004018c0
mov eax, dword [esi + 0x10]
push eax
call fcn.0047f135
mov dword [esp + 0x5c], eax
mov eax, dword [ebp + 4]
lea esi, [edi + eax + 0x8c]
mov eax, dword [esi + 4]
xor ebx, ebx
add esp, 4
cmp eax, ebx
jne 0x47584f
xor edx, edx
jmp 0x475857
mov edx, dword [esi + 8]
sub edx, eax
sar edx, 6
cmp eax, ebx
je 0x47588b
mov ecx, dword [esi + 0xc]
sub ecx, eax
sar ecx, 6
cmp edx, ecx
jae 0x47588b
mov ecx, dword [esp + 0x18]
mov edi, dword [esi + 8]
push ecx
push esi
lea edx, [esp + 0x24]
push edx
push 1
push edi
call fcn.004724c0
add esp, 0x14
add edi, 0x40
mov dword [esi + 8], edi
jmp 0x475929
mov eax, dword [esi + 8]
lea ecx, [esp + 0x1c]
push ecx
push 1
push eax
mov ecx, esi
call fcn.00472820
jmp 0x475929
call fcn.0047f135
mov dword [esp + 0x60], eax
mov ecx, dword [esi + 8]
mov eax, ecx
add esp, 4
lea ebx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4758b6
sub eax, ebx
push eax
push ecx
lea ecx, [esp + 0x68]
call fcn.004018c0
mov ecx, dword [esi + 0xc]
mov eax, ecx
lea edx, [eax + 1]
mov bl, byte [eax]
inc eax
test bl, bl
jne 0x4758d2
sub eax, edx
push eax
push ecx
lea ecx, [esp + 0x84]
call fcn.004018c0
mov eax, dword [esi + 0x10]
push eax
call fcn.0047f135
mov dword [esp + 0xa0], eax
mov ecx, dword [esi + 0x18]
push ecx
call fcn.0047f135
add esp, 8
dec eax
neg eax
sbb al, al
inc al
mov byte [esp + 0x98], al
mov eax, dword [ebp + 4]
lea edx, [esp + 0x5c]
push edx
lea ecx, [edi + eax + 0x9c]
call fcn.004731f0
xor ebx, ebx
mov eax, dword [esp + 0x94]
mov edi, 0x10
cmp eax, edi
mov esi, 0xf
jb 0x47594e
mov eax, dword [esp + 0x80]
push eax
call fcn.0047e60d
add esp, 4
cmp dword [esp + 0x78], edi
mov dword [esp + 0x94], esi
mov dword [esp + 0x90], ebx
mov byte [esp + 0x80], 0
jb 0x475977
mov ecx, dword [esp + 0x64]
push ecx
call fcn.0047e60d
add esp, 4
cmp dword [esp + 0x54], edi
mov dword [esp + 0x78], esi
mov dword [esp + 0x74], ebx
mov byte [esp + 0x64], 0
mov dword [esp + 0x3968], 0xffffffff
jb 0x4759a2
mov edx, dword [esp + 0x40]
push edx
call fcn.0047e60d
add esp, 4
cmp dword [esp + 0x38], edi
mov dword [esp + 0x54], esi
mov dword [esp + 0x50], ebx
mov byte [esp + 0x40], 0
jb 0x4759c2
mov eax, dword [esp + 0x24]
push eax
call fcn.0047e60d
add esp, 4
mov dword [esp + 0x38], esi
mov dword [esp + 0x34], ebx
mov byte [esp + 0x24], 0
dec dword [esp + 0x18]
jne 0x475724
mov ecx, dword [0x52f0f8]
push str.___________________________________________________________n
push ecx
call fcn.0048dda0
mov edx, dword [0x52f0f8]
push str._CastleWar_Init_Sucess_n
push edx
call fcn.0048dda0
mov eax, dword [0x52f0f8]
push str.___________________________________________________________n
push eax
call fcn.0048dda0
add esp, 0x18
xor esi, esi
mov edi, 0x10
mov eax, dword [ebp + 4]
add eax, esi
add eax, 0x7c
push eax
call fcn.0047fc05
mov ecx, dword [ebp + 4]
mov edx, dword [ecx + esi + 0x18]
add ecx, esi
add esp, 4
cmp edx, edi
jb 0x475a38
mov edx, dword [ecx + 4]
jmp 0x475a3b
lea edx, [ecx + 4]
mov ebx, dword [eax + 4]
mov ecx, dword [ecx + 0x1c]
push ebx
mov ebx, dword [eax + 8]
mov eax, dword [eax + 0x18]
push ebx
push eax
push ecx
push edx
mov edx, dword [0x52f0f8]
push str._FeodName_:___s___MasterUnionID_:___d___StartTime_:___d____d____d__n
push edx
call fcn.0048dda0
add esi, 0xac
add esp, 0x1c
cmp esi, 0x204
jl 0x475a15
mov eax, dword [0x52f0f8]
push str.___________________________________________________________n
push eax
call fcn.0048dda0
add esp, 8
mov al, 1
mov ecx, dword [esp + 0x3960]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x3950]
pop ebx
xor ecx, esp
call fcn.0047ece2
add esp, 0x395c
ret