Function at 0x5065e0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x57986c
mov eax, dword fs:[0]
push eax
sub esp, 0x4f0
mov eax, dword [0x5d7050]
xor eax, esp
mov dword [esp + 0x4e8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5d7050]
xor eax, esp
push eax
lea eax, [esp + 0x504]
mov dword fs:[0], eax
mov eax, dword [esp + 0x514]
push 0x3f
mov edi, ecx
xor ebp, ebp
lea ecx, [esp + 0x4c1]
push ebp
push ecx
mov dword [esp + 0x28], eax
mov byte [esp + 0x4c8], 0
call sub.MSVCR80.dll_memset
mov esi, dword [0x5effa4]
add esp, 0xc
test esi, esi
jne 0x506662
push 0x5a8508
call dword [sym.imp.WS2_32.dll_inet_addr]
mov esi, eax
mov dword [0x5effa4], esi
push 0x3ff
lea edx, [esp + 0xb1]
push 0
push edx
mov byte [esp + 0xb8], 0
call sub.MSVCR80.dll_memset
mov bl, byte [0x617f20]
xor eax, eax
mov dword [esp + 0x4c4], eax
mov dword [esp + 0x4c0], eax
mov dword [esp + 0x4b8], eax
mov dword [esp + 0x4bc], eax
mov byte [esp + 0x4c4], al
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x4b4], esi
push eax
lea esi, [esp + 0xb0]
call fcn.00506310
mov dl, byte [esp + 0x4bc]
mov ax, word [esp + 0x4b0]
movzx ecx, dl
imul ecx, ecx, 0x2e8
add esp, 4
xor esi, esi
cmp ax, 3
mov byte [ecx + 0x6012a8], 1
jbe 0x50671d
movzx edx, ax
push edx
push 1
call dword [sym.imp.MSVCR80.dll_calloc]
mov esi, eax
movzx eax, word [esp + 0x4b4]
push eax
lea ecx, [esp + 0xb8]
push ecx
push esi
call sub.MSVCR80.dll_memcpy
mov dl, byte [esp + 0x4cc]
add esp, 0x14
cmp bl, 0x7d
jae 0x506762
mov edi, dword [esp + 0x4b4]
lea esp, [esp]
movzx ecx, bl
lea eax, [ecx*8]
sub eax, ecx
add eax, eax
add eax, eax
cmp dword [eax + 0x600500], ebp
je 0x506762
add bl, 1
cmp bl, 0x7d
mov byte [eax + 0x6004fc], dl
mov dword [eax + 0x60050c], esi
mov dword [eax + 0x600508], edi
jb 0x506730
test bl, bl
mov byte [0x617f20], bl
mov byte [esp + 0x1b], 0
jbe 0x50680f
xor eax, eax
jmp 0x506780
lea esi, [eax*8]
sub esi, eax
add esi, esi
add esi, esi
cmp dword [esi + 0x600508], ebp
jne 0x5067a1
mov edx, dword [0x5effa4]
mov dword [esi + 0x600508], edx
mov edi, dword [esi + 0x600500]
cmp edi, dword [esi + 0x600504]
ja 0x5067f3
xor ebx, ebx
push edi
call sub.WS2_32.dll_htonl
mov ecx, dword [esi + 0x600508]
mov edx, eax
not edx
or edx, ecx
cmp edx, 0xffffffff
je 0x5067cf
or ecx, eax
cmp ecx, 0xffffffff
jne 0x5067e8
mov ecx, dword [esi + 0x600510]
mov eax, edi
sub eax, dword [esi + 0x600500]
mov dword [ecx + eax*8], SysReAllocString
mov dword [ecx + eax*8 + 4], ebx
add edi, 1
cmp edi, dword [esi + 0x600504]
jbe 0x5067b1
mov al, byte [esp + 0x1b]
movzx ecx, byte [0x617f20]
add al, 1
mov byte [esp + 0x1b], al
movsx eax, al
cmp eax, ecx
jl 0x506780
push 0x58dee8
push 0x5e7668
call dword [sym.imp.MSVCR80.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
mov dword [esp + 0x1c], esi
je 0x506d5c
push esi
push 1
lea edx, [esp + 0x4c]
push 0x68
push edx
call dword [sym.imp.MSVCR80.dll_fread]
add esp, 0x10
test eax, eax
je 0x506c05
jmp 0x506850
mov al, byte [esp + 0x46]
cmp al, 0x10
ja 0x506be2
mov esi, dword [esp + 0x4c]
test esi, esi
je 0x50689e
xor cl, cl
jmp 0x506870
movzx edx, cl
mov edx, dword [edx*4 + 0x5edf8c]
test edx, edx
je 0x50689e
cmp edx, esi
je 0x50688c
add cl, 1
cmp cl, 0x7d
jb 0x506870
jmp 0x50689e
movzx ecx, cl
lea ecx, [ecx*4 + 0x5edf8c]
test ecx, ecx
jne 0x506be2
lea ecx, [esp + 0x5c]
push ecx
lea edx, [esp + 0x4c0]
push edx
call fcn.00507530
mov eax, dword [0x619708]
mov edi, dword [eax]
mov esi, 0x619704
add esp, 8
mov dword [esp + 0x24], edi
mov dword [esp + 0x20], esi
jmp 0x5068d0
test esi, esi
mov ebx, dword [0x619708]
je 0x5068e2
cmp esi, 0x619704
je 0x5068e8
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
cmp edi, ebx
je 0x50693d
test esi, esi
jne 0x5068f6
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
cmp edi, dword [esi + 4]
jne 0x506901
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov ebp, dword [edi + 0x28]
test ebp, ebp
je 0x50692a
mov ecx, dword [ebp]
push ecx
lea edx, [esp + 0x4c0]
push edx
call dword [sym.imp.MSVCR80.dll__stricmp]
add esp, 8
test eax, eax
je 0x50693d
mov eax, dword [ebp + 0x18]
cmp eax, dword [esp + 0x4c]
je 0x50693d
lea esi, [esp + 0x20]
call fcn.00526b10
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
jmp 0x5068d0
test esi, esi
mov ebx, dword [0x619708]
je 0x50694f
cmp esi, 0x619704
je 0x506955
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
cmp edi, ebx
je 0x506983
mov ecx, dword [ebp]
push ecx
lea edx, [esp + 0x4c0]
push edx
call dword [sym.imp.MSVCR80.dll__stricmp]
add esp, 8
test eax, eax
jne 0x506be2
mov eax, dword [ebp + 0x18]
cmp eax, dword [esp + 0x4c]
jne 0x506be2
lea ecx, [esp + 0x4bc]
push ecx
call fcn.00507be0
mov ebp, eax
mov eax, dword [esp + 0x50]
add esp, 4
call fcn.00506270
test ebp, ebp
mov bl, al
jne 0x5069ff
test bl, bl
jl 0x5069f7
xor eax, eax
mov dword [0x5e753c], eax
mov dword [0x5e755c], eax
mov dword [0x5e7540], eax
mov dword [0x5e7544], eax
mov dword [0x5e7548], eax
mov dword [0x5e754c], eax
mov dword [0x5e7550], eax
mov dword [0x5e7554], eax
mov dword [0x5e7558], eax
lea edx, [esp + 0x4bc]
mov eax, 0x5e753c
mov byte [0x5e755c], 1
mov dword [0x5e753c], edx
call fcn.005098a0
mov ebp, eax
test ebp, ebp
je 0x506be2
mov eax, dword [ebp]
push eax
lea ecx, [esp + 0x2c]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
lea ecx, [esp + 0x28]
mov dword [esp + 0x50c], 0
call fcn.00509f50
lea ecx, [esp + 0x28]
mov dword [eax], ebp
mov dword [esp + 0x50c], 0xffffffff
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov ecx, dword [esp + 0x4c]
mov dword [ebp + 0x18], ecx
mov byte [ebp + 0x14], bl
mov edx, dword [esp + 0x54]
mov dword [ebp + 8], edx
mov eax, dword [esp + 0x58]
mov edx, dword [ebp + 0x10]
mov dword [ebp + 0xc], eax
movzx ecx, byte [esp + 0x47]
and ecx, 1
or ecx, 2
add ecx, ecx
and edx, 0xfffffffd
or ecx, edx
mov dword [ebp + 0x10], ecx
cmp byte [esp + 0x6c], 0
je 0x506aaf
lea eax, [esp + 0x6c]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x506a76
sub eax, edx
add eax, 1
push eax
push 1
call dword [sym.imp.MSVCR80.dll_calloc]
add esp, 8
test eax, eax
je 0x506aac
lea ecx, [esp + 0x6c]
mov esi, eax
mov edx, ecx
sub esi, edx
mov edi, edi
mov dl, byte [ecx]
mov byte [ecx + esi], dl
add ecx, 1
test dl, dl
jne 0x506aa0
mov dword [ebp + 0x20], eax
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x506b47
mov cl, byte [ebp + 0x14]
test cl, cl
jl 0x506b47
movsx esi, cl
movzx ecx, byte [0x617f20]
cmp esi, ecx
jge 0x506b47
push eax
call sub.WS2_32.dll_htonl
lea ecx, [esi*8]
sub ecx, esi
add ecx, ecx
mov edx, dword [ecx + ecx + 0x600500]
add ecx, ecx
cmp eax, edx
jb 0x506b47
cmp eax, dword [ecx + 0x600504]
ja 0x506b47
sub eax, edx
test eax, eax
jl 0x506b47
movsx ecx, byte [ebp + 0x14]
lea edx, [ecx*8]
sub edx, ecx
mov ecx, dword [edx*4 + 0x600510]
cmp dword [ecx + eax*8], 0x7fffffff
lea ecx, [ecx + eax*8]
jne 0x506b25
cmp dword [ecx + 4], 0
je 0x506b30
mov edx, dword [ebp + 8]
mov dword [ecx], edx
mov edx, dword [ebp + 0xc]
mov dword [ecx + 4], edx
movsx ecx, byte [ebp + 0x14]
lea edx, [ecx*8]
sub edx, ecx
mov ecx, dword [edx*4 + 0x600514]
mov dword [ecx + eax*4], ebp
cmp byte [esp + 0x6c], 0
je 0x506be2
cmp byte [0x617f25], 2
je 0x506be2
mov edx, dword [esp + 0x58]
cmp edx, dword [0x61972c]
jl 0x506be2
jg 0x506b79
mov eax, dword [esp + 0x54]
cmp eax, dword [0x619728]
jbe 0x506be2
cmp dword [0x617df4], 0
mov esi, dword [ebp + 0x18]
je 0x506ba1
push esi
call sub.WS2_32.dll_htonl
cmp eax, dword [0x617df4]
jb 0x506ba1
push esi
call sub.WS2_32.dll_htonl
cmp eax, dword [0x617df8]
jbe 0x506bac
mov eax, esi
call fcn.00506270
test al, al
jl 0x506bc3
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x54]
mov eax, dword [ebp + 0x18]
push 3
push ecx
push edx
push eax
lea ecx, [esp + 0x7c]
push ecx
jmp 0x506bd8
mov edx, dword [esp + 0x58]
mov eax, dword [esp + 0x54]
mov ecx, dword [ebp + 0x18]
push 4
push edx
push eax
push ecx
lea edx, [esp + 0x7c]
push edx
push 0
call fcn.005037c0
add esp, 0x18
mov eax, dword [esp + 0x1c]
push eax
push 1
lea ecx, [esp + 0x4c]
push 0x68
push ecx
call dword [sym.imp.MSVCR80.dll_fread]
add esp, 0x10
test eax, eax
jne 0x506850
mov esi, dword [esp + 0x1c]
push esi
call dword [sym.imp.MSVCR80.dll_fclose]
add esp, 4
push 0x5a8518
push 0x5e7668
call dword [sym.imp.MSVCR80.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
mov word [0x617e00], 0
je 0x506d5c
mov edx, dword [0x619708]
mov edi, dword [edx]
mov esi, 0x619704
mov dword [esp + 0x24], edi
mov dword [esp + 0x20], esi
lea ebx, [ebx]
test esi, esi
mov ebx, dword [0x619708]
je 0x506c62
cmp esi, 0x619704
je 0x506c68
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
cmp edi, ebx
je 0x506d52
test esi, esi
jne 0x506c7a
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
cmp edi, dword [esi + 4]
jne 0x506c85
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov esi, dword [edi + 0x28]
test esi, esi
je 0x506d3c
mov eax, dword [esi + 0xc]
cmp eax, dword [0x61972c]
jg 0x506cb2
jl 0x506ca8
mov ecx, dword [esi + 8]
cmp ecx, dword [0x619728]
ja 0x506cb2
test byte [esi + 0x10], 1
jne 0x506d3c
push 0x68
lea edx, [esp + 0x48]
push 0
push edx
call sub.MSVCR80.dll_memset
mov byte [esp + 0x52], 0x10
mov eax, dword [esi]
add esp, 0xc
lea ebx, [esp + 0x46]
lea ecx, [esp + 0x5c]
call fcn.00507700
mov eax, dword [esi + 0x18]
mov dword [esp + 0x4c], eax
mov ecx, dword [esi + 8]
mov dword [esp + 0x54], ecx
mov edx, dword [esi + 0xc]
mov dword [esp + 0x58], edx
mov eax, dword [esi + 0x10]
shr eax, 1
and al, 1
mov byte [esp + 0x47], al
mov ecx, dword [esi + 0x20]
test ecx, ecx
je 0x506d10
lea edx, [esp + 0x6c]
mov al, byte [ecx]
mov byte [edx], al
add ecx, 1
add edx, 1
test al, al
jne 0x506d02
mov ax, word [0x617e00]
push ebp
add ax, 1
push 1
lea ecx, [esp + 0x4c]
push 0x68
mov word [0x617e00], ax
mov word [esp + 0x50], ax
push ecx
mov word [esi + 0x16], ax
call dword [sym.imp.MSVCR80.dll_fwrite]
add esp, 0x10
lea esi, [esp + 0x20]
call fcn.00526b10
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
jmp 0x506c50
push ebp
call dword [sym.imp.MSVCR80.dll_fclose]
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x504]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4e8]
xor ecx, esp
call fcn.00569ed6
add esp, 0x4fc
ret